From d83d091df386dcf6836e352a1bfa5c110980016e Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Fri, 22 Nov 2024 07:29:31 +0000 Subject: [PATCH 1/4] :construction_worker: add codecov result action --- .github/workflows/codecov.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index f28863d7b491..b9538b7341de 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -48,11 +48,20 @@ jobs: cd ./envs/${{ matrix.env }} poetry run bash "../../scripts/run-tests.sh" + - name: Upload test results + uses: codecov/test-results-action@v1 + with: + env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION + flags: unittests + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Upload coverage report uses: codecov/codecov-action@v5 with: env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION files: ./tests/coverage.xml flags: unittests + fail_ci_if_error: true env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 75b1a0ef615a79e048cd7a8b364f07bc22427d65 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:14:34 +0800 Subject: [PATCH 2/4] :bug: add junit output --- scripts/run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index 002723027323..9bc715961fea 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -4,4 +4,4 @@ cd "$(dirname "$0")/../tests" # Run the tests -pytest -n auto --cov-append --cov-report xml $@ +pytest -n auto --cov-append --cov-report xml --junitxml=./junit.xml -n auto $@ From 1e1e39bbe9e492c6451e7463f59c97cde4765b20 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:15:51 +0800 Subject: [PATCH 3/4] :bug: specify junit file path --- .github/workflows/codecov.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index b9538b7341de..c3990c398ac2 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -52,6 +52,7 @@ jobs: uses: codecov/test-results-action@v1 with: env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION + files: ./tests/junit.xml flags: unittests env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 52e0d166c4cec11519d25674fbe254ed6d093716 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:17:53 +0800 Subject: [PATCH 4/4] :pencil2: fix typo --- scripts/run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index 9bc715961fea..2284bdd67e59 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -4,4 +4,4 @@ cd "$(dirname "$0")/../tests" # Run the tests -pytest -n auto --cov-append --cov-report xml --junitxml=./junit.xml -n auto $@ +pytest -n auto --cov-append --cov-report xml --junitxml=./junit.xml $@