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

fix(testing): infer correct file output paths for atomized targets #29766

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Jan 27, 2025

There is a bug when outputFile is specified in playright.config.ts, and atomizer is enabled via ciTargetName, then the path of the output file is wrong.

For example, if you have this reporters entry:

reporter: [
  [
    'junit',
    {
      outputFile: 'dist/report.xml',
    },
  ],
],

Then the atomized output file would be something like dist/report.xml/example-spec-ts, where report.xml is a directory. The correct output file should be dist/example-spec-ts/report.xml to avoid conflict with the non-atomized output of dist/report.xml.

Current Behavior

If you run nx e2e proj then nx e2e-ci proj then you can run into an issue where report.xml (or whatever the file name is) is a directory in the cache, but it is a file currently -- or vice versa. This happens due to the bug described above.

Expected Behavior

The outputFile should never cause a conflict where a path should be a directory but is currently a file, or vice versa.

Related Issue(s)

Fixes #

@jaysoo jaysoo requested a review from a team as a code owner January 27, 2025 20:16
@jaysoo jaysoo requested a review from leosvelperez January 27, 2025 20:16
Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Jan 27, 2025 8:38pm

Copy link

nx-cloud bot commented Jan 27, 2025

View your CI Pipeline Execution ↗ for commit b497996.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 29m 10s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 1m 6s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx format:check --base=82c4e... ✅ Succeeded 23s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 22s View ↗
nx documentation --no-dte ✅ Succeeded 44s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-27 21:10:52 UTC

@jaysoo jaysoo force-pushed the fix/playwright-junit-outfile branch from fad5ebb to b497996 Compare January 27, 2025 20:35
@jaysoo jaysoo merged commit e0c49d3 into master Jan 28, 2025
6 checks passed
@jaysoo jaysoo deleted the fix/playwright-junit-outfile branch January 28, 2025 01:32
Copy link

github-actions bot commented Feb 3, 2025

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants