From d1dbcabb3dd8948bf6103d5e343281357035dcee Mon Sep 17 00:00:00 2001 From: Seebs Date: Wed, 22 Feb 2023 13:32:05 -0600 Subject: [PATCH] fix cleanup logic for ramdisk usage we want to be sure we delete the files we created during the run even if the test run panics, but not files other runs may have created also in /mnt/ramdisk. --- .gitlab/.gitlab-ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 57ea4d522..c5e3f1cfb 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -216,7 +216,11 @@ run go tests race: script: - echo "Running featurebase race tests..." - PKG_LIST=$(go list ./... | grep -Ev 'internal/clustertests|simulacraData|batch|idk|v3/dax/test/dax' | paste -s -d, -) - - TMPDIR=/mnt/ramdisk go test -race -v -timeout=10m ${PKG_LIST//,/ } + - export TMPDIR=/mnt/ramdisk/test-$CI_JOB_ID + - mkdir -p $TMPDIR + - go test -race -v -timeout=10m ${PKG_LIST//,/ } + after_script: + - rm -rf /mnt/ramdisk/test-$CI_JOB_ID tags: - docker @@ -232,7 +236,11 @@ run go tests: script: - echo "Running featurebase unit tests..." - PKG_LIST=$(go list ./... | grep -Ev 'internal/clustertests|simulacraData|batch|idk|v3/dax/test/dax' | paste -s -d, -) - - TMPDIR=/mnt/ramdisk go test -tags=shardwidth22 -timeout=10m -coverprofile=coverage.out -covermode=atomic -coverpkg=${PKG_LIST} ${PKG_LIST//,/ } + - export TMPDIR=/mnt/ramdisk/test-$CI_JOB_ID + - mkdir -p $TMPDIR + - go test -tags=shardwidth22 -timeout=10m -coverprofile=coverage.out -covermode=atomic -coverpkg=${PKG_LIST} ${PKG_LIST//,/ } + after_script: + - rm -rf /mnt/ramdisk/test-$CI_JOB_ID artifacts: paths: - coverage.out