diff --git a/.github/workflows/functionality.yml b/.github/workflows/functionality.yml index c8ccacd..6cd7283 100644 --- a/.github/workflows/functionality.yml +++ b/.github/workflows/functionality.yml @@ -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 diff --git a/dev_utils/directS3 b/dev_utils/directS3 index a6c7304..453bbce 100644 --- a/dev_utils/directS3 +++ b/dev_utils/directS3 @@ -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 diff --git a/dev_utils/docker-compose.yml b/dev_utils/docker-compose.yml index fd2011b..0c04bf4 100644 --- a/dev_utils/docker-compose.yml +++ b/dev_utils/docker-compose.yml @@ -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: diff --git a/dev_utils/proxyS3 b/dev_utils/proxyS3 index 4e287f9..426786b 100644 --- a/dev_utils/proxyS3 +++ b/dev_utils/proxyS3 @@ -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 diff --git a/.github/integration/tests/tests.sh b/tests/tests.sh similarity index 98% rename from .github/integration/tests/tests.sh rename to tests/tests.sh index f1d799e..5557c12 100644 --- a/.github/integration/tests/tests.sh +++ b/tests/tests.sh @@ -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"