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

The project deploy report command doesn't output junit results or code coverage. #2265

Closed
jjulicher opened this issue Jun 27, 2023 · 3 comments
Labels
bug Issue or pull request that identifies or fixes a bug validated Version information for this issue has been validated

Comments

@jjulicher
Copy link

jjulicher commented Jun 27, 2023

Summary

When executing the following:
sfdx project deploy start --target-org=<org>--metadata ApexClass:SomeClass--test-level=RunSpecifiedTests --tests=ATest --async --ignore-warnings
and then

sfdx project deploy report --job-id="<JobId>" --coverage-formatters=cobertura --junit --json --results-dir results

for a successful deployment it doesn't output any junit or coverage results.

It only output:

Deploy Info

| Key Value
| ──────────────────────── ────────────────────────
| checkOnly false
| completedDate 2023-06-27T11:20:21.000Z
| createdBy 0058t000000HnuG
| createdByName Justin Julicher
| createdDate 2023-06-27T11:19:53.000Z
| done true
| id 0Af9j000004Kly9CAC
| ignoreWarnings true
| lastModifiedDate 2023-06-27T11:20:21.000Z
| numberComponentErrors 0
| numberComponentsDeployed 1
| numberComponentsTotal 1
| numberTestErrors 0
| numberTestsCompleted 1
| numberTestsTotal 1
| rollbackOnError true
| runTestsEnabled true
| startDate 2023-06-27T11:20:05.000Z
| status Succeeded
| success true

Note: if you do the same with the resume command it works but ignores the directory you specified and outputs to 'coverage' so then you have a directory structure like:

coverage/coverage/cobotura.xml

Also:

If I run the sfdx force source deploy report --jobid=

I get the following output:

Deploy ID: 0Af9j000004Kly9CAC
Status: Succeeded
Deployed: 1/1 Errors: 0
Tests Complete: 1/1 Errors: 0
Code Coverage formats, [cobertura], written to results/coverage
Junit results written to results/junit/junit.xml

which is what is expected.

Steps To Reproduce

Run the same commands as above.

Expected result

The junit and cobertura results should have been output to the results directory.

Actual result

No files were published anywhere.

System Information

Using Zsh

{
  "cliVersion": "sfdx-cli/7.206.6",
  "architecture": "wsl-x64",
  "nodeVersion": "node-v18.16.0",
  "osVersion": "Linux 4.4.0-19041-Microsoft",
  "shell": "zsh",
  "rootPath": "/home/justin/.nvm/versions/node/v18.16.0/lib/node_modules/sfdx-cli",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 2.3.0 (core)",
    "@oclif/plugin-commands 2.2.15 (core)",
    "@oclif/plugin-help 5.2.9 (core)",
    "@oclif/plugin-not-found 2.3.25 (core)",
    "@oclif/plugin-plugins 3.1.2 (core)",
    "@oclif/plugin-search 0.0.17 (core)",
    "@oclif/plugin-update 3.1.18 (core)",
    "@oclif/plugin-version 1.3.4 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.37 (core)",
    "@oclif/plugin-which 2.2.22 (core)",
    "apex 2.3.3 (core)",
    "auth 2.8.1 (core)",
    "community 2.3.2 (core)",
    "custom-metadata 2.1.26 (core)",
    "data 2.3.24 (core)",
    "deploy-retrieve 1.12.0 (core)",
    "info 2.6.20 (core)",
    "limits 2.3.20 (core)",
    "org 2.9.12 (core)",
    "packaging 1.20.0 (core)",
    "schema 2.3.13 (core)",
    "settings 1.4.12 (core)",
    "signups 1.4.22 (core)",
    "source 2.10.15 (core)",
    "telemetry 2.2.1 (core)",
    "templates 55.4.21 (core)",
    "trust 2.4.20 (core)",
    "user 2.3.17 (core)",
    "sfdx-cli 7.206.6 (core)",
    "sfdx-git-delta 5.22.0 (user)",
    "sfpowerkit 6.1.0 (user)"
  ]
}

Additional information

@jjulicher jjulicher added the investigating We're actively investigating this issue label Jun 27, 2023
@github-actions github-actions bot added the validated Version information for this issue has been validated label Jun 27, 2023
@github-actions
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@WillieRuemmele WillieRuemmele added bug Issue or pull request that identifies or fixes a bug and removed investigating We're actively investigating this issue labels Jun 27, 2023
@git2gus
Copy link

git2gus bot commented Jun 27, 2023

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

@WillieRuemmele
Copy link
Member

WillieRuemmele commented Jun 27, 2023

Hey @jjulicher - after looking into this more, you're right that those flags aren't working, but to get this information, we must request it with the original deploy start command. The deploy report will remember what flags and test output were provided for the deployment.

➜  dreamhouse-lwc git:(main) ✗  hub:(DevHub) scratch:([email protected])
 ➜  sf project deploy start --source-dir force-app --test-level RunAllTestsInOrg --results-dir gh-test-async --async --coverage-formatters html
Deploying v58.0 metadata to [email protected] using the v58.0 SOAP API.
Deploy ID: 0Af52000029viP1CAI
Warning: You requested an async deploy with code coverage or JUnit results. The reports will be available when the deploy completes.
Deploy has been queued.

Run "sf project deploy resume --job-id 0Af52000029viP1CAI" to resume watching the deploy.
Run "sf project deploy report --job-id 0Af52000029viP1CAI" to get the latest status.
Run "sf project deploy cancel --job-id 0Af52000029viP1CAI" to cancel the deploy.
➜  dreamhouse-lwc git:(main) ✗  hub:(DevHub) scratch:([email protected])
 ➜  sf project deploy report --use-most-recent                                                           
0Af52000029viP1CAI... Succeeded

Deploy Info
===================================================
| Key                      Value                    
| ──────────────────────── ──────────────────────── 
| checkOnly                false                    
| completedDate            2023-06-27T20:26:20.000Z 
| createdBy                00552000009Sgqq          
| createdByName            User User                
| createdDate              2023-06-27T20:25:54.000Z 
| done                     true                     
| id                       0Af52000029viP1CAI       
| ignoreWarnings           false                    
| lastModifiedDate         2023-06-27T20:26:20.000Z 
| numberComponentErrors    0                        
| numberComponentsDeployed 92                       
| numberComponentsTotal    92                       
| numberTestErrors         0                        
| numberTestsCompleted     11                       
| numberTestsTotal         11                       
| rollbackOnError          true                     
| runTestsEnabled          true                     
| startDate                2023-06-27T20:25:54.000Z 
| status                   Succeeded                
| success                  true                     

Deploy Options
======================================================================================
| Key                 Value                                                            
| ─────────────────── ──────────────────────────────────────────────────────────────── 
| test-level          RunAllTestsInOrg                                                 
| results-dir         gh-test-async                                                    
| async               true                                                             
| coverage-formatters [ 'html' ]                                                       
| dry-run             false                                                            
| ignore-conflicts    false                                                            
| ignore-errors       false                                                            
| ignore-warnings     false                                                            
| target-org          [email protected]                                    
| api                 SOAP                                                             
| manifest            /Users/william.ruemmele/.sf/manifestCache/0Af52000029viP1CAI.xml 
| wait                33                                                               
| isMdapi             false                                                            

Deployed Source
=================================================================================================================================================================================
| State     Name                                Type                     Path                                                                                                     
| ───────── ─────────────────────────────────── ──────────────────────── ──────────────────────────────────────────────────────────────────────────────────────────────────────── 
...                  
| Unchanged sample_data_properties              StaticResource           force-app/main/default/staticresources/sample_data_properties.resource-meta.xml                          

Test Results Summary
Passing: 11
Failing: 0
Total: 11
Time: 6607
Code Coverage formats, [html], written to gh-test-async/

you can see the last line above references the "gh-test-async" dir that was provided in the deploy start command

we'll also fix those flags so that any flags provided with the project deploy report command override what was provided from the original command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

3 participants