Skip to content

Conversation

@xBlaz3kx
Copy link
Contributor

Add report for playwright on PR comment

@evcc-bot evcc-bot added enhancement New feature or request infrastructure Basic functionality labels Dec 17, 2025
@xBlaz3kx xBlaz3kx force-pushed the feat/playwright-test-report branch from 0a6c279 to ec80899 Compare December 17, 2025 22:57
@xBlaz3kx
Copy link
Contributor Author

Playwright test results

passed 196 passed
flaky 3 flaky
skipped 1 skipped

Details

stats 200 tests across 49 suites
duration 2 minutes, 9 seconds
commit ec80899

Flaky tests

chromium › battery-settings-co

@xBlaz3kx xBlaz3kx force-pushed the feat/playwright-test-report branch 2 times, most recently from ef3f6cb to e58a39a Compare December 17, 2025 23:23
@naltatis naltatis self-requested a review December 18, 2025 13:23
- uses: actions/checkout@v6
with:
persist-credentials: false
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a security issue. Why is this needed for this feature?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GH Action doesnt want to comment on the pr for some reason:

Unable to comment on PR
Unable to comment on your PR — this can happen for PR's originating from a fork without write permissions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but with this change people can run code from a fork within the permission boundaries of this project and get access to actions secrets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well then the action will only work for people with write access to the original repo.

Agreed that this is not a good practice, but I dont know how else to go around this?

@xBlaz3kx xBlaz3kx force-pushed the feat/playwright-test-report branch from e58a39a to e701bda Compare December 18, 2025 14:06
@xBlaz3kx xBlaz3kx force-pushed the feat/playwright-test-report branch from e701bda to caec6c1 Compare December 18, 2025 17:34
@xBlaz3kx xBlaz3kx marked this pull request as ready for review December 18, 2025 20:14
@xBlaz3kx xBlaz3kx requested a review from naltatis December 18, 2025 20:14
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Marking the Playwright test step with continue-on-error: true will let the workflow succeed even when tests fail; if you still want failures to block merges, consider moving continue-on-error only to the report/comment step or gating the job status based on the test result.
  • The Playwright config now always emits JSON reports (including for local runs); if the JSON is only needed in CI for the PR summary, consider making the JSON reporter conditional on process.env.CI to avoid unnecessary artifacts locally.
  • The new permission comment still refers to "coverage reports" even though it's used for Playwright test summaries; updating the comment will keep the workflow configuration self-explanatory.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Marking the Playwright test step with `continue-on-error: true` will let the workflow succeed even when tests fail; if you still want failures to block merges, consider moving `continue-on-error` only to the report/comment step or gating the job status based on the test result.
- The Playwright config now always emits JSON reports (including for local runs); if the JSON is only needed in CI for the PR summary, consider making the JSON reporter conditional on `process.env.CI` to avoid unnecessary artifacts locally.
- The new permission comment still refers to "coverage reports" even though it's used for Playwright test summaries; updating the comment will keep the workflow configuration self-explanatory.

## Individual Comments

### Comment 1
<location> `.github/workflows/default.yml:272-276` </location>
<code_context>

       - name: Run tests
-        run: npx playwright test
+        run: PLAYWRIGHT_JSON_OUTPUT_NAME=results.json npx playwright test
         timeout-minutes: 20
         env:
           TZ: Europe/Berlin
+        continue-on-error: true

       - uses: actions/upload-artifact@v5
</code_context>

<issue_to_address>
**issue (bug_risk):** Marking the Playwright test step as `continue-on-error` can let the workflow succeed even if tests fail.

Because this step (and the summary step) use `continue-on-error: true`, the workflow can pass even when Playwright tests fail, unless a later step explicitly checks the results and fails. If you want reports to always be generated but the job to still fail on test failures, consider keeping this step as a normal failing step and running reporting in a separate step with `if: always()` instead of using `continue-on-error` here.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@naltatis naltatis self-assigned this Dec 19, 2025
@github-actions github-actions bot added the stale Outdated and ready to close label Dec 26, 2025
@andig andig marked this pull request as draft December 27, 2025 11:48
@github-actions github-actions bot removed the stale Outdated and ready to close label Dec 27, 2025
@github-actions github-actions bot added the stale Outdated and ready to close label Jan 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request infrastructure Basic functionality stale Outdated and ready to close

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants