ci(backend): upload gradle test report when unit tests fail#1140
ci(backend): upload gradle test report when unit tests fail#1140fengelniederhammer wants to merge 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| @Test | ||
| fun `THIS TEST INTENTIONALLY FAILS to verify test report upload works`() { | ||
| assertThat("expected", org.hamcrest.Matchers.equalTo("actual")) | ||
| } |
There was a problem hiding this comment.
Revert before merge.
There was a problem hiding this comment.
Pull request overview
This PR aims to improve backend CI diagnostics by uploading the Gradle HTML unit test report as a GitHub Actions artifact, so failures can be inspected without digging through logs (resolves #1120).
Changes:
- Add an artifact upload step to the backend GitHub Actions workflow for the Gradle test report directory.
- Add a (currently) intentionally failing backend unit test to validate the artifact upload behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
backend/src/test/kotlin/org/genspectrum/dashboardsbackend/util/DateProviderTest.kt |
Adds an intentionally failing test to force CI failure for manual verification. |
.github/workflows/backend.yml |
Uploads the Gradle test report directory as an Actions artifact after running ./gradlew test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @Test | ||
| fun `THIS TEST INTENTIONALLY FAILS to verify test report upload works`() { | ||
| assertThat("expected", org.hamcrest.Matchers.equalTo("actual")) | ||
| } |
There was a problem hiding this comment.
This intentionally failing test will cause the entire backend test suite (and CI) to fail on every run. Please remove it before merging, or at least mark it as skipped (e.g., with a JUnit @disabled) if you still need a temporary CI verification hook.
| - name: Upload test report | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: backend-test-report | ||
| path: backend/build/reports/tests/test/ |
There was a problem hiding this comment.
The PR title/summary says to upload the test report when unit tests fail, but if: always() will upload artifacts even on successful runs. Consider switching this to if: failure() (or matching the repo’s pattern if: ${{ !cancelled() }} plus a failure condition) to avoid unnecessary artifact storage and keep behavior aligned with the PR intent.
resolves #1120
Summary
Upload the Gradle test report on failed backend unit tests
Screenshot
PR Checklist
- [ ] All necessary documentation has been adapted.- [ ] The implemented feature is covered by an appropriate test.