Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to retrieve Test Report on deploy commands #1089

Closed
jefersonchaves opened this issue Jul 23, 2021 · 10 comments
Closed

Ability to retrieve Test Report on deploy commands #1089

jefersonchaves opened this issue Jul 23, 2021 · 10 comments
Labels
feature Issue or pull request for a new feature

Comments

@jefersonchaves
Copy link

jefersonchaves commented Jul 23, 2021

Is your feature request related to a problem? Please describe.
Today we cannot retrieve test results nor coverage when executing deployments (e.g. sfdx force:source:deploy), which is especially useful for validation deployment --checkonly in conjunction with running the test. That also would be valuable on production deployment as proof of deployment course.

What are you trying to do
Run validation deployment with tests against a sandbox and retrieve test results for CI build (JUnit format or similar).

Describe the solution you'd like
Similar switches to sfdx force:apex:test:run such as --outputdir, --codecoverage, and --resultformat=(human|tap|junit|json).

Describe alternatives you've considered
Performing the deployment on sandbox and then running the tests would not be ideal because it could leave unused fields between development iterations.

@jefersonchaves jefersonchaves added the feature Issue or pull request for a new feature label Jul 23, 2021
@github-actions
Copy link

Thank you for filing this feature request. We appreciate your feedback and will review the feature at our next grooming or sprint planning session. We prioritize feature requests with more upvotes and comments.

@uip-robot-zz
Copy link

This issue has been linked to a new work item: W-9646703

@alan-morey
Copy link

See also #57

@jefersonchaves
Copy link
Author

Thanks @alan-morey, I could not find that, previously, but it makes sense to link the two together, and I guess this means that more people have a similar use case.

@mshanemc mshanemc added the more information required Issue requires more information or a response from the customer label Oct 5, 2021
@mshanemc
Copy link
Contributor

mshanemc commented Oct 5, 2021

@jefersonchaves @alan-morey when you run source:deploy, you get the testResults as part of the response, right?

I know it's just --json and not all the formats you might want (use --verbose for ALL the file-level details) but would that be parseable (ex: using jq)?

@jefersonchaves
Copy link
Author

jefersonchaves commented Oct 5, 2021

Hey @mshanemc, I can certainly try that (today I receive 0 test results), but if the results are given to the SFDX engine would not be fair to ask this to be exposed similarly to sfdx force:apex:test:run?

Update: I have tested with --json and I can see that runTestResult is returned and I could hack away to get the results and build my own JUnit result for the reporter, but because this is not documented I would prefer the ability to specify the reporter result.

@no-response no-response bot removed the more information required Issue requires more information or a response from the customer label Oct 5, 2021
@alan-morey
Copy link

Hi @mshanemc using sfdx force:mdapi:deploy with --json, I can see the test results in the json so technically it's possible to grok this and hack something together.

However, I think the better option would be for the "deploy" commands to offer this as a feature, instead of pushing this onto the developer community to build their own solutions to get Junit reports from undocumented json result format. Considering there is already Junit report generation in force:apex:test:run command, maybe that code could be reused for "deploy" commands too?

One of my goals here is to just be able to specify the path to a Junit file as a post build action on the configuration of a Jenkins job and let Jenkins do its thing with that file.

@peter-caitens
Copy link

This is certainly a feature I would use. It would enable me to pass on the test results with code coverage to our instance of sonarcloud for reporting in there.
Is there any update for this issue?

@jefersonchaves
Copy link
Author

It seems that this was delivered, see the salesforcecli/plugin-source#491

@jefersonchaves
Copy link
Author

It seems that it was delivered as part of 7.153.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Issue or pull request for a new feature
Projects
None yet
Development

No branches or pull requests

5 participants