Skip to content

Commit 683fa78

Browse files
committed
Fix exit code from 'Aborting on container exit...' on down
1 parent 4178980 commit 683fa78

4 files changed

Lines changed: 13 additions & 15 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ jobs:
1313

1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2 # Required to mount the Github Workspace to a volume
16+
uses: actions/checkout@v2
1717
- name: run one version test
1818
uses: sudo-bot/action-docker-compose@latest
1919
with:
20-
# https://docs.docker.com/compose/reference/overview/
2120
cli-args: -f ./regression-run/docker-compose.yml up --build s3fs-tests --exit-code-from s3fs-tests
2221
- name: run multiversion test
2322
uses: sudo-bot/action-docker-compose@latest
2423
with:
25-
# https://docs.docker.com/compose/reference/overview/
2624
cli-args: -f ./regression-run/docker-compose.yml up --build s3fs-test-multiple-versions --exit-code-from s3fs-test-multiple-versions
2725

regression-run/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ services:
3232
AWS_SECRET_KEY: 'secret-key-dont-matter-for-fake-s3'
3333
AWS_ENDPOINT: 'http://s3fs-fake-s3:4566/'
3434
# defaulting command to unit tests, for multiversion we will use slimmer regression.js
35-
command: ${TEST_COMMAND:-npm run test}
35+
command: "${TEST_COMMAND:-npm run test}"
3636

3737

3838
s3fs-test-multiple-versions:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
FROM alpine:3.16
22

33
WORKDIR /usr/local/src/s3fs
4-
COPY . .
54
COPY --from=docker /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose
65
COPY ./regression-run/test-multiple-versions/entrypoint.sh /entrypoint.sh
6+
COPY . .
77

88
ENTRYPOINT /entrypoint.sh
99

regression-run/test-multiple-versions/entrypoint.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@ function cleanup()
55
{
66
exit_status=$?
77
echo "exit was $exit_status"
8-
docker-compose -f regression-run/docker-compose.yml down 2>&1|| true
9-
exit $exit_status
8+
9+
docker-compose -f regression-run/docker-compose.yml rm s3fs-fake-s3 -f || true
10+
11+
exit "$exit_status"
1012
}
1113
trap cleanup EXIT
1214

13-
docker-compose -f regression-run/docker-compose.yml up -d --no-recreate s3fs-fake-s3
15+
docker-compose -f regression-run/docker-compose.yml up --build -d --no-recreate s3fs-fake-s3
1416

1517
for NODEJS_VERSION in $NODEJS_VERSIONS_TO_TEST_UNIT
1618
do
17-
export NODEJS_VERSION="${NODEJS_VERSION}"
18-
docker-compose -f regression-run/docker-compose.yml build s3fs-tests
1919
echo "======================Start unit testing nodejs version ${NODEJS_VERSION}============================="
20-
NODE_ENV=production \
20+
NODEJS_VERSION="${NODEJS_VERSION}" \
21+
NODE_ENV=development \
2122
TEST_COMMAND="npm run test" \
22-
docker-compose -f regression-run/docker-compose.yml up s3fs-tests --no-recreate --exit-code-from s3fs-tests
23+
docker-compose -f regression-run/docker-compose.yml up --build s3fs-tests --no-recreate --exit-code-from s3fs-tests
2324
done
2425

2526

2627
for NODEJS_VERSION in $NODEJS_VERSIONS_TO_TEST_REGRESSION
2728
do
28-
export NODEJS_VERSION="${NODEJS_VERSION}"
29-
docker-compose -f regression-run/docker-compose.yml build s3fs-tests
3029
echo "======================Start regression testing nodejs version ${NODEJS_VERSION}============================="
30+
NODEJS_VERSION="${NODEJS_VERSION}" \
3131
NODE_ENV=production \
3232
TEST_COMMAND="npm run test-regression" \
33-
docker-compose -f regression-run/docker-compose.yml up s3fs-tests --no-recreate --exit-code-from s3fs-tests
33+
docker-compose -f regression-run/docker-compose.yml up --build s3fs-tests --no-recreate --exit-code-from s3fs-tests
3434
done

0 commit comments

Comments
 (0)