Skip to content

Commit 0eaf07f

Browse files
committed
chore: Tests on localstack
1 parent 0468956 commit 0eaf07f

File tree

7 files changed

+21
-7
lines changed

7 files changed

+21
-7
lines changed

.github/workflows/cluster_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ jobs:
2020
run: env CGO_ENABLED=0 go build -o tigrisfs-linux-amd64 -v && ln -s tigrisfs-linux-amd64 tigrisfs
2121

2222
- name: Run cluster tests
23-
run: NUM_ITER=100 SAME_PROCESS_MOUNT=1 make run-cluster-test
23+
run: LOCALSTACK=1 NUM_ITER=100 SAME_PROCESS_MOUNT=1 make run-cluster-test
2424
timeout-minutes: 25

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
run: env CGO_ENABLED=0 go build -o tigrisfs-linux-amd64 -v && ln -s tigrisfs-linux-amd64 tigrisfs
1818

1919
- name: Run tests
20-
run: SAME_PROCESS_MOUNT=1 make run-test
20+
run: LOCALSTACK=1 SAME_PROCESS_MOUNT=1 make run-test
2121
timeout-minutes: 12

.github/workflows/xfstests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
run: env CGO_ENABLED=0 go build -o tigrisfs-linux-amd64 -v && ln -s tigrisfs-linux-amd64 tigrisfs
1818

1919
- name: Run xfstests
20-
run: make run-xfstests
20+
run: LOCALSTACK=1 make run-xfstests
2121
timeout-minutes: 10

core/goofys_fs_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ func (s *GoofysTest) TestIssue69Fuse(t *C) {
7575
}
7676

7777
func (s *GoofysTest) TestWriteAnonymousFuse(t *C) {
78+
if os.Getenv("LOCALSTACK") != "" {
79+
t.Skip("not supported on localstack")
80+
}
7881
s.anonymous(t)
7982
s.fs.flags.StatCacheTTL = 1 * time.Minute
8083

core/goofys_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1563,6 +1563,10 @@ func (s *GoofysTest) setS3(back StorageBackend) StorageBackend {
15631563
}
15641564

15651565
func (s *GoofysTest) TestWriteAnonymous(t *C) {
1566+
if os.Getenv("LOCALSTACK") != "" {
1567+
t.Skip("fails on LOCALSTACK")
1568+
}
1569+
15661570
s.anonymous(t)
15671571
s.fs.flags.StatCacheTTL = 1 * time.Minute
15681572

@@ -2064,7 +2068,7 @@ func (s *GoofysTest) TestRead403(t *C) {
20642068
// anonymous only works in S3 for now
20652069
cloud := s.getRoot(t).fs.getCloud()
20662070
s3, ok := cloud.Delegate().(*S3Backend)
2067-
if !ok || s.isLocalTigris {
2071+
if !ok || s.isLocalTigris || os.Getenv("LOCALSTACK") != "" {
20682072
t.Skip("only for S3")
20692073
}
20702074

test/cluster/proxy.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,17 @@ TEST_ARTIFACTS="${TEST_ARTIFACTS:-executions/$(date +"%Y-%m-%d-%H-%M-%S")}"
3838
mkdir -p "$TEST_ARTIFACTS"
3939

4040
echo "=== Start s3proxy on $ENDPOINT"
41-
$PROXY_BIN > "$TEST_ARTIFACTS/s3proxy_log" &
41+
if [ "$LOCALSTACK" != "" ]; then
42+
docker run -d --name localstack -p 8080:4566 -p 4571:4571 localstack/localstack
43+
else
44+
$PROXY_BIN > "$TEST_ARTIFACTS/s3proxy_log" &
45+
fi
4246
PROXY_PID=$!
4347
sleep 15
4448

4549
_kill_s3proxy() {
4650
echo "=== Kill s3proxy"
47-
kill -9 $PROXY_PID
51+
kill -9 $PROXY_PID || true
4852
}
4953

5054
echo "=== Create s3://test"

test/run-proxy.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PROXY_FS=$PROXY_FS
2424
PROXY_PORT=${PROXY_PORT:-8080}
2525
TIMEOUT=${TIMEOUT:-10m}
2626

27-
trap 'kill -9 $PROXY_PID' EXIT
27+
trap 'kill -9 $PROXY_PID || true' EXIT
2828

2929
if [ $CLOUD == "s3" ]; then
3030
sed 's/$PORT/'$PROXY_PORT'/' < test/s3proxy.properties > test/s3proxy_test.properties
@@ -33,6 +33,9 @@ if [ $CLOUD == "s3" ]; then
3333
echo jclouds.provider=filesystem >>test/s3proxy_test.properties
3434
echo jclouds.filesystem.basedir=/tmp/s3proxy >>test/s3proxy_test.properties
3535
fi
36+
if [ "$LOCALSTACK" != "" ]; then
37+
docker run -d --name localstack -p 8080:4566 -p 4571:4571 localstack/localstack
38+
fi
3639
PROXY_BIN="java -Xms512m -Xmx16g --add-opens java.base/java.lang=ALL-UNNAMED -jar s3proxy.jar --properties test/s3proxy_test.properties"
3740
export AWS_ACCESS_KEY_ID=foo
3841
export AWS_SECRET_ACCESS_KEY=bar

0 commit comments

Comments
 (0)