Skip to content

Commit

Permalink
tests: Test both fast memory and slower disk mounted filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
serathius committed Apr 12, 2022
1 parent b018742 commit 5ee9844
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 7 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
fail-fast: false
matrix:
target:
- linux-amd64-e2e
- linux-amd64-e2e-release
- linux-amd64-e2e-ramfs
- linux-amd64-e2e-ext4
- linux-386-e2e
steps:
- uses: actions/checkout@v2
Expand All @@ -20,14 +22,32 @@ jobs:
run: |
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-e2e)
linux-amd64-e2e-release)
PASSES='build release e2e' MANUAL_VER=v3.5.0 CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh 2>&1 | tee test.log
! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
;;
linux-386-e2e)
GOARCH=386 PASSES='build e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh 2>&1 | tee test.log
! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
;;
linux-amd64-e2e-ramfs)
TESTDIR=${PWD}/ramfs
mkdir ${TESTDIR}
sudo mount -t ramfs -o size=2048m none ${TESTDIR}
sudo chmod 777 ${TESTDIR}
TMPDIR=${TESTDIR} PASSES='build e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh 2>&1 | tee test.log
! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
;;
linux-amd64-e2e-ext4)
TESTDIR=${PWD}/ext4
dd if=/dev/zero of=ext4.img bs=1M count=2048
mkfs.ext4 ext4.img
mkdir ${TESTDIR}
sudo mount -t ext4 -o loop ext4.img ${TESTDIR}
sudo chmod 777 ${TESTDIR}
TMPDIR=${TESTDIR} PASSES='build e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh 2>&1 | tee test.log
! egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
;;
*)
echo "Failed to find target"
exit 1
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/functional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
fail-fast: false
matrix:
target:
- linux-amd64-functional
- linux-amd64-functional-ramfs
- linux-amd64-functional-ext4
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
Expand All @@ -19,8 +20,23 @@ jobs:
run: |
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-functional)
GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh && GOARCH=amd64 PASSES='functional' ./scripts/test.sh
linux-amd64-functional-ramfs)
GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
TESTDIR=${PWD}/ramfs
mkdir ${TESTDIR}
sudo mount -t ramfs -o size=2048m none ${TESTDIR}
sudo chmod 777 ${TESTDIR}
TMPDIR=${TESTDIR} GOARCH=amd64 PASSES='functional' ./scripts/test.sh
;;
linux-amd64-functional-ext4)
GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
TESTDIR=${PWD}/ext4
dd if=/dev/zero of=ext4.img bs=1M count=2048
mkfs.ext4 ext4.img
mkdir ${TESTDIR}
sudo mount -t ext4 -o loop ext4.img ${TESTDIR}
sudo chmod 777 ${TESTDIR}
TMPDIR=${TESTDIR} GOARCH=amd64 PASSES='functional' ./scripts/test.sh
;;
*)
echo "Failed to find target"
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
- linux-amd64-integration-1-cpu
- linux-amd64-integration-2-cpu
- linux-amd64-integration-4-cpu
- linux-amd64-integration-ramfs
- linux-amd64-integration-ext4
- linux-amd64-unit-4-cpu-race
- linux-386-unit-1-cpu
steps:
Expand All @@ -33,6 +35,24 @@ jobs:
linux-amd64-integration-4-cpu)
GOARCH=amd64 CPU=4 PASSES='integration' RACE='false' ./scripts/test.sh
;;
linux-amd64-integration-ramfs)
GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
TESTDIR=${PWD}/ramfs
mkdir ${TESTDIR}
sudo mount -t ramfs -o size=2048m none ${TESTDIR}
sudo chmod 777 ${TESTDIR}
TMPDIR=${TESTDIR} GOARCH=amd64 PASSES='integration' RACE='false' ./scripts/test.sh
;;
linux-amd64-integration-ext4)
GO_BUILD_FLAGS='-v -mod=readonly' ./scripts/build.sh
TESTDIR=${PWD}/ext4
dd if=/dev/zero of=ext4.img bs=1M count=2048
mkfs.ext4 ext4.img
mkdir ${TESTDIR}
sudo mount -t ext4 -o loop ext4.img ${TESTDIR}
sudo chmod 777 ${TESTDIR}
TMPDIR=${TESTDIR} GOARCH=amd64 PASSES='integration' RACE='false' ./scripts/test.sh
;;
linux-amd64-unit-4-cpu-race)
GOARCH=amd64 PASSES='unit' RACE='true' CPU='4' ./scripts/test.sh -p=2
;;
Expand Down

0 comments on commit 5ee9844

Please sign in to comment.