diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 734635e..395f55b 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -24,4 +24,16 @@ jobs: run: make install - name: Run tests - run: make test \ No newline at end of file + run: make test + + - name: Preprocess tests + run: make preprocess-test-results + + - name: Test Report + uses: dorny/test-reporter@v2 + if: always() + with: + name: Tests + path: '**/*-report.xml' + reporter: java-junit + \ No newline at end of file diff --git a/.gitignore b/.gitignore index c3711ee..0236856 100644 --- a/.gitignore +++ b/.gitignore @@ -177,4 +177,5 @@ palindrome/output.xml palindrome/report.html # misc -.installed \ No newline at end of file +.installed +*-report.xml diff --git a/Makefile b/Makefile index fb81cbd..79ebea4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all palindrome +.PHONY: all palindrome install test preprocess-test-results all: palindrome @@ -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 diff --git a/palindrome/Makefile b/palindrome/Makefile index 98cc9fe..da2b555 100644 --- a/palindrome/Makefile +++ b/palindrome/Makefile @@ -1,14 +1,18 @@ -.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 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 diff --git a/palindrome/tasks.py b/palindrome/tasks.py index 3f49554..3cb3784 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 robot-report.xml tests/robot/") @task def test_pytest(c): - c.run("pytest") + c.run("pytest --junitxml=pytest-report.xml") @task(pre=[test_pytest, test_robot]) def test_all(c):