From 9146ac20854a2f6daada071e2264fcd8afab5e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Va=C5=A1ko?= Date: Thu, 12 Dec 2024 16:47:07 +0100 Subject: [PATCH] WIP --- .github/workflows/test-unit.yml | 12 +++++++++++- Makefile | 2 +- scripts/tests.sh | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index 68fe30f8a8..bb1ce50f79 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -151,9 +151,19 @@ jobs: - name: Upload test cache uses: actions/upload-artifact@v4 with: - name: gotestcache + name: gotestcache-${{ runner.os }} path: ${{ github.workspace }}/cache.out + - name: Set env variable + run: | + echo "GOCACHE=`go env GOCACHE`" >> $GITHUB_ENV + + - name: Uploade test cache folder + uses: actions/upload-artifact@v4 + with: + name: gotestcachef-${{ runner.os }} + path: ${{ env.GOCACHE }} + - name: Check how much space is left after unit test if: matrix.name == 'linux' shell: bash diff --git a/Makefile b/Makefile index ead6038710..9c621e2e87 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ tests-verbose: TEST_VERBOSE=true TEST_LOG_FORMAT=standard-verbose TEST_PACKAGE=./... bash ./scripts/tests.sh tests-unit: - TEST_PACKAGE=./internal/pkg/... bash ./scripts/tests.sh + TEST_PACKAGE=./internal/pkg/diff/... bash ./scripts/tests.sh tests-unit-verbose: TEST_VERBOSE=true TEST_LOG_FORMAT=standard-verbose TEST_PARALLELISM=1 TEST_PARALLELISM_PKG=1 TEST_PACKAGE=./internal/pkg... bash ./scripts/tests.sh diff --git a/scripts/tests.sh b/scripts/tests.sh index 888e4aa7dd..0d362bd09f 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -36,7 +36,7 @@ fi # Run tests, sequentially because the API is shared resource echo "Running tests ..." export KBC_VERSION_CHECK=false # do not check the latest version in the tests -cmd="gotestsum --no-color=false --format \"$TEST_LOG_FORMAT\" -- -timeout 1800s -p $TEST_PARALLELISM_PKG -parallel $TEST_PARALLELISM $TEST_ARGS "$TEST_PACKAGE" $@ 2> cache.out" +cmd="GODEBUG=gocachehash=1 gotestsum --no-color=false --format \"$TEST_LOG_FORMAT\" -- -timeout 1800s -p $TEST_PARALLELISM_PKG -parallel $TEST_PARALLELISM $TEST_ARGS "$TEST_PACKAGE" $@ 2> cache.out" echo $cmd eval $cmd echo "Ok. All tests passed."