Skip to content

Commit 78b7e48

Browse files
committed
fix: docker build/invocation for test runners
1 parent 034a820 commit 78b7e48

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

.github/workflows/docker-bats.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,17 @@ jobs:
1010
- name: Checkout
1111
uses: actions/checkout@v4
1212

13-
- name: Set up Docker Buildx
14-
uses: docker/setup-buildx-action@v3
15-
1613
- name: Build Docker Image
1714
run: |
18-
mv tests/.env.docker.default tests/.env.docker
19-
mv tests/.secrets.default tests/.secrets
15+
mv tests/.env.docker.default .env.docker
16+
mv tests/.secrets.default .secrets
2017
docker build --build-arg="GO_LIBRARY=go1.23.1.linux-amd64.tar.gz" \
2118
--build-arg="AWS_CLI=awscli-exe-linux-x86_64.zip" --build-arg="MC_FOLDER=linux-amd64" \
22-
--progress=plain -f tests/Dockerfile_test_bats -t bats_test .
19+
--progress=plain -f tests/Dockerfile_test_bats tests/
2320
2421
- name: Set up Docker Compose
2522
run: sudo apt-get install -y docker-compose
2623

2724
- name: Run Docker Container
28-
run: docker-compose -f tests/docker-compose-bats.yml up --exit-code-from s3api_np_only s3api_np_only
25+
run: docker compose -f tests/docker-compose-bats.yml --project-directory . \
26+
up --exit-code-from s3api_np_only s3api_np_only

tests/Dockerfile_direct

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ RUN git clone https://github.com/bats-core/bats-core.git && \
4747

4848
USER tester
4949
RUN mkdir -p /home/tester/tests
50-
COPY --chown=tester:tester . /home/tester/tests
50+
COPY --chown=tester:tester . /home/tester
5151

5252
# add bats support libraries
5353
RUN git clone https://github.com/bats-core/bats-support.git && rm -rf /home/tester/tests/bats-support && mv bats-support /home/tester/tests

tests/docker-compose-bats.yml

-6
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,35 @@
11
services:
22
no_certs:
33
build:
4-
context: ../
54
dockerfile: tests/Dockerfile_test_bats
65
args:
76
- CONFIG_FILE=tests/.env.nocerts
87
static_buckets:
98
build:
10-
context: ../
119
dockerfile: tests/Dockerfile_test_bats
1210
args:
1311
- CONFIG_FILE=tests/.env.static
1412
posix_backend:
1513
build:
16-
context: ../
1714
dockerfile: tests/Dockerfile_test_bats
1815
args:
1916
- CONFIG_FILE=tests/.env.default
2017
image: bats_test
2118
s3_backend:
2219
build:
23-
context: ../
2420
dockerfile: tests/Dockerfile_test_bats
2521
args:
2622
- CONFIG_FILE=tests/.env.s3
2723
- SECRETS_FILE=tests/.secrets.s3
2824
s3api_np_only:
2925
build:
30-
context: ../
3126
dockerfile: tests/Dockerfile_test_bats
3227
args:
3328
- CONFIG_FILE=tests/.env.default
3429
image: bats_test
3530
command: ["s3api-non-policy"]
3631
direct:
3732
build:
38-
context: ../
3933
dockerfile: tests/Dockerfile_direct
4034
volumes:
4135
- ./.env.direct:/home/tester/tests/.env.direct

0 commit comments

Comments
 (0)