dmc icon indicating copy to clipboard operation
dmc copied to clipboard

Files Must Be Located In 'src' Folder

Open grumpytechdude opened this issue 9 years ago • 1 comments

Our SF Code is located in several folders, one of which is called 'source', another of which is called 'systemtests'. It'd be great if dmc could support specifying source folders! Currently, if you try and deploy a file that does not exist in the 'src' folder (which for us doesn't exist), you get

$ dmc deploy source/classes/Test1.cls
[dmc] using org: <orgname> (default)
[dmc] searching for local metadata
[dmc] deploying 1 metadata files
[err] unrecognized file path: source/classes/Test1.cls
[dmc] [NOT OK]

Symlinks don't seem to work, the file has to explicitly be in the 'src' folder:

$ dmc deploy src/classes/Test1.cls
[dmc] using org: <orgname> (default)
[dmc] searching for local metadata
[dmc] deploying 1 metadata files
[dmc] deploy mode: dynamic
[dmc] deploy api: tooling
[dmc] loading related metadata ids
[dmc] loaded 1 ids
[dmc] creating stub files
[dmc] created 0 stub files
[dmc] creating static resources
[dmc] deployed 0 static resources
[dmc] creating container
[dmc] [create] metadata container:
[dmc] [create] container member: ApexClass::Test11
[dmc] Deploying...
[dmc] * deploy status: Queued

This has an impact on Tests too. If you specify no arguments, it runs all tests:

$ dmc test --verbose [dmc] using org: (default) [dmc] processing 920 records [dmc] * src/classes/Test1.cls [dmc] * src/classes/Test2.cls

But if you specify anything else, it fails to find the tests:

$ dmc test --verbose */ [dmc] using org: (default) [dmc] processing 920 records [dmc] no tests found that match [dmc] [OK]

$ dmc test --verbose source/classes/Test1* [dmc] using org: [email protected] (default) [dmc] processing 920 records [dmc] no tests found that match [dmc] [OK]

And if you copy the test into the 'src' folder, it works!

$ dmc test --verbose src/classes/Test1.cls [dmc] using org: (default) [dmc] processing 920 records [dmc] * src/classes/Test1.cls [dmc] ===> StagingVersionsTest test results <=== [dmc] [pass] Test1:Method1 [dmc] [pass] Test1:Method2 [dmc] [pass] Test1:Method3 [dmc] [pass] Test1:Method4 [dmc] [OK]

grumpytechdude avatar Aug 11 '16 11:08 grumpytechdude

Yep, I thought about adding that as a config option. I just haven't gotten to that one yet. I'm open to pull requests if you want to take a crack at it.

kevinohara80 avatar Sep 30 '16 00:09 kevinohara80