From b0186f4e098d47219319d4c1df60dfb46b0a48e9 Mon Sep 17 00:00:00 2001 From: Gavin Jaeger-Freeborn Date: Mon, 20 Nov 2023 12:52:50 -0800 Subject: [PATCH 1/9] Added proliminary iteration of generating test coverage reports Signed-off-by: Gavin Jaeger-Freeborn --- .github/workflows/controller_unittests.yml | 12 ++++++++---- README.md | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/controller_unittests.yml b/.github/workflows/controller_unittests.yml index d4197ac7..d4671fa6 100644 --- a/.github/workflows/controller_unittests.yml +++ b/.github/workflows/controller_unittests.yml @@ -3,11 +3,10 @@ name: Controller Unit Tests on: push: branches: - - '2.0-development' + - "main" pull_request: branches: - - '2.0-development' - + - "main" jobs: build: @@ -39,4 +38,9 @@ jobs: - name: Test with pytest working-directory: ./oidc-controller run: | - pytest --log-cli-level=INFO + pytest --log-cli-level=INFO --cov --cov-report lcov + - name: Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + file: coverage.lcov diff --git a/README.md b/README.md index 4cbe254b..6346dce8 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) [![unit-tests](https://github.com/bcgov/vc-authn-oidc/actions/workflows/controller_unittests.yml/badge.svg?branch=2.0-development&event=push)](https://github.com/bcgov/vc-authn-oidc/actions/workflows/controller_unittests.yml) +[![Coverage Status](https://coveralls.io/repos/github/bcgov/vc-authn-oidc/badge.svg?branch=main)](https://coveralls.io/repos/github/bcgov/vc-authn-oidc/badge.svg?branch=main) # Verifiable Credential Authentication with OpenID Connect (VC-AuthN OIDC) @@ -149,4 +150,4 @@ This is a sample debugger launch configuration for VSCode that can be used by ad } ] } -``` \ No newline at end of file +``` From 50d0a137861553767f1a2d7c992f99a08c972350 Mon Sep 17 00:00:00 2001 From: Gavin Jaeger-Freeborn Date: Mon, 20 Nov 2023 12:54:23 -0800 Subject: [PATCH 2/9] Added README badge for coverage reports Signed-off-by: Gavin Jaeger-Freeborn --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6346dce8..ea06ac94 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) [![unit-tests](https://github.com/bcgov/vc-authn-oidc/actions/workflows/controller_unittests.yml/badge.svg?branch=2.0-development&event=push)](https://github.com/bcgov/vc-authn-oidc/actions/workflows/controller_unittests.yml) -[![Coverage Status](https://coveralls.io/repos/github/bcgov/vc-authn-oidc/badge.svg?branch=main)](https://coveralls.io/repos/github/bcgov/vc-authn-oidc/badge.svg?branch=main) +[![Coverage Status](https://coveralls.io/repos/github/Gavinok/vc-authn-oidc/badge.svg?branch=main)](https://coveralls.io/repos/github/Gavinok/vc-authn-oidc/badge.svg?branch=main) # Verifiable Credential Authentication with OpenID Connect (VC-AuthN OIDC) From 6a20b7b10eac11ac18c7230eb66f4e0f1f4ad605 Mon Sep 17 00:00:00 2001 From: Gavin Jaeger-Freeborn Date: Mon, 20 Nov 2023 13:04:29 -0800 Subject: [PATCH 3/9] Carry over the test results when preforming code coverage Signed-off-by: Gavin Jaeger-Freeborn --- .github/workflows/controller_unittests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/controller_unittests.yml b/.github/workflows/controller_unittests.yml index d4671fa6..1430ca5b 100644 --- a/.github/workflows/controller_unittests.yml +++ b/.github/workflows/controller_unittests.yml @@ -37,10 +37,13 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest working-directory: ./oidc-controller + flag-name: tests-${{ matrix.python-version }} run: | pytest --log-cli-level=INFO --cov --cov-report lcov - name: Coveralls uses: coverallsapp/github-action@v2 with: + parallel-finished: true + carryforward: "tests-3.11" github-token: ${{ secrets.GITHUB_TOKEN }} file: coverage.lcov From 0b0097ee85b330f84b1a51e1470ab5346ea02aea Mon Sep 17 00:00:00 2001 From: Gavin Jaeger-Freeborn Date: Mon, 20 Nov 2023 13:11:11 -0800 Subject: [PATCH 4/9] Attempt to handle parellel builds Signed-off-by: Gavin Jaeger-Freeborn --- .github/workflows/controller_unittests.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/controller_unittests.yml b/.github/workflows/controller_unittests.yml index 1430ca5b..7df80aeb 100644 --- a/.github/workflows/controller_unittests.yml +++ b/.github/workflows/controller_unittests.yml @@ -40,10 +40,18 @@ jobs: flag-name: tests-${{ matrix.python-version }} run: | pytest --log-cli-level=INFO --cov --cov-report lcov - - name: Coveralls + - name: Coveralls Parallel + uses: coverallsapp/github-action@v2 + with: + flag-name: run-${{ matrix.python-version }} + parallel: true + finish: + needs: test + if: ${{ always() }} + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished uses: coverallsapp/github-action@v2 with: parallel-finished: true - carryforward: "tests-3.11" - github-token: ${{ secrets.GITHUB_TOKEN }} - file: coverage.lcov + carryforward: "run-3.11" From a46395cb34f1e735cd7b33e23057ead7fcf3e2c8 Mon Sep 17 00:00:00 2001 From: Gavin Jaeger-Freeborn Date: Mon, 20 Nov 2023 13:12:35 -0800 Subject: [PATCH 5/9] removed flag-name Signed-off-by: Gavin Jaeger-Freeborn --- .github/workflows/controller_unittests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/controller_unittests.yml b/.github/workflows/controller_unittests.yml index 7df80aeb..2985388c 100644 --- a/.github/workflows/controller_unittests.yml +++ b/.github/workflows/controller_unittests.yml @@ -15,7 +15,6 @@ jobs: strategy: matrix: python-version: ["3.11"] - steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -37,7 +36,6 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest working-directory: ./oidc-controller - flag-name: tests-${{ matrix.python-version }} run: | pytest --log-cli-level=INFO --cov --cov-report lcov - name: Coveralls Parallel From aa99da6bc0186ab9f780b644fbdcec50d55b0969 Mon Sep 17 00:00:00 2001 From: Gavin Jaeger-Freeborn Date: Mon, 20 Nov 2023 13:13:24 -0800 Subject: [PATCH 6/9] Corrected test->build in codecoverage action Signed-off-by: Gavin Jaeger-Freeborn --- .github/workflows/controller_unittests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/controller_unittests.yml b/.github/workflows/controller_unittests.yml index 2985388c..9add9b50 100644 --- a/.github/workflows/controller_unittests.yml +++ b/.github/workflows/controller_unittests.yml @@ -44,7 +44,7 @@ jobs: flag-name: run-${{ matrix.python-version }} parallel: true finish: - needs: test + needs: build if: ${{ always() }} runs-on: ubuntu-latest steps: From a5f567ef43f644a390d1d2c8e6da56a8342f4aef Mon Sep 17 00:00:00 2001 From: Gavin Jaeger-Freeborn Date: Mon, 20 Nov 2023 13:20:04 -0800 Subject: [PATCH 7/9] Reverted code coverage badge to use the bcgov repos Signed-off-by: Gavin Jaeger-Freeborn --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea06ac94..6346dce8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) [![unit-tests](https://github.com/bcgov/vc-authn-oidc/actions/workflows/controller_unittests.yml/badge.svg?branch=2.0-development&event=push)](https://github.com/bcgov/vc-authn-oidc/actions/workflows/controller_unittests.yml) -[![Coverage Status](https://coveralls.io/repos/github/Gavinok/vc-authn-oidc/badge.svg?branch=main)](https://coveralls.io/repos/github/Gavinok/vc-authn-oidc/badge.svg?branch=main) +[![Coverage Status](https://coveralls.io/repos/github/bcgov/vc-authn-oidc/badge.svg?branch=main)](https://coveralls.io/repos/github/bcgov/vc-authn-oidc/badge.svg?branch=main) # Verifiable Credential Authentication with OpenID Connect (VC-AuthN OIDC) From ba1b51e0b77505154fba33c72cad81abf839efe5 Mon Sep 17 00:00:00 2001 From: Gavin Jaeger-Freeborn Date: Mon, 20 Nov 2023 13:25:59 -0800 Subject: [PATCH 8/9] Renamed the finish job to a more descriptive Generate Code Coverage Signed-off-by: Gavin Jaeger-Freeborn --- .github/workflows/controller_unittests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/controller_unittests.yml b/.github/workflows/controller_unittests.yml index 9add9b50..5a3f8a71 100644 --- a/.github/workflows/controller_unittests.yml +++ b/.github/workflows/controller_unittests.yml @@ -43,7 +43,8 @@ jobs: with: flag-name: run-${{ matrix.python-version }} parallel: true - finish: + code-coverage: + name: Generate Code Coverage needs: build if: ${{ always() }} runs-on: ubuntu-latest From 0afe52eeac4b2aab88c6b8c6bcd5dfb936125456 Mon Sep 17 00:00:00 2001 From: Gavin Jaeger-Freeborn Date: Mon, 20 Nov 2023 13:37:17 -0800 Subject: [PATCH 9/9] Rename flag-name for python versions to python-version Signed-off-by: Gavin Jaeger-Freeborn --- .github/workflows/controller_unittests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/controller_unittests.yml b/.github/workflows/controller_unittests.yml index 5a3f8a71..999b5bad 100644 --- a/.github/workflows/controller_unittests.yml +++ b/.github/workflows/controller_unittests.yml @@ -41,7 +41,7 @@ jobs: - name: Coveralls Parallel uses: coverallsapp/github-action@v2 with: - flag-name: run-${{ matrix.python-version }} + flag-name: python-${{ matrix.python-version }} parallel: true code-coverage: name: Generate Code Coverage @@ -53,4 +53,4 @@ jobs: uses: coverallsapp/github-action@v2 with: parallel-finished: true - carryforward: "run-3.11" + carryforward: "python-3.11"