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

Test summary start time in locale causes issues with junit reporter #323

Closed
JonnyPower opened this issue Jul 22, 2023 · 1 comment
Closed

Comments

@JonnyPower
Copy link
Contributor

JonnyPower commented Jul 22, 2023

Summary

The syncTests.ts and asyncTests.ts build test summary JSON with start times in local locale. Later, when using these summaries to generate a junit report, the Date constructor fails to construct a valid date, causing a failure at;

RangeError: Invalid time value
    at Date.toISOString (<anonymous>)
    at JUnitReporter.format (/Users/jpower/Code/sfpowerscripts/packages/core/node_modules/@salesforce/apex-node/src/reporters/junitReporter.ts:32:61)

Should the test summary just have an ISO date string for start time instead, given intention to programmatically parse again later in junit reporter?

Steps To Reproduce:

  1. Setup machine to have a locale that will produce a date time string like: Sat Jul 22 2023 9:54:03 a.m. (like en-CA)
  2. Run apex tests via apex-node
  3. Use junit reporter to save results

Expected result

  1. Expect correctly parsed date

Actual result

  1. Error, invalid time value

Additional information

Apex library Version: "@salesforce/apex-node": "1.1.0"
OS and version: Darwin TRAC-C02F314EML7L 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 x86_64

JonnyPower added a commit to Traction-Rec/salesforcedx-apex that referenced this issue Jul 22, 2023
JonnyPower added a commit to Traction-Rec/salesforcedx-apex that referenced this issue Jul 22, 2023
@shetzel
Copy link
Collaborator

shetzel commented Nov 10, 2023

This should be fixed with #334. Please reopen if the problem still occurs.

@shetzel shetzel closed this as completed Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants