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 b795dab
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 5 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ jobs:
fail-fast: true
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
22 changes: 19 additions & 3 deletions .github/workflows/functional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ jobs:
fail-fast: true
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
18 changes: 18 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,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 CPU=4 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 CPU=4 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 b795dab

Please sign in to comment.