Skip to content

ci(backend): upload gradle test report when unit tests fail#1140

Open
fengelniederhammer wants to merge 1 commit intomainfrom
1120-ci-backend-tests-allow-downloading-test-report
Open

ci(backend): upload gradle test report when unit tests fail#1140
fengelniederhammer wants to merge 1 commit intomainfrom
1120-ci-backend-tests-allow-downloading-test-report

Conversation

@fengelniederhammer
Copy link
Copy Markdown
Contributor

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.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboards Ready Ready Preview, Comment Apr 14, 2026 7:29am

Request Review

Comment on lines +18 to +21
@Test
fun `THIS TEST INTENTIONALLY FAILS to verify test report upload works`() {
assertThat("expected", org.hamcrest.Matchers.equalTo("actual"))
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Revert before merge.

@fengelniederhammer fengelniederhammer changed the title ci(backend): upload gradle test report when unit tests fail ci(backend): upload gradle test report when unit tests fail Apr 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +18 to +21
@Test
fun `THIS TEST INTENTIONALLY FAILS to verify test report upload works`() {
assertThat("expected", org.hamcrest.Matchers.equalTo("actual"))
}
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +35
- name: Upload test report
uses: actions/upload-artifact@v4
if: always()
with:
name: backend-test-report
path: backend/build/reports/tests/test/
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI, backend tests: allow downloading test report

2 participants