Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Matovidlo committed Dec 13, 2024
1 parent e23c58b commit 9146ac2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 9146ac2

Please sign in to comment.