Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
Update integration tests to run in docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
norling committed Nov 7, 2022
1 parent 58557a0 commit 3698fd5
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 31 deletions.
28 changes: 2 additions & 26 deletions .github/workflows/functionality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,5 @@ jobs:
- name: Check out source code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: install s3cmd
run: pip3 install s3cmd

- name: Deploy containers
run: cd dev_utils && GOLANG_VERSION=${{ matrix.go-version }} docker-compose up -d --build

- name: Wait for containers to start
run: |
RETRY_TIMES=0
for p in mq s3
do
until docker ps -f name=$p --format {{.Status}} | grep "(healthy)"
do echo "waiting for $p to become ready"
RETRY_TIMES=$((RETRY_TIMES+1));
if [ $RETRY_TIMES -eq 30 ]; then exit 1; fi
sleep 10;
done
done
- name: Run tests
run: bash -x .github/integration/tests/tests.sh
- name: Run integration tests
run: cd dev_utils && GOLANG_VERSION=${{ matrix.go-version }} docker-compose run integration_tests
4 changes: 2 additions & 2 deletions dev_utils/directS3
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ check_ssl_certificate = False
encoding = UTF-8
encrypt = False
guess_mime_type = True
host_base = localhost:9000
host_bucket = localhost:9000
host_base = s3:9000
host_bucket = s3:9000
human_readable_sizes = True
multipart_chunk_size_mb = 5
use_https = True
Expand Down
23 changes: 23 additions & 0 deletions dev_utils/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,29 @@ services:
- ./users.csv:/users.csv
- ..:/app

integration_tests:
image: python:3.9.15-buster
container_name: s3proxy-integration-tests
profiles:
- test
command:
- "/bin/sh"
- "-c"
- "cd /app; pip install s3cmd && bash ./tests/tests.sh"
depends_on:
mq:
condition: service_healthy
s3:
condition: service_healthy
s3_proxy:
condition: service_started
certfixer:
condition: service_completed_successfully
volumes:
- proxy_certs:/certs
- ./users.csv:/users.csv
- ..:/app

volumes:
pubcert:
s3_certs:
Expand Down
4 changes: 2 additions & 2 deletions dev_utils/proxyS3
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ check_ssl_hostname = False
encoding = UTF-8
encrypt = False
guess_mime_type = True
host_base = localhost:8000
host_bucket = localhost:8000
host_base = s3_proxy:8000
host_bucket = s3_proxy:8000
human_readable_sizes = true
multipart_chunk_size_mb = 5
use_https = True
Expand Down
2 changes: 1 addition & 1 deletion .github/integration/tests/tests.sh → tests/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function check_output_status() {

cd dev_utils || exit 1

s3cmd -c directS3 put README.md s3://test/some_user/ || exit 1
s3cmd -c directS3 put README.md s3://test/some_user/ >/dev/null 2>&1 || exit 1

echo "- Testing allowed actions"

Expand Down

0 comments on commit 3698fd5

Please sign in to comment.