From 22e2c879ff9eae7b07b7956de0297c747cda6367 Mon Sep 17 00:00:00 2001 From: thendarion <16006640+thendarion@users.noreply.github.com> Date: Wed, 14 May 2025 20:46:00 +0200 Subject: [PATCH 01/13] upload test results in github actions Signed-off-by: thendarion <16006640+thendarion@users.noreply.github.com> --- .github/workflows/pipeline.yml | 8 +++++++- .gitignore | 3 ++- palindrome/tasks.py | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 734635e..b1cb052 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -24,4 +24,10 @@ jobs: run: make install - name: Run tests - run: make test \ No newline at end of file + run: make test + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() + with: + files: '**/junit-*.xml' diff --git a/.gitignore b/.gitignore index c3711ee..67b9f5b 100644 --- a/.gitignore +++ b/.gitignore @@ -177,4 +177,5 @@ palindrome/output.xml palindrome/report.html # misc -.installed \ No newline at end of file +.installed +junit-*.xml diff --git a/palindrome/tasks.py b/palindrome/tasks.py index 3f49554..0aa1b37 100644 --- a/palindrome/tasks.py +++ b/palindrome/tasks.py @@ -3,11 +3,11 @@ @task def test_robot(c): - c.run("robot tests/robot/") + c.run("robot --xunit junit-robot.xml tests/robot/") @task def test_pytest(c): - c.run("pytest") + c.run("pytest --junitxml=junit-pytest.xml") @task(pre=[test_pytest, test_robot]) def test_all(c): From f8a41aee6b7fc7d4a70d4550142c4c131daf34c6 Mon Sep 17 00:00:00 2001 From: thendarion <16006640+thendarion@users.noreply.github.com> Date: Thu, 15 May 2025 06:58:14 +0200 Subject: [PATCH 02/13] try a separate upload approach Signed-off-by: thendarion <16006640+thendarion@users.noreply.github.com> --- .github/workflows/pipeline.yml | 21 ++++++++++---- .github/workflows/test-results.yml | 44 ++++++++++++++++++++++++++++++ .gitignore | 2 +- palindrome/tasks.py | 4 +-- 4 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/test-results.yml diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index b1cb052..4d10f4d 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -8,11 +8,20 @@ on: pull_request: branches: [ main ] -jobs: - build: +jobs: + event_file: + name: "Event File" runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: Event File + path: ${{ github.event_path }} + build: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python @@ -26,8 +35,10 @@ jobs: - name: Run tests run: make test - - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action@v2 + - name: Upload Test Results if: always() + uses: actions/upload-artifact@v4 with: - files: '**/junit-*.xml' + name: Test Results + path: '*/*-result.xml' + diff --git a/.github/workflows/test-results.yml b/.github/workflows/test-results.yml new file mode 100644 index 0000000..641c722 --- /dev/null +++ b/.github/workflows/test-results.yml @@ -0,0 +1,44 @@ +name: Test Results + +on: + workflow_run: + workflows: [pipeline"] + types: + - completed +permissions: {} + +jobs: + test-results: + name: Test Results + runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion != 'skipped' + + permissions: + checks: write + + # needed unless run with comment_mode: off + pull-requests: write + + # only needed for private repository + contents: read + + # only needed for private repository + issues: read + + # required by download step to access artifacts API + actions: read + + steps: + - name: Download and Extract Artifacts + uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d + with: + run_id: ${{ github.event.workflow_run.id }} + path: artifacts + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + commit: ${{ github.event.workflow_run.head_sha }} + event_file: artifacts/Event File/event.json + event_name: ${{ github.event.workflow_run.event }} + files: "artifacts/**/*.xml" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 67b9f5b..6530473 100644 --- a/.gitignore +++ b/.gitignore @@ -178,4 +178,4 @@ palindrome/report.html # misc .installed -junit-*.xml +*-result.xml diff --git a/palindrome/tasks.py b/palindrome/tasks.py index 0aa1b37..08f7b51 100644 --- a/palindrome/tasks.py +++ b/palindrome/tasks.py @@ -3,11 +3,11 @@ @task def test_robot(c): - c.run("robot --xunit junit-robot.xml tests/robot/") + c.run("robot --xunit robot-result.xml tests/robot/") @task def test_pytest(c): - c.run("pytest --junitxml=junit-pytest.xml") + c.run("pytest --junitxml=pytest-result.xml") @task(pre=[test_pytest, test_robot]) def test_all(c): From 51229fcad04c6e7d7a0f3b5e1754f134e6f07fb1 Mon Sep 17 00:00:00 2001 From: thendarion <16006640+thendarion@users.noreply.github.com> Date: Thu, 15 May 2025 07:03:18 +0200 Subject: [PATCH 03/13] try a separate upload approach within the same file Signed-off-by: thendarion <16006640+thendarion@users.noreply.github.com> --- .github/workflows/pipeline.yml | 15 ++++++++++ .github/workflows/test-results.yml | 44 ------------------------------ 2 files changed, 15 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/test-results.yml diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 4d10f4d..2160cbd 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -42,3 +42,18 @@ jobs: name: Test Results path: '*/*-result.xml' + test-results: + name: Test Results + runs-on: ubuntu-latest + if: always() + + steps: + - name: Download and Extract Artifacts + uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d + with: + path: artifacts + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + files: "artifacts/**/*.xml" diff --git a/.github/workflows/test-results.yml b/.github/workflows/test-results.yml deleted file mode 100644 index 641c722..0000000 --- a/.github/workflows/test-results.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Test Results - -on: - workflow_run: - workflows: [pipeline"] - types: - - completed -permissions: {} - -jobs: - test-results: - name: Test Results - runs-on: ubuntu-latest - if: github.event.workflow_run.conclusion != 'skipped' - - permissions: - checks: write - - # needed unless run with comment_mode: off - pull-requests: write - - # only needed for private repository - contents: read - - # only needed for private repository - issues: read - - # required by download step to access artifacts API - actions: read - - steps: - - name: Download and Extract Artifacts - uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d - with: - run_id: ${{ github.event.workflow_run.id }} - path: artifacts - - - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action@v2 - with: - commit: ${{ github.event.workflow_run.head_sha }} - event_file: artifacts/Event File/event.json - event_name: ${{ github.event.workflow_run.event }} - files: "artifacts/**/*.xml" \ No newline at end of file From a90ee97d1d4a7feea3dbf70f20ec002f5be0944e Mon Sep 17 00:00:00 2001 From: thendarion <16006640+thendarion@users.noreply.github.com> Date: Thu, 15 May 2025 07:08:19 +0200 Subject: [PATCH 04/13] focus on robot for now Signed-off-by: thendarion <16006640+thendarion@users.noreply.github.com> --- .github/workflows/pipeline.yml | 39 ++++++++++++---------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 2160cbd..c9cbb49 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -10,16 +10,6 @@ on: jobs: - event_file: - name: "Event File" - runs-on: ubuntu-latest - steps: - - name: Upload - uses: actions/upload-artifact@v4 - with: - name: Event File - path: ${{ github.event_path }} - build: runs-on: ubuntu-latest steps: @@ -35,25 +25,22 @@ jobs: - name: Run tests run: make test - - name: Upload Test Results + - name: Upload Robot Results if: always() uses: actions/upload-artifact@v4 with: - name: Test Results - path: '*/*-result.xml' + name: Robot Results + path: '*/robot-result.xml' - test-results: - name: Test Results + generate_report: runs-on: ubuntu-latest - if: always() - steps: - - name: Download and Extract Artifacts - uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d - with: - path: artifacts - - - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action@v2 - with: - files: "artifacts/**/*.xml" + - uses: actions/checkout@v2 + - name: Download Test Results + uses: actions/download-artifact@v1 + with: + name: Robot Results + - name: Send Robot Results to Commit + uses: joonvena/robotframework-reporter-action@v2.5 + with: + gh_access_token: ${{ secrets.GITHUB_TOKEN }} From fb8f9a16a1fb9cd96192f81bc4e303a2662876a2 Mon Sep 17 00:00:00 2001 From: thendarion <16006640+thendarion@users.noreply.github.com> Date: Thu, 15 May 2025 07:31:15 +0200 Subject: [PATCH 05/13] back to dorny now Signed-off-by: thendarion <16006640+thendarion@users.noreply.github.com> --- .github/workflows/pipeline.yml | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index c9cbb49..351e38b 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -8,10 +8,11 @@ on: pull_request: branches: [ main ] - jobs: build: + runs-on: ubuntu-latest + steps: - uses: actions/checkout@v4 - name: Set up Python @@ -25,22 +26,17 @@ jobs: - name: Run tests run: make test - - name: Upload Robot Results + - name: Pytest Report + uses: dorny/test-reporter@v2 if: always() - uses: actions/upload-artifact@v4 - with: - name: Robot Results - path: '*/robot-result.xml' - - generate_report: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Download Test Results - uses: actions/download-artifact@v1 with: - name: Robot Results - - name: Send Robot Results to Commit - uses: joonvena/robotframework-reporter-action@v2.5 + name: Pytest Tests + path: '*/pytest-report.xml' + reporter: jest-junit + - name: Robot Report + uses: dorny/test-reporter@v2 + if: always() with: - gh_access_token: ${{ secrets.GITHUB_TOKEN }} + name: Robot Tests + path: '*/robot-report.xml' + reporter: swift-xunit From 21cd4f8f81b8b16cb6b669c6d044459072ba91e2 Mon Sep 17 00:00:00 2001 From: thendarion <16006640+thendarion@users.noreply.github.com> Date: Thu, 15 May 2025 07:34:33 +0200 Subject: [PATCH 06/13] give reports a more natural file name Signed-off-by: thendarion <16006640+thendarion@users.noreply.github.com> --- .github/workflows/pipeline.yml | 4 ++-- .gitignore | 2 +- palindrome/tasks.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 351e38b..acba532 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -31,12 +31,12 @@ jobs: if: always() with: name: Pytest Tests - path: '*/pytest-report.xml' + path: '**/pytest-report.xml' reporter: jest-junit - name: Robot Report uses: dorny/test-reporter@v2 if: always() with: name: Robot Tests - path: '*/robot-report.xml' + path: '**/robot-report.xml' reporter: swift-xunit diff --git a/.gitignore b/.gitignore index 6530473..0236856 100644 --- a/.gitignore +++ b/.gitignore @@ -178,4 +178,4 @@ palindrome/report.html # misc .installed -*-result.xml +*-report.xml diff --git a/palindrome/tasks.py b/palindrome/tasks.py index 08f7b51..3cb3784 100644 --- a/palindrome/tasks.py +++ b/palindrome/tasks.py @@ -3,11 +3,11 @@ @task def test_robot(c): - c.run("robot --xunit robot-result.xml tests/robot/") + c.run("robot --xunit robot-report.xml tests/robot/") @task def test_pytest(c): - c.run("pytest --junitxml=pytest-result.xml") + c.run("pytest --junitxml=pytest-report.xml") @task(pre=[test_pytest, test_robot]) def test_all(c): From f3201fb72fee89f85c1d46721094dfd17b9066a7 Mon Sep 17 00:00:00 2001 From: thendarion <16006640+thendarion@users.noreply.github.com> Date: Thu, 15 May 2025 07:49:40 +0200 Subject: [PATCH 07/13] use one upload only Signed-off-by: thendarion <16006640+thendarion@users.noreply.github.com> --- .github/workflows/pipeline.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index acba532..10b8402 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -26,17 +26,11 @@ jobs: - name: Run tests run: make test - - name: Pytest Report + - name: Test Report uses: dorny/test-reporter@v2 if: always() with: - name: Pytest Tests - path: '**/pytest-report.xml' - reporter: jest-junit - - name: Robot Report - uses: dorny/test-reporter@v2 - if: always() - with: - name: Robot Tests - path: '**/robot-report.xml' - reporter: swift-xunit + name: Tests + path: '**/*-report.xml' + reporter: java-junit + \ No newline at end of file From 37529f3ce895055a80faf7e302715b7ad74e1027 Mon Sep 17 00:00:00 2001 From: thendarion <16006640+thendarion@users.noreply.github.com> Date: Thu, 15 May 2025 08:53:13 +0200 Subject: [PATCH 08/13] preprocess robot test results Signed-off-by: thendarion <16006640+thendarion@users.noreply.github.com> --- .github/workflows/pipeline.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 10b8402..3f82fbd 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -26,6 +26,9 @@ jobs: - name: Run tests run: make test + - name: Prepprocess tests + run: sed '0,/testsuite/s//testsuites/' robot-report.xml | tac | sed '0,/testsuite/s//testsuites/' | tac > output.xml && mv output.xml robot-report.xml + - name: Test Report uses: dorny/test-reporter@v2 if: always() From f4c229adc327ae28f3e24a90e13c9647ad893015 Mon Sep 17 00:00:00 2001 From: thendarion <16006640+thendarion@users.noreply.github.com> Date: Thu, 15 May 2025 08:58:19 +0200 Subject: [PATCH 09/13] remove attributes from testsuites just in case Signed-off-by: thendarion <16006640+thendarion@users.noreply.github.com> --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 3f82fbd..5ade0ed 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -27,7 +27,7 @@ jobs: run: make test - name: Prepprocess tests - run: sed '0,/testsuite/s//testsuites/' robot-report.xml | tac | sed '0,/testsuite/s//testsuites/' | tac > output.xml && mv output.xml robot-report.xml + run: sed '0,/testsuite.*/s//testsuites>/' robot-report.xml | tac | sed '0,/testsuite/s//testsuites/' | tac > output.xml && mv output.xml robot-report.xml - name: Test Report uses: dorny/test-reporter@v2 From 2422f26566ef3f59efcbd46e526a9874cb20313b Mon Sep 17 00:00:00 2001 From: thendarion <16006640+thendarion@users.noreply.github.com> Date: Thu, 15 May 2025 09:04:09 +0200 Subject: [PATCH 10/13] remove testsuites and keep testsuite only Signed-off-by: thendarion <16006640+thendarion@users.noreply.github.com> --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 5ade0ed..e4593e3 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -27,7 +27,7 @@ jobs: run: make test - name: Prepprocess tests - run: sed '0,/testsuite.*/s//testsuites>/' robot-report.xml | tac | sed '0,/testsuite/s//testsuites/' | tac > output.xml && mv output.xml robot-report.xml + run: sed '0,/.*testsuite.*/s///' robot-report.xml | tac | sed '0,/.*testsuite.*/s///' | tac > temp.xml && mv temp.xml robot-report.xml && cat robot-report.xml - name: Test Report uses: dorny/test-reporter@v2 From 0af227b240445356eb3d53b05d3b41443969a36e Mon Sep 17 00:00:00 2001 From: thendarion <16006640+thendarion@users.noreply.github.com> Date: Thu, 15 May 2025 09:07:23 +0200 Subject: [PATCH 11/13] fix submodule directory Signed-off-by: thendarion <16006640+thendarion@users.noreply.github.com> --- .github/workflows/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index e4593e3..d883807 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -26,8 +26,8 @@ jobs: - name: Run tests run: make test - - name: Prepprocess tests - run: sed '0,/.*testsuite.*/s///' robot-report.xml | tac | sed '0,/.*testsuite.*/s///' | tac > temp.xml && mv temp.xml robot-report.xml && cat robot-report.xml + - name: Preprocess tests + run: cd palindrome && sed '0,/testsuite/s//testsuites/' robot-report.xml | tac | sed '0,/testsuite/s//testsuites/' | tac > output.xml && mv output.xml robot-report.xml - name: Test Report uses: dorny/test-reporter@v2 From 41f69cd153eec573a9a54851bc01daab4e3b92a9 Mon Sep 17 00:00:00 2001 From: thendarion <16006640+thendarion@users.noreply.github.com> Date: Thu, 15 May 2025 09:26:24 +0200 Subject: [PATCH 12/13] Makefile clean-up Signed-off-by: thendarion <16006640+thendarion@users.noreply.github.com> --- .github/workflows/pipeline.yml | 2 +- Makefile | 5 ++++- palindrome/Makefile | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index d883807..395f55b 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -27,7 +27,7 @@ jobs: run: make test - name: Preprocess tests - run: cd palindrome && sed '0,/testsuite/s//testsuites/' robot-report.xml | tac | sed '0,/testsuite/s//testsuites/' | tac > output.xml && mv output.xml robot-report.xml + run: make preprocess-test-results - name: Test Report uses: dorny/test-reporter@v2 diff --git a/Makefile b/Makefile index fb81cbd..4b4711a 100644 --- a/Makefile +++ b/Makefile @@ -9,4 +9,7 @@ install: $(MAKE) -C palindrome install test: - $(MAKE) -C palindrome test \ No newline at end of file + $(MAKE) -C palindrome test + +preprocess-test-results: + $(MAKE) -C palindrome preprocess-test-results \ No newline at end of file diff --git a/palindrome/Makefile b/palindrome/Makefile index 98cc9fe..28884c8 100644 --- a/palindrome/Makefile +++ b/palindrome/Makefile @@ -12,3 +12,8 @@ install: .installed test: poetry run invoke test-all + +preprocess-test-results: + sed '0,/testsuite/s//testsuites/' robot-report.xml | tac \ + | sed '0,/testsuite/s//testsuites/' | tac > output.xml \ + && mv output.xml robot-report.xml \ No newline at end of file From a46567e6fc2cd19cbee88385fd6e607aa64d4a69 Mon Sep 17 00:00:00 2001 From: thendarion <16006640+thendarion@users.noreply.github.com> Date: Thu, 15 May 2025 09:38:24 +0200 Subject: [PATCH 13/13] fix Makefile separator Signed-off-by: thendarion <16006640+thendarion@users.noreply.github.com> --- Makefile | 4 ++-- palindrome/Makefile | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 4b4711a..79ebea4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all palindrome +.PHONY: all palindrome install test preprocess-test-results all: palindrome @@ -12,4 +12,4 @@ test: $(MAKE) -C palindrome test preprocess-test-results: - $(MAKE) -C palindrome preprocess-test-results \ No newline at end of file + $(MAKE) -C palindrome preprocess-test-results diff --git a/palindrome/Makefile b/palindrome/Makefile index 28884c8..da2b555 100644 --- a/palindrome/Makefile +++ b/palindrome/Makefile @@ -1,11 +1,11 @@ -.PHONY: all install test +.PHONY: build install test preprocess-test-results -all: install test +build: install test .installed: - python -m pip install --upgrade pip && \ - pip install poetry && \ - poetry install && \ + python -m pip install --upgrade pip + pip install poetry + poetry install touch .installed install: .installed @@ -14,6 +14,5 @@ test: poetry run invoke test-all preprocess-test-results: - sed '0,/testsuite/s//testsuites/' robot-report.xml | tac \ - | sed '0,/testsuite/s//testsuites/' | tac > output.xml \ - && mv output.xml robot-report.xml \ No newline at end of file + sed '0,/testsuite/s//testsuites/' robot-report.xml | tac | sed '0,/testsuite/s//testsuites/' | tac > output.xml + mv output.xml robot-report.xml