Skip to content

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

Merged
jaysoo merged 1 commit intomasterfrom
fix/playwright-junit-outfile
Jan 28, 2025
Merged

fix(testing): infer correct file output paths for atomized targets#29766
jaysoo merged 1 commit intomasterfrom
fix/playwright-junit-outfile

Conversation

@jaysoo
Copy link
Copy Markdown
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
@vercel
Copy link
Copy Markdown

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

@nx-cloud
Copy link
Copy Markdown
Contributor

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

Comment thread packages/playwright/src/plugins/plugin.ts Outdated
@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
@jaysoo jaysoo deleted the fix/playwright-junit-outfile branch January 28, 2025 01:32
@github-actions
Copy link
Copy Markdown
Contributor

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.

2 participants