-
Notifications
You must be signed in to change notification settings - Fork 26
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
Unable to get Junit test result format when running Apex tests #213
Comments
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. |
fyi: @AnanyaJha |
Hi @alan-morey thanks for reporting this! Unfortunately, we weren't able to repro this locally. Can you provide us with a sample repository to test out this scenario? |
@AnanyaJha Did you try to reproduce on Linux? FYI, it does not seem to be a bug on Windows, my team are on Windows machines and |
@alan-morey are you still facing this issue with a current CLI? I tried to reproduce this issue just now on my mac with the CLI version 7.126.0, and the junit looks good for me (test code snippet failing as expected). |
@randi274 Yes, still facing this issue. Yesterday I upgraded to latest and still problem persists
Taking a deeper look into this, I have an actual JSON response example as follows:
I see Based on the error I am receiving:
Having a look at the
We can see that Maybe when the JSON response is being built, it's not correctly formatting the |
Thanks for the callout on the time value you were using @alan-morey, that does seem to be the root cause here! I stubbed out the value |
This issue has been linked to a new work item: W-10226817 |
Thanks for the info @alan-morey, @randi274 The issue seems to be with
|
@alan-morey Can you please post the output of the |
My machine locale is as follows:
|
@mohanraj-r When the output is to JSON, I think the However, if the output is just plain text to standard output, then using the user's locale does make sense for more human friendly reading. |
Agree @alan-morey was thinking the same I am finally able to reproduce the error by setting the locale in env (even in osx)
I will do some more final verification and start on a fix. |
Hi there, Command: Output: Seems to be working fine on my Mac, just on CICD it's not working for the last week (Linux based machines) |
Fixed the issue, I started using a docker container recently and noticed the previous comments about Language and Locale not being set. Setting these environment variables in the image fixed the issue for me too! For those on linux based CICD or using containers with SFDX CLI. Ensure locale is being set using something like this:
|
Any idea about how to fix that with an alpine linux image ? |
Fix Invalid Time Value
…decoverage + branchPrefixChoices (#301) * Clean LWC with hidden content * xxx * workaround for Dockerfile ? * Replace prompts by inquirer v0 * Fix * prompts * Workaround for Workaround for forcedotcom/salesforcedx-apex#213 Fix Invalid Time Value * changelog * cspell * MegaLinter config * Upgrade simple-git * [Mega-Linter] Apply linters fixes --------- Co-authored-by: nvuillam <[email protected]>
For those who are still stuck, I made a workaround in sfdx-hardis latest docker image It contains sfdx-cli & other plugins If you have your own dockerfile, feel free to copy my ugly hack at the end of the Dockerfile -> https://github.com/hardisgroupcom/sfdx-hardis/blob/main/Dockerfile |
Closing this since it should be fixed with #334 |
Summary
Error "Invalid time value" occurs when executing
force:apex:test:run
orforce:apex:test:report
with the result format specified as-r junit
Steps To Reproduce:
MyTest.cls
Run apex test and specify result format as junit:
Expected result
Expected test results written to standard output in Junit format
Actual result
Results are output as JSON and error occurs
Additional information
Same result occurs when using
force:apex:test:report
If the output directory flag is also specified, the output is slightly different but the result is still an error.
No output files are written and the output directory
test-results
does not gets created.SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.107.0 linux-x64 node-v14.17.1
SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
OS and version: Ubuntu 18.04.5 LTS
The text was updated successfully, but these errors were encountered: