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

feat: add Allure reports to GH pages #2393

Open
wants to merge 25 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ff2db30
feat: add central server allure reports
raits Oct 22, 2024
ed200f6
feat: add allure report publishing to Security Server and E2E
raits Oct 22, 2024
b71ed47
Merge branch 'develop' into improve-actions-allure
raits Nov 4, 2024
5d4ca98
chore: address review comments
raits Nov 4, 2024
83123fe
chore: add back missing `uses` for new script job
raits Nov 4, 2024
7057953
chore: correct `uses` location
raits Nov 4, 2024
f07b732
chore: fix markup
raits Nov 4, 2024
118ed98
chore: skip sonar task if SONAR_TOKEN is missing
raits Nov 4, 2024
88594ba
feat: add artifact links to allure reports table
raits Nov 4, 2024
20a5c62
chore: test artifact URL output
raits Nov 5, 2024
019e330
chore: always upload CS artifacts
raits Nov 5, 2024
f1cd06c
chore: remove # from infront of run
raits Nov 5, 2024
e48cd6f
chore: try SS artifacts
raits Nov 6, 2024
2ab5ff4
chore: fix file rights
raits Nov 6, 2024
db5cf2c
chore: test conditional in body
raits Nov 6, 2024
6e337d1
chore: search for `needs` inside the context
raits Nov 7, 2024
1b99be7
chore: log out context
raits Nov 7, 2024
6fee9c6
chore: try to extract needs into const
raits Nov 7, 2024
8559476
chore: possibly incorrect syntax for newer files
raits Nov 7, 2024
dd6546d
Merge branch 'develop' into improve-actions-allure
raits Nov 7, 2024
3ae504f
Merge branch 'develop' into improve-actions-allure
raits Nov 8, 2024
b8dc8a9
chore: fix typo
raits Nov 8, 2024
94dcc3c
feat: add artifacts url check to SS and E2E tests
raits Nov 8, 2024
cd18eed
chore: fix output names for SS and E2E tests
raits Nov 11, 2024
fe9bdf2
feat: add container logs to CS artifacts
raits Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 119 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ jobs:
name: Run Central Server system tests
needs: BuildAndPackageWithUnitTests
runs-on: ubuntu-22.04
outputs:
cs-artifacts-url: ${{ steps.cs-artifacts-step.outputs.artifact-url }}
services:
registry:
image: registry:2
Expand Down Expand Up @@ -149,15 +151,48 @@ jobs:
name: Central Server system test
path: src/central-server/admin-service/ui-system-test/build/test-results/**/TEST-*.xml
reporter: java-junit
- name: Upload CS screenshots
if: failure()
- name: Fix ui-system-test build dir permissions
run: sudo chown -R $USER src/central-server/admin-service/ui-system-test/build/cs-container-logs/ && sudo chown -R $USER src/central-server/admin-service/ui-system-test/build/ca-container-logs/
if: always()
- name: Upload CS report
id: cs-artifacts-step
uses: actions/upload-artifact@v4
if: always()
with:
name: CS System Test report
path: |
src/central-server/admin-service/ui-system-test/cs-container-logs/
src/central-server/admin-service/ui-system-test/ca-container-logs/
src/central-server/admin-service/ui-system-test/reports/test-automation/selenide-failures/*.png
- name: Load test report history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: allure-gh-pages
path: allure-reports

- name: Build test report
uses: simple-elf/allure-report-action@v1.9
if: always()
with:
name: CS System Test screenshots
path: src/central-server/admin-service/ui-system-test/build/reports/test-automation/selenide-failures/*.png
gh_pages: allure-reports
subfolder: central-server/ui-system-test
allure_history: allure-history
allure_results: src/central-server/admin-service/ui-system-test/build/allure-results

- name: Publish test report
uses: peaceiris/actions-gh-pages@v4
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: allure-gh-pages
publish_dir: allure-history
RunSSSystemTests:
name: Run Security Server system tests
needs: BuildAndPackageWithUnitTests
outputs:
ss-artifacts-url: ${{ steps.ss-artifacts-step.outputs.artifact-url }}
runs-on: ubuntu-22.04
services:
registry:
Expand Down Expand Up @@ -209,21 +244,50 @@ jobs:
reporter: java-junit
- name: Fix system-test build dir permissions
run: sudo chown -R $USER src/security-server/system-test/build/ss-container-logs/ && sudo chown -R $USER src/security-server/system-test/build/ca-container-logs/
if: failure()
if: always()
- name: Upload SS report
id: ss-artifacts-step
uses: actions/upload-artifact@v4
if: failure()
if: always()
with:
name: SS System Test report
path: |
src/security-server/system-test/build/allure-report/
src/security-server/system-test/build/ss-container-logs/
src/security-server/system-test/build/ca-container-logs/
src/security-server/system-test/build/reports/test-automation/selenide-failures/*.png
- name: SS report artifact URL
run: echo 'Artifact URL is ${{ steps.ss-artifacts-step.outputs.artifact-url }}'
- name: Load test report history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: allure-gh-pages
path: allure-reports

- name: Build test report
uses: simple-elf/allure-report-action@v1.9
if: always()
with:
gh_pages: allure-reports
subfolder: security-server/system-test
allure_history: allure-history
allure_results: src/security-server/system-test/build/allure-results

- name: Publish test report
uses: peaceiris/actions-gh-pages@v4
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: allure-gh-pages
publish_dir: allure-history
RunE2ETests:
name: Run E2E tests
needs: BuildAndPackageWithUnitTests
runs-on: ubuntu-22.04
outputs:
e2e-artifacts-url: ${{ steps.e2e-artifacts-step.outputs.artifact-url }}
services:
registry:
image: registry:2
Expand Down Expand Up @@ -293,9 +357,58 @@ jobs:
path: src/security-server/e2e-test/build/test-results/**/TEST-*.xml
reporter: java-junit
- name: Upload E2E report
id: e2e-artifacts-step
uses: actions/upload-artifact@v4
if: failure()
with:
name: E2E report
path: |
src/security-server/e2e-test/build/allure-report/
- name: Load test report history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: allure-gh-pages
path: allure-reports

- name: Build test report
uses: simple-elf/allure-report-action@v1.9
if: always()
with:
gh_pages: allure-reports
subfolder: e2e
allure_history: allure-history
allure_results: src/security-server/e2e-test/build/allure-results
- name: Publish test report
uses: peaceiris/actions-gh-pages@v4
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: allure-gh-pages
publish_dir: allure-history
CreateAllureLinks:
name: Create Allure links
needs: [RunCSSystemTests, RunSSSystemTests, RunE2ETests]
runs-on: ubuntu-22.04
steps:
- name: Generate links table
uses: actions/github-script@v7
with:
script: |
const csArtifactsUrl = `${{ needs.RunCSSystemTests.outputs.cs-artifacts-url }}`;
const ssArtifactsUrl = `${{ needs.RunSSSystemTests.outputs.ss-artifacts-url }}`;
const e2eArtifactsUrl = `${{ needs.RunE2ETests.outputs.e2e-artifacts-url }}`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## Allure reports for run ${{ github.run_number }}

| Test suite | Report URL | Artifacts |
|-----------------|------------|-----------|
| Central Server | <a href="https://nordic-institute.github.io/X-Road/central-server/ui-system-test/${{ github.run_number }}" target="_blank">Report</a> | ${csArtifactsUrl !== '' ? '<a href="${{ needs.RunCSSystemTests.outputs.cs-artifacts-url }}" target="_blank">Artifacts</a>' : 'N/A'} |
| Security Server | <a href="https://nordic-institute.github.io/X-Road/security-server/system-test/${{ github.run_number }}" target="_blank">Report</a> | ${ssArtifactsUrl !== '' ? '<a href="${{ needs.RunSSSystemTests.outputs.ss-artifacts-url }}" target="_blank">Artifacts</a>' : 'N/A'} |
| E2E | <a href="https://nordic-institute.github.io/X-Road/e2e/${{ github.run_number }}" target="_blank">Report</a> | ${e2eArtifactsUrl !== '' ? '<a href="${{ needs.RunE2ETests.outputs.e2e-artifacts-url }}" target="_blank">Artifacts</a>' : 'N/A'} |
`
})
1 change: 1 addition & 0 deletions src/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,4 @@ tasks.register("installGitHooks", Copy) {
}
assemble.dependsOn installGitHooks
tasks.sonar.dependsOn testCodeCoverageReport
tasks.sonar.onlyIf { System.env['SONAR_TOKEN'] != null }
Loading