cli icon indicating copy to clipboard operation
cli copied to clipboard

mdapi:deploy and source:deploy need test results file output

Open loganm opened this issue 5 years ago • 9 comments

My continuous integration process performs a check only deployment to a sandbox and runs all the unit tests. This ensures the code is deployable, and the tests passing before we allow code to be merged into master.

What are you trying to do Generate a junit compatible test results file from a deployment that my CI tool can consume.

Describe the solution you'd like

force:mdapi:deploy ... --testresultsfile test_results.xml --testresultsformat junit
force:source:deploy ... --testresultsfile test_results.xml --testresultsformat junit

Describe alternatives you've considered I believe I could use the json format of the deploy command, and write a script to read out the test results into a junit file. If I did this, we would lose the progress updates, and my script would also have to read and print out the other build results for human consumption.

loganm avatar Mar 28 '19 01:03 loganm

+1 on this. The ability to print a JUnit file in source:deploy is huge for Out of the Box CI/CD test parsing.

MGarfOppLoans avatar Aug 05 '19 21:08 MGarfOppLoans

I think this is a required feature of the CLI for integration with a CI.

I would like to add that not only should the force:mdapi:deploy and force:source:deploy commands have the option to return test resuts, but also their equivilant report commands as well.

force:mdapi:deploy:report -i ... -f test_results.xml -r junit
force:source:deploy:report -i ... -f test_result.xml -r junit

Without this currently in place, is there a workaround to getting the results after the deploy command has completed? Or can we only rely on the output of the report command?

SaoBiz avatar Sep 18 '19 05:09 SaoBiz

+1 on this. The ability to print a JUnit file in source:deploy is huge for Out of the Box CI/CD test parsing.

+1. We need it for validate new code using Sonar Cloud too. Without a proper test report generated from mdapi:deploy -c, if using apex:test:run, we are only able to get test result from code that are already deployed on cloud, which is not reliable.

CauchyAbel-zz avatar Nov 28 '19 16:11 CauchyAbel-zz

any update on this topic? we are facing exactly the same issue :(

+1 on this. The ability to print a JUnit file in source:deploy is huge for Out of the Box CI/CD test parsing.

+1. We need it for validate new code using Sonar Cloud too. Without a proper test report generated from mdapi:deploy -c, if using apex:test:run, we are only able to get test result from code that are already deployed on cloud, which is not reliable.

lopezfra avatar Nov 16 '20 17:11 lopezfra

+1

microm123 avatar Jul 24 '21 22:07 microm123

+1

depill avatar Oct 03 '21 11:10 depill

+1

joneychow-intertek avatar Dec 17 '21 05:12 joneychow-intertek

Just wanted to weigh back in here and say, I could still use this feature.

loganm avatar Dec 26 '21 13:12 loganm

To anyone following this issue, It looks like this will be implemented in 7.153.0

I still need to test it myself

https://github.com/forcedotcom/cli/tree/main/releasenotes/sfdx#71530-june-2-2022-stable-rc

loganm avatar May 30 '22 23:05 loganm