From e963f52230bcafa78112e4d2d5c768fcb0f2ac5c Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Mon, 10 Mar 2025 12:49:08 +0100 Subject: [PATCH 01/16] codecov informational only Signed-off-by: David Fridrich --- .codecov.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.codecov.yaml b/.codecov.yaml index 45090097b4..cf133e3e11 100644 --- a/.codecov.yaml +++ b/.codecov.yaml @@ -6,6 +6,9 @@ coverage: default: target: auto threshold: 4% + # Set non-blocking status checks + # https://docs.codecov.com/docs/common-recipe-list#set-non-blocking-status-checks + informational: true patch: # Disable the coverage threshold of the patch, so that PRs are # only failing because of overall project coverage threshold. From 8b0adcdf2139073188cf00f3f4d37f2f7b78daf9 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Tue, 8 Apr 2025 10:57:40 +0200 Subject: [PATCH 02/16] init: remove codecov Signed-off-by: David Fridrich --- .codecov.yaml | 27 --------- .github/workflows/ci.yaml | 56 +++++++++---------- .../workflows/test-e2e-oncluster-runtime.yaml | 8 +-- .github/workflows/test-e2e-oncluster.yaml | 8 +-- .github/workflows/test-e2e-runtime.yaml | 8 +-- .github/workflows/test-e2e.yaml | 8 +-- .github/workflows/test-integration.yaml | 8 +-- .github/workflows/test-unit.yaml | 8 +-- README.md | 1 - pkg/docker/appease_coverage_gods_test.go | 40 ------------- 10 files changed, 52 insertions(+), 120 deletions(-) delete mode 100644 .codecov.yaml delete mode 100644 pkg/docker/appease_coverage_gods_test.go diff --git a/.codecov.yaml b/.codecov.yaml deleted file mode 100644 index cf133e3e11..0000000000 --- a/.codecov.yaml +++ /dev/null @@ -1,27 +0,0 @@ -coverage: - # Commit status https://docs.codecov.io/docs/commit-status are used - # to block PR based on coverage threshold. - status: - project: - default: - target: auto - threshold: 4% - # Set non-blocking status checks - # https://docs.codecov.com/docs/common-recipe-list#set-non-blocking-status-checks - informational: true - patch: - # Disable the coverage threshold of the patch, so that PRs are - # only failing because of overall project coverage threshold. - # See https://docs.codecov.io/docs/commit-status#disabling-a-status. - default: false -comment: - # Update existing comment or create new if deleted. - behavior: default -ignore: - - "testdata" - - "**/zz_*generated*.go" - - "templates" - - "hack" - - "test" - - "third_party" - diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5fd02cc18d..e3e4e31315 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,13 +38,13 @@ jobs: run: make test - name: Template Unit Tests run: make test-templates - - uses: codecov/codecov-action@v5 - with: - files: ./coverage.txt - flags: unit-tests-${{ matrix.os }} - fail_ci_if_error: true - verbose: true - token: ${{ secrets.CODECOV_TOKEN }} +# - uses: codecov/codecov-action@v5 +# with: +# files: ./coverage.txt +# flags: unit-tests-${{ matrix.os }} +# fail_ci_if_error: true +# verbose: true +# token: ${{ secrets.CODECOV_TOKEN }} test-integration: runs-on: "ubuntu-latest" @@ -82,13 +82,13 @@ jobs: run: ./hack/setup-testing-images.sh - name: Integration Tests run: make test-integration - - uses: codecov/codecov-action@v5 - with: - files: ./coverage.txt - flags: integration-tests - fail_ci_if_error: true - verbose: true - token: ${{ secrets.CODECOV_TOKEN }} +# - uses: codecov/codecov-action@v5 +# with: +# files: ./coverage.txt +# flags: integration-tests +# fail_ci_if_error: true +# verbose: true +# token: ${{ secrets.CODECOV_TOKEN }} e2e-test: strategy: @@ -127,13 +127,13 @@ jobs: run: ./hack/registry.sh - name: E2E Test run: make test-e2e - - uses: codecov/codecov-action@v5 - with: - files: ./coverage.txt - flags: e2e-test - fail_ci_if_error: true - verbose: true - token: ${{ secrets.CODECOV_TOKEN }} +# - uses: codecov/codecov-action@v5 +# with: +# files: ./coverage.txt +# flags: e2e-test +# fail_ci_if_error: true +# verbose: true +# token: ${{ secrets.CODECOV_TOKEN }} e2e-on-cluster-test: strategy: @@ -179,13 +179,13 @@ jobs: env: E2E_RUNTIMES: "" run: make test-e2e-on-cluster - - uses: codecov/codecov-action@v5 - with: - files: ./coverage.txt - flags: e2e-test-oncluster - fail_ci_if_error: true - verbose: true - token: ${{ secrets.CODECOV_TOKEN }} +# - uses: codecov/codecov-action@v5 +# with: +# files: ./coverage.txt +# flags: e2e-test-oncluster +# fail_ci_if_error: true +# verbose: true +# token: ${{ secrets.CODECOV_TOKEN }} build: needs: [check, test-unit, test-integration, e2e-test, e2e-on-cluster-test] diff --git a/.github/workflows/test-e2e-oncluster-runtime.yaml b/.github/workflows/test-e2e-oncluster-runtime.yaml index f6df83c84b..59746673e4 100644 --- a/.github/workflows/test-e2e-oncluster-runtime.yaml +++ b/.github/workflows/test-e2e-oncluster-runtime.yaml @@ -64,7 +64,7 @@ jobs: echo "::group::cluster containers logs" stern '.*' --all-namespaces --no-follow echo "::endgroup::" - - uses: codecov/codecov-action@v5 - with: - files: ./coverage.txt - flags: e2e-test-oncluster-runtime +# - uses: codecov/codecov-action@v5 +# with: +# files: ./coverage.txt +# flags: e2e-test-oncluster-runtime diff --git a/.github/workflows/test-e2e-oncluster.yaml b/.github/workflows/test-e2e-oncluster.yaml index ddba5874d1..23c5a5a083 100644 --- a/.github/workflows/test-e2e-oncluster.yaml +++ b/.github/workflows/test-e2e-oncluster.yaml @@ -51,7 +51,7 @@ jobs: FUNC_REPO_REF: ${{ github.event.pull_request.head.repo.full_name }} FUNC_REPO_BRANCH_REF: ${{ github.head_ref }} run: make test-e2e-on-cluster - - uses: codecov/codecov-action@v5 - with: - files: ./coverage.txt - flags: e2e-test-oncluster +# - uses: codecov/codecov-action@v5 +# with: +# files: ./coverage.txt +# flags: e2e-test-oncluster diff --git a/.github/workflows/test-e2e-runtime.yaml b/.github/workflows/test-e2e-runtime.yaml index 09113e19d2..a88d1ef441 100644 --- a/.github/workflows/test-e2e-runtime.yaml +++ b/.github/workflows/test-e2e-runtime.yaml @@ -62,7 +62,7 @@ jobs: fi done echo "------------------ finished! attempt $attempt ------------------" - - uses: codecov/codecov-action@v5 - with: - files: ./coverage.txt - flags: e2e-test-runtime-${{ matrix.runtime }} +# - uses: codecov/codecov-action@v5 +# with: +# files: ./coverage.txt +# flags: e2e-test-runtime-${{ matrix.runtime }} diff --git a/.github/workflows/test-e2e.yaml b/.github/workflows/test-e2e.yaml index f1a2d7ca7c..4514e11886 100644 --- a/.github/workflows/test-e2e.yaml +++ b/.github/workflows/test-e2e.yaml @@ -41,7 +41,7 @@ jobs: run: ./hack/registry.sh - name: E2E Test run: make test-e2e - - uses: codecov/codecov-action@v5 - with: - files: ./coverage.txt - flags: e2e-test +# - uses: codecov/codecov-action@v5 +# with: +# files: ./coverage.txt +# flags: e2e-test diff --git a/.github/workflows/test-integration.yaml b/.github/workflows/test-integration.yaml index 9a3952e6ea..4621974782 100644 --- a/.github/workflows/test-integration.yaml +++ b/.github/workflows/test-integration.yaml @@ -82,7 +82,7 @@ jobs: name: cluster-logs path: ./cluster_log.txt retention-days: 7 - - uses: codecov/codecov-action@v5 - with: - files: ./coverage.txt - flags: integration-tests +# - uses: codecov/codecov-action@v5 +# with: +# files: ./coverage.txt +# flags: integration-tests diff --git a/.github/workflows/test-unit.yaml b/.github/workflows/test-unit.yaml index 1d634fce1d..7360652f37 100644 --- a/.github/workflows/test-unit.yaml +++ b/.github/workflows/test-unit.yaml @@ -61,7 +61,7 @@ jobs: gh run download -R ${{ github.repository }} ${{ github.run_id }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: codecov/codecov-action@v5 - with: - files: ./coverage-ubuntu-latest/coverage.txt,./coverage-windows-latest/coverage.txt,./coverage-macos-latest/coverage.txt - flags: unit-tests +# - uses: codecov/codecov-action@v5 +# with: +# files: ./coverage-ubuntu-latest/coverage.txt,./coverage-windows-latest/coverage.txt,./coverage-macos-latest/coverage.txt +# flags: unit-tests diff --git a/README.md b/README.md index 8ab8b32a75..8076596b34 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ [![Issues](https://img.shields.io/github/issues/knative/func.svg)](https://github.com/knative/func/issues) [![License](https://img.shields.io/github/license/knative/func)](https://github.com/knative/func/blob/main/LICENSE) [![Releases](https://img.shields.io/github/v/release/knative/func.svg?label=Release)](https://github.com/knative/func/releases) -[![codecov](https://codecov.io/gh/knative/func/branch/main/graph/badge.svg)](https://codecov.io/gh/knative/func) `func` is a Client Library and CLI enabling the development and deployment of Functions. diff --git a/pkg/docker/appease_coverage_gods_test.go b/pkg/docker/appease_coverage_gods_test.go deleted file mode 100644 index 5b2e9766ca..0000000000 --- a/pkg/docker/appease_coverage_gods_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package docker - -import ( - "reflect" - "testing" - - "github.com/docker/docker/client" -) - -// We were not able to make codecov ignore zz_close_guarding_client_generated.go -// This is a workaround. -func TestAppeaseCoverageGods(t *testing.T) { - impl := &closeGuardingClient{} - var cli client.CommonAPIClient = impl - val := reflect.ValueOf(cli) - closeMeth := val.MethodByName("Close") - runAllMethods := func() { - for methIdx := 0; methIdx < val.NumMethod(); methIdx++ { - func() { - defer func() { - // catch the nil dereference since pimpl == nil - _ = recover() - }() - meth := val.Method(methIdx) - if meth == closeMeth { - // we don't want to test the Close() method - return - } - args := make([]reflect.Value, meth.Type().NumIn()) - for argIdx := 0; argIdx < len(args); argIdx++ { - args[argIdx] = reflect.New(meth.Type().In(argIdx)).Elem() - } - meth.Call(args) - }() - } - } - runAllMethods() - impl.closed = true - runAllMethods() -} From faadf4883ab59ec08b027e17ce8392fadf4a10fd Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Tue, 8 Apr 2025 13:21:46 +0200 Subject: [PATCH 03/16] unit test /w token Signed-off-by: David Fridrich --- .github/workflows/test-unit.yaml | 43 +++++++++++++++++++------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test-unit.yaml b/.github/workflows/test-unit.yaml index 7360652f37..935c1c62cd 100644 --- a/.github/workflows/test-unit.yaml +++ b/.github/workflows/test-unit.yaml @@ -44,24 +44,31 @@ jobs: - name: Template Unit Tests if: matrix.os != 'ubuntu-latest' run: make test-templates - - name: "Archive code coverage results" - uses: actions/upload-artifact@v4 - with: - name: coverage-${{ matrix.os }} - path: ./coverage.txt - retention-days: 1 - upload-coverage: - needs: [test] - name: "Upload coverage" - runs-on: "ubuntu-latest" - steps: - - uses: actions/checkout@v4 - - name: Download Coverage - run: | - gh run download -R ${{ github.repository }} ${{ github.run_id }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# - uses: codecov/codecov-action@v5 +# - name: "Archive code coverage results" +# uses: actions/upload-artifact@v4 # with: +# name: coverage-${{ matrix.os }} +# path: ./coverage.txt +# retention-days: 1 +# upload-coverage: +# needs: [test] +# name: "Upload coverage" +# runs-on: "ubuntu-latest" +# steps: +# - uses: actions/checkout@v4 +# - name: Download Coverage +# run: | +# gh run download -R ${{ github.repository }} ${{ github.run_id }} +# env: +# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # files: ./coverage-ubuntu-latest/coverage.txt,./coverage-windows-latest/coverage.txt,./coverage-macos-latest/coverage.txt # flags: unit-tests + - name: Upload coverage to Codecov + - uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.txt + flags: unit-tests-${{ matrix.os }} + name: codecov-${{ matrix.os }} + fail_ci_if_error: true + From e24065564acd76fa47ca793b4b6037823ef6077b Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Tue, 8 Apr 2025 13:29:02 +0200 Subject: [PATCH 04/16] .codecov yaml Signed-off-by: David Fridrich --- .codecov.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .codecov.yaml diff --git a/.codecov.yaml b/.codecov.yaml new file mode 100644 index 0000000000..f724985cb3 --- /dev/null +++ b/.codecov.yaml @@ -0,0 +1,11 @@ +coverage: + status: + project: + default: + target: auto + threshold: 4% + patch: + default: false + comment: + layout: reach, diff, flags, files + behavior: default From 49ad37e9bfe49bca711064aee7ae1dd18d61bd61 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Tue, 8 Apr 2025 14:16:44 +0200 Subject: [PATCH 05/16] no token Signed-off-by: David Fridrich --- .github/workflows/test-unit.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-unit.yaml b/.github/workflows/test-unit.yaml index 935c1c62cd..0ad4d4515b 100644 --- a/.github/workflows/test-unit.yaml +++ b/.github/workflows/test-unit.yaml @@ -66,7 +66,6 @@ jobs: - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 with: - token: ${{ secrets.CODECOV_TOKEN }} files: coverage.txt flags: unit-tests-${{ matrix.os }} name: codecov-${{ matrix.os }} From 2c40be5961318320231b2947c807ee43c894a858 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Tue, 8 Apr 2025 14:19:14 +0200 Subject: [PATCH 06/16] codecov yaml fix Signed-off-by: David Fridrich --- .codecov.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.codecov.yaml b/.codecov.yaml index f724985cb3..4c21171aeb 100644 --- a/.codecov.yaml +++ b/.codecov.yaml @@ -6,6 +6,6 @@ coverage: threshold: 4% patch: default: false - comment: - layout: reach, diff, flags, files - behavior: default +comment: + layout: reach, diff, flags, files + behavior: default From 190a3a26d5058d108762eb39bfc11cbd20be086e Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Tue, 8 Apr 2025 14:45:13 +0200 Subject: [PATCH 07/16] fix wf Signed-off-by: David Fridrich --- .codecov.yaml | 2 +- .github/workflows/test-unit.yaml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.codecov.yaml b/.codecov.yaml index 4c21171aeb..9331c5192f 100644 --- a/.codecov.yaml +++ b/.codecov.yaml @@ -7,5 +7,5 @@ coverage: patch: default: false comment: - layout: reach, diff, flags, files + layout: "reach, diff, flags, files" behavior: default diff --git a/.github/workflows/test-unit.yaml b/.github/workflows/test-unit.yaml index 0ad4d4515b..6c33c9f545 100644 --- a/.github/workflows/test-unit.yaml +++ b/.github/workflows/test-unit.yaml @@ -64,8 +64,9 @@ jobs: # files: ./coverage-ubuntu-latest/coverage.txt,./coverage-windows-latest/coverage.txt,./coverage-macos-latest/coverage.txt # flags: unit-tests - name: Upload coverage to Codecov - - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v5 with: + token: ${{ CODECOV_TOKEN }} files: coverage.txt flags: unit-tests-${{ matrix.os }} name: codecov-${{ matrix.os }} From b3e787620041c27cc5a5da7cbcf55a11a8f809f3 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Tue, 8 Apr 2025 14:48:48 +0200 Subject: [PATCH 08/16] fix secrets codecov token Signed-off-by: David Fridrich --- .github/workflows/test-unit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-unit.yaml b/.github/workflows/test-unit.yaml index 6c33c9f545..961f0ffa8f 100644 --- a/.github/workflows/test-unit.yaml +++ b/.github/workflows/test-unit.yaml @@ -66,7 +66,7 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: - token: ${{ CODECOV_TOKEN }} + token: ${{ secrets.CODECOV_TOKEN }} files: coverage.txt flags: unit-tests-${{ matrix.os }} name: codecov-${{ matrix.os }} From aaf15a01d30879da6207af6dd3ced9dc75d04690 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Tue, 8 Apr 2025 18:49:56 +0200 Subject: [PATCH 09/16] verbose Signed-off-by: David Fridrich --- .github/workflows/test-unit.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-unit.yaml b/.github/workflows/test-unit.yaml index 961f0ffa8f..61a956ebd5 100644 --- a/.github/workflows/test-unit.yaml +++ b/.github/workflows/test-unit.yaml @@ -71,4 +71,5 @@ jobs: flags: unit-tests-${{ matrix.os }} name: codecov-${{ matrix.os }} fail_ci_if_error: true + verbose: true From 7123c058ba2156522cafc83ec057b77b5290e7ec Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 9 Apr 2025 21:08:48 +0200 Subject: [PATCH 10/16] add back more tests, codecov config Signed-off-by: David Fridrich --- .codecov.yaml | 7 +++++++ .github/workflows/test-e2e-oncluster-runtime.yaml | 8 ++++---- .github/workflows/test-e2e-oncluster.yaml | 8 ++++---- .github/workflows/test-unit.yaml | 1 - 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.codecov.yaml b/.codecov.yaml index 9331c5192f..581d51e433 100644 --- a/.codecov.yaml +++ b/.codecov.yaml @@ -9,3 +9,10 @@ coverage: comment: layout: "reach, diff, flags, files" behavior: default +ignore: + - "testdata" + - "**/*_generated.go" + - "templates" + - "hack" + - "test" + - "third_party" diff --git a/.github/workflows/test-e2e-oncluster-runtime.yaml b/.github/workflows/test-e2e-oncluster-runtime.yaml index 59746673e4..f6df83c84b 100644 --- a/.github/workflows/test-e2e-oncluster-runtime.yaml +++ b/.github/workflows/test-e2e-oncluster-runtime.yaml @@ -64,7 +64,7 @@ jobs: echo "::group::cluster containers logs" stern '.*' --all-namespaces --no-follow echo "::endgroup::" -# - uses: codecov/codecov-action@v5 -# with: -# files: ./coverage.txt -# flags: e2e-test-oncluster-runtime + - uses: codecov/codecov-action@v5 + with: + files: ./coverage.txt + flags: e2e-test-oncluster-runtime diff --git a/.github/workflows/test-e2e-oncluster.yaml b/.github/workflows/test-e2e-oncluster.yaml index 23c5a5a083..ddba5874d1 100644 --- a/.github/workflows/test-e2e-oncluster.yaml +++ b/.github/workflows/test-e2e-oncluster.yaml @@ -51,7 +51,7 @@ jobs: FUNC_REPO_REF: ${{ github.event.pull_request.head.repo.full_name }} FUNC_REPO_BRANCH_REF: ${{ github.head_ref }} run: make test-e2e-on-cluster -# - uses: codecov/codecov-action@v5 -# with: -# files: ./coverage.txt -# flags: e2e-test-oncluster + - uses: codecov/codecov-action@v5 + with: + files: ./coverage.txt + flags: e2e-test-oncluster diff --git a/.github/workflows/test-unit.yaml b/.github/workflows/test-unit.yaml index 61a956ebd5..80d373d88c 100644 --- a/.github/workflows/test-unit.yaml +++ b/.github/workflows/test-unit.yaml @@ -66,7 +66,6 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: - token: ${{ secrets.CODECOV_TOKEN }} files: coverage.txt flags: unit-tests-${{ matrix.os }} name: codecov-${{ matrix.os }} From 7b139db1f7f6f87ea8bfd5d0b4afbb94f15a5154 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Thu, 10 Apr 2025 12:35:10 +0200 Subject: [PATCH 11/16] add rest of PR tests, codecov yaml update Signed-off-by: David Fridrich --- .codecov.yaml | 2 +- .github/workflows/test-e2e-runtime.yaml | 8 ++++---- .github/workflows/test-e2e.yaml | 8 ++++---- .github/workflows/test-integration.yaml | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.codecov.yaml b/.codecov.yaml index 581d51e433..73d57b07b3 100644 --- a/.codecov.yaml +++ b/.codecov.yaml @@ -11,7 +11,7 @@ comment: behavior: default ignore: - "testdata" - - "**/*_generated.go" + - "**/zz*_generated.go" - "templates" - "hack" - "test" diff --git a/.github/workflows/test-e2e-runtime.yaml b/.github/workflows/test-e2e-runtime.yaml index a88d1ef441..09113e19d2 100644 --- a/.github/workflows/test-e2e-runtime.yaml +++ b/.github/workflows/test-e2e-runtime.yaml @@ -62,7 +62,7 @@ jobs: fi done echo "------------------ finished! attempt $attempt ------------------" -# - uses: codecov/codecov-action@v5 -# with: -# files: ./coverage.txt -# flags: e2e-test-runtime-${{ matrix.runtime }} + - uses: codecov/codecov-action@v5 + with: + files: ./coverage.txt + flags: e2e-test-runtime-${{ matrix.runtime }} diff --git a/.github/workflows/test-e2e.yaml b/.github/workflows/test-e2e.yaml index 4514e11886..f1a2d7ca7c 100644 --- a/.github/workflows/test-e2e.yaml +++ b/.github/workflows/test-e2e.yaml @@ -41,7 +41,7 @@ jobs: run: ./hack/registry.sh - name: E2E Test run: make test-e2e -# - uses: codecov/codecov-action@v5 -# with: -# files: ./coverage.txt -# flags: e2e-test + - uses: codecov/codecov-action@v5 + with: + files: ./coverage.txt + flags: e2e-test diff --git a/.github/workflows/test-integration.yaml b/.github/workflows/test-integration.yaml index 4621974782..9a3952e6ea 100644 --- a/.github/workflows/test-integration.yaml +++ b/.github/workflows/test-integration.yaml @@ -82,7 +82,7 @@ jobs: name: cluster-logs path: ./cluster_log.txt retention-days: 7 -# - uses: codecov/codecov-action@v5 -# with: -# files: ./coverage.txt -# flags: integration-tests + - uses: codecov/codecov-action@v5 + with: + files: ./coverage.txt + flags: integration-tests From 078f3b8311b1abafecf947a1415c2f14ad86232b Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Mon, 14 Apr 2025 08:22:43 +0200 Subject: [PATCH 12/16] return ci and codecov ignore update Signed-off-by: David Fridrich --- .codecov.yaml | 1 + .github/workflows/ci.yaml | 56 +++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/.codecov.yaml b/.codecov.yaml index 73d57b07b3..bb83a1efdf 100644 --- a/.codecov.yaml +++ b/.codecov.yaml @@ -8,6 +8,7 @@ coverage: default: false comment: layout: "reach, diff, flags, files" + # Update existing comment or create a new if deleted. behavior: default ignore: - "testdata" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e3e4e31315..5fd02cc18d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,13 +38,13 @@ jobs: run: make test - name: Template Unit Tests run: make test-templates -# - uses: codecov/codecov-action@v5 -# with: -# files: ./coverage.txt -# flags: unit-tests-${{ matrix.os }} -# fail_ci_if_error: true -# verbose: true -# token: ${{ secrets.CODECOV_TOKEN }} + - uses: codecov/codecov-action@v5 + with: + files: ./coverage.txt + flags: unit-tests-${{ matrix.os }} + fail_ci_if_error: true + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} test-integration: runs-on: "ubuntu-latest" @@ -82,13 +82,13 @@ jobs: run: ./hack/setup-testing-images.sh - name: Integration Tests run: make test-integration -# - uses: codecov/codecov-action@v5 -# with: -# files: ./coverage.txt -# flags: integration-tests -# fail_ci_if_error: true -# verbose: true -# token: ${{ secrets.CODECOV_TOKEN }} + - uses: codecov/codecov-action@v5 + with: + files: ./coverage.txt + flags: integration-tests + fail_ci_if_error: true + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} e2e-test: strategy: @@ -127,13 +127,13 @@ jobs: run: ./hack/registry.sh - name: E2E Test run: make test-e2e -# - uses: codecov/codecov-action@v5 -# with: -# files: ./coverage.txt -# flags: e2e-test -# fail_ci_if_error: true -# verbose: true -# token: ${{ secrets.CODECOV_TOKEN }} + - uses: codecov/codecov-action@v5 + with: + files: ./coverage.txt + flags: e2e-test + fail_ci_if_error: true + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} e2e-on-cluster-test: strategy: @@ -179,13 +179,13 @@ jobs: env: E2E_RUNTIMES: "" run: make test-e2e-on-cluster -# - uses: codecov/codecov-action@v5 -# with: -# files: ./coverage.txt -# flags: e2e-test-oncluster -# fail_ci_if_error: true -# verbose: true -# token: ${{ secrets.CODECOV_TOKEN }} + - uses: codecov/codecov-action@v5 + with: + files: ./coverage.txt + flags: e2e-test-oncluster + fail_ci_if_error: true + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} build: needs: [check, test-unit, test-integration, e2e-test, e2e-on-cluster-test] From 19c63bffc0861e02c93c4a2119ed4c4130ee2704 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 16 Apr 2025 08:29:20 +0200 Subject: [PATCH 13/16] add runtime e2e tests to ci Signed-off-by: David Fridrich --- .github/workflows/ci.yaml | 63 +++++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 64 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5fd02cc18d..09f2fce063 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -187,6 +187,69 @@ jobs: verbose: true token: ${{ secrets.CODECOV_TOKEN }} + e2e-runtime-test: + continue-on-error: true + strategy: + matrix: + runtime: ["node", "go", "quarkus", "springboot", "typescript", "rust"] + runs-on: ubuntu-latest + steps: + - name: Set Environment Variables + run: | + echo "KUBECONFIG=${{ github.workspace }}/hack/bin/kubeconfig.yaml" >> "$GITHUB_ENV" + echo "PATH=${{ github.workspace }}/hack/bin:$PATH" >> "$GITHUB_ENV" + - uses: actions/checkout@v4 + - uses: knative/actions/setup-go@main + - name: Install Binaries + run: ./hack/install-binaries.sh + - name: Allocate Cluster + run: | + attempt=0 + max_attempts=5 + until [ $attempt -ge $max_attempts ] + do + attempt=$((attempt+1)) + echo "------------------ Attempt $attempt for ${{matrix.runtime}} ------------------" + ./hack/allocate.sh && break + echo "------------------ failed, retrying... ------------------" + if [ $attempt -ge $max_attempts ]; then + echo "------------------ max # of retries reached, exiting ------------------" + exit 1 + fi + ./hack/delete.sh + echo "------------------ sleep for 5 minutes ------------------" + sleep 300 + done + echo "------------------ finished! attempt $attempt ------------------" + - name: Local Registry + run: ./hack/registry.sh + - name: Build + run: make + - name: E2E runtime for ${{ matrix.runtime }} + run: | + attempt=0 + max_attempts=5 + until [ $attempt -ge $max_attempts ] + do + attempt=$((attempt+1)) + echo "------------------ Attempt $attempt for ${{matrix.runtime}} ------------------" + make test-e2e-runtime runtime=${{ matrix.runtime }} && break + echo "------------------ failed, retrying... ------------------" + if [ $attempt -ge $max_attempts ]; then + echo "------------------ max # of retries reached, exiting ------------------" + exit 1 + fi + done + echo "------------------ finished! attempt $attempt ------------------" + - uses: codecov/codecov-action@v5 + with: + files: ./coverage.txt + flags: e2e-test-runtime-${{ matrix.runtime }} + fail_ci_if_error: true + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + + build: needs: [check, test-unit, test-integration, e2e-test, e2e-on-cluster-test] runs-on: ubuntu-latest diff --git a/README.md b/README.md index 8076596b34..b8d7f4c5c8 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![Issues](https://img.shields.io/github/issues/knative/func.svg)](https://github.com/knative/func/issues) [![License](https://img.shields.io/github/license/knative/func)](https://github.com/knative/func/blob/main/LICENSE) [![Releases](https://img.shields.io/github/v/release/knative/func.svg?label=Release)](https://github.com/knative/func/releases) +![codecov](https://codecov.io/gh/knative/func/branch/main/graph/badge.svg)](https://codecov.io/gh/knative/func) `func` is a Client Library and CLI enabling the development and deployment of Functions. From 1bccf3bece3f29ef61372b517658b4ea44267a71 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 16 Apr 2025 18:34:26 +0200 Subject: [PATCH 14/16] fixup codecov comments Signed-off-by: David Fridrich --- .codecov.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.codecov.yaml b/.codecov.yaml index bb83a1efdf..5a4360b44f 100644 --- a/.codecov.yaml +++ b/.codecov.yaml @@ -1,10 +1,15 @@ coverage: + # Commit status https://docs.codecov.io/docs/commit-status are used + # to block PR based on coverage threshold. status: project: default: target: auto threshold: 4% patch: + # Disable the coverage threshold of the patch, so that PRs are + # only failing because of overall project coverage threshold. + # See https://docs.codecov.io/docs/commit-status#disabling-a-status. default: false comment: layout: "reach, diff, flags, files" From 099cba1bd48e562643ac140263e7bfadcf768682 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 16 Apr 2025 18:35:08 +0200 Subject: [PATCH 15/16] remove unnecessary layout Signed-off-by: David Fridrich --- .codecov.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.codecov.yaml b/.codecov.yaml index 5a4360b44f..a95de311ed 100644 --- a/.codecov.yaml +++ b/.codecov.yaml @@ -12,7 +12,6 @@ coverage: # See https://docs.codecov.io/docs/commit-status#disabling-a-status. default: false comment: - layout: "reach, diff, flags, files" # Update existing comment or create a new if deleted. behavior: default ignore: From 24683f9d03307284d97691137ede3b69902c6d44 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 16 Apr 2025 19:09:59 +0200 Subject: [PATCH 16/16] fix Signed-off-by: David Fridrich --- .codecov.yaml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.codecov.yaml b/.codecov.yaml index a95de311ed..22b1c9a1aa 100644 --- a/.codecov.yaml +++ b/.codecov.yaml @@ -12,7 +12,7 @@ coverage: # See https://docs.codecov.io/docs/commit-status#disabling-a-status. default: false comment: - # Update existing comment or create a new if deleted. + # Update existing comment or create new if deleted. behavior: default ignore: - "testdata" diff --git a/README.md b/README.md index b8d7f4c5c8..8ab8b32a75 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Issues](https://img.shields.io/github/issues/knative/func.svg)](https://github.com/knative/func/issues) [![License](https://img.shields.io/github/license/knative/func)](https://github.com/knative/func/blob/main/LICENSE) [![Releases](https://img.shields.io/github/v/release/knative/func.svg?label=Release)](https://github.com/knative/func/releases) -![codecov](https://codecov.io/gh/knative/func/branch/main/graph/badge.svg)](https://codecov.io/gh/knative/func) +[![codecov](https://codecov.io/gh/knative/func/branch/main/graph/badge.svg)](https://codecov.io/gh/knative/func) `func` is a Client Library and CLI enabling the development and deployment of Functions.