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

[Feature] Docs: Add env variable 'PWTEST_BLOB_REPORT_NAME' for blob reports to official documentation or implement different solution than environment variable for this behaviour #27284

Closed
milos-pujic opened this issue Sep 25, 2023 · 3 comments · Fixed by #28634
Assignees
Labels

Comments

@milos-pujic
Copy link

milos-pujic commented Sep 25, 2023

I was lucky enough to learn about the environment variable 'PWTEST_BLOB_REPORT_NAME' which enables us to customize the blob report name. It was a deal breaker for our CI setup not being able to customize the blob report name if we were to transition from the unofficial playwright-merge-html-reports package to the playwright's implementation. Our CI has the following matrix setup

  matrix:
    project: [chromium, firefox, webkit]
    shardIndex: [1, 2]
    shardTotal: [2]

with run command

npx playwright test --project=${{ matrix.project }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}

With default blob report behaviour at the end we got report-1 and report-2 zip files from the last one which override them, but having the possibility to configure blob name with env variable PWTEST_BLOB_REPORT_NAME='${{ matrix.project }}' made the transition possible, because now we have correct 6 zip files:

all-blob-reports/report-chromium-1.zip
all-blob-reports/report-chromium-2.zip
all-blob-reports/report-firefox-1.zip
all-blob-reports/report-firefox-2.zip
all-blob-reports/report-webkit-1.zip
all-blob-reports/report-webkit-2.zip

making it possible to have a properly merged HTML report at the end.

After that, I was puzzled as to why this was not part of official documentation and I had to "dig" it out from someone else comment who had picked it out from the code.

Was it added as a workaround for your own pipelines? Is it temporary? Will there be some more appropriate solution like configuration property or similar?

Past references: #26481 and #26508

@milos-pujic milos-pujic changed the title [Feature] Add env variable 'PWTEST_BLOB_REPORT_NAME' for blob reports to official documentation or create different solution [Feature] Add env variable 'PWTEST_BLOB_REPORT_NAME' for blob reports to official documentation or implement different solution than environment variable for this behaviour Sep 25, 2023
@milos-pujic milos-pujic changed the title [Feature] Add env variable 'PWTEST_BLOB_REPORT_NAME' for blob reports to official documentation or implement different solution than environment variable for this behaviour [Feature] Docs: Add env variable 'PWTEST_BLOB_REPORT_NAME' for blob reports to official documentation or implement different solution than environment variable for this behaviour Sep 25, 2023
@yury-s
Copy link
Member

yury-s commented Sep 25, 2023

Was it added as a workaround for your own pipelines? Is it temporary? Will there be some more appropriate solution like configuration property or similar?

It was added for a little different scenario and we didn't want to publish it in the present form as it ergonomics is suboptimal. For your scenario it sounds like having a reportName option would be sufficient it then could be set to something like that in your code:

"reportName": `report-${process.env.PROJECT}.zip`

@yury-s yury-s self-assigned this Sep 25, 2023
@yury-s yury-s added the v1.39 label Sep 25, 2023
@milos-pujic
Copy link
Author

It was added for a little different scenario and we didn't want to publish it in the present form as it ergonomics is suboptimal. For your scenario it sounds like having a reportName option would be sufficient it then could be set to something like that in your code:

"reportName": `report-${process.env.PROJECT}.zip`

Thx for the answer.
Yes, the proposed solution to have described reportName option would be perfect, but also, with keeping that shard number at the end of the file name. Maybe to omit the extension .zip at the end just to avoid confusion regarding those shard numbers.

@dgozman dgozman added v1.40 and removed v1.39 labels Oct 2, 2023
@yury-s yury-s added v1.41 and removed v1.40 labels Nov 6, 2023
yury-s added a commit that referenced this issue Dec 7, 2023
yury-s added a commit that referenced this issue Dec 15, 2023
@yury-s yury-s reopened this Jan 26, 2024
@yury-s yury-s added v1.42 and removed v1.41 labels Jan 26, 2024
@dgozman dgozman added v1.43 and removed v1.42 labels Feb 5, 2024
@dgozman dgozman added v1.44 and removed v1.43 labels Mar 25, 2024
@pavelfeldman
Copy link
Member

Folding into #27284 that has action items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants