fix: docker build/invocation for test runners

This commit is contained in:
Ben McClelland
2024-09-25 13:44:59 -07:00
parent 034a820b99
commit aad7ac02da
3 changed files with 13 additions and 19 deletions

View File

@@ -10,19 +10,19 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker Image - name: Build Docker Image
run: | run: |
mv tests/.env.docker.default tests/.env.docker cp tests/.env.docker.default tests/.env.docker
mv tests/.secrets.default tests/.secrets cp tests/.secrets.default tests/.secrets
docker build --build-arg="GO_LIBRARY=go1.23.1.linux-amd64.tar.gz" \ docker build \
--build-arg="AWS_CLI=awscli-exe-linux-x86_64.zip" --build-arg="MC_FOLDER=linux-amd64" \ --build-arg="GO_LIBRARY=go1.23.1.linux-amd64.tar.gz" \
--progress=plain -f tests/Dockerfile_test_bats -t bats_test . --build-arg="AWS_CLI=awscli-exe-linux-x86_64.zip" \
--build-arg="MC_FOLDER=linux-amd64" \
- name: Set up Docker Compose --progress=plain \
run: sudo apt-get install -y docker-compose -f tests/Dockerfile_test_bats \
-t bats_test .
- name: Run Docker Container - name: Run Docker Container
run: docker-compose -f tests/docker-compose-bats.yml up --exit-code-from s3api_np_only s3api_np_only run: |
docker compose -f tests/docker-compose-bats.yml --project-directory . \
up --exit-code-from s3api_np_only s3api_np_only

View File

@@ -47,7 +47,7 @@ RUN git clone https://github.com/bats-core/bats-core.git && \
USER tester USER tester
RUN mkdir -p /home/tester/tests RUN mkdir -p /home/tester/tests
COPY --chown=tester:tester . /home/tester/tests COPY --chown=tester:tester . /home/tester
# add bats support libraries # add bats support libraries
RUN git clone https://github.com/bats-core/bats-support.git && rm -rf /home/tester/tests/bats-support && mv bats-support /home/tester/tests RUN git clone https://github.com/bats-core/bats-support.git && rm -rf /home/tester/tests/bats-support && mv bats-support /home/tester/tests

View File

@@ -1,33 +1,28 @@
services: services:
no_certs: no_certs:
build: build:
context: ../
dockerfile: tests/Dockerfile_test_bats dockerfile: tests/Dockerfile_test_bats
args: args:
- CONFIG_FILE=tests/.env.nocerts - CONFIG_FILE=tests/.env.nocerts
static_buckets: static_buckets:
build: build:
context: ../
dockerfile: tests/Dockerfile_test_bats dockerfile: tests/Dockerfile_test_bats
args: args:
- CONFIG_FILE=tests/.env.static - CONFIG_FILE=tests/.env.static
posix_backend: posix_backend:
build: build:
context: ../
dockerfile: tests/Dockerfile_test_bats dockerfile: tests/Dockerfile_test_bats
args: args:
- CONFIG_FILE=tests/.env.default - CONFIG_FILE=tests/.env.default
image: bats_test image: bats_test
s3_backend: s3_backend:
build: build:
context: ../
dockerfile: tests/Dockerfile_test_bats dockerfile: tests/Dockerfile_test_bats
args: args:
- CONFIG_FILE=tests/.env.s3 - CONFIG_FILE=tests/.env.s3
- SECRETS_FILE=tests/.secrets.s3 - SECRETS_FILE=tests/.secrets.s3
s3api_np_only: s3api_np_only:
build: build:
context: ../
dockerfile: tests/Dockerfile_test_bats dockerfile: tests/Dockerfile_test_bats
args: args:
- CONFIG_FILE=tests/.env.default - CONFIG_FILE=tests/.env.default
@@ -35,7 +30,6 @@ services:
command: ["s3api-non-policy"] command: ["s3api-non-policy"]
direct: direct:
build: build:
context: ../
dockerfile: tests/Dockerfile_direct dockerfile: tests/Dockerfile_direct
volumes: volumes:
- ./.env.direct:/home/tester/tests/.env.direct - ./.env.direct:/home/tester/tests/.env.direct