diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index ec6f45f0..7c655748 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -49,6 +49,7 @@ jobs: echo "PYTEST_REDIS_EXTERNAL=1" >> $GITHUB_ENV echo "JWT_AUTH_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJpYXQiOjE1NzEwNTk2MTgsIm5iZiI6MTU3MTA1OTYxOCwianRpIjoiNTQ2MDk2YTUtZTNmOS00NzFlLWE2NTctZWFlYTZkNzA4NmVhIiwic3ViIjoiYWRtaW4iLCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MifQ.Sfffg9oZg_Kmoq7Oe8IoTcbuagpP6nuUXOQzqJpgDfqDq_GM_4zGzt7XxByD4G0q8g4gZGHQnV14TpDer2hJXw" >> $GITHUB_ENV echo "JWT_SECRET_KEY=unittestsharedsecret" >> $GITHUB_ENV + echo "COMPOSE_COMPATIBILITY=1" >> $GITHUB_ENV # - name: Create code coverage dir # run: mkdir -p docker/coverage/ @@ -75,16 +76,16 @@ jobs: run: echo ${{ env.BRANCH_NAME }} at ${{ env.CNAAS_REPO }} - name: Build docker - run: docker-compose -f docker/docker-compose_test.yaml build --build-arg GITREPO_BASE=${{ env.CNAAS_REPO }} --build-arg BUILDBRANCH=${{ env.BRANCH_NAME }} + run: docker compose -f docker/docker-compose_test.yaml build --build-arg GITREPO_BASE=${{ env.CNAAS_REPO }} --build-arg BUILDBRANCH=${{ env.BRANCH_NAME }} - name: Start docker - run: docker-compose -f docker/docker-compose_test.yaml up -d + run: docker compose -f docker/docker-compose_test.yaml up -d - name: Install API certificates run: | docker cp ./docker/jwt-cert/public.pem docker_cnaas_api_1:/opt/cnaas/jwtcert/public.pem - docker-compose -f docker/docker-compose_test.yaml exec -u root -T cnaas_api /bin/chown -R www-data:www-data /opt/cnaas/jwtcert/ - docker-compose -f docker/docker-compose_test.yaml exec -u root -T cnaas_api /opt/cnaas/createca.sh + docker compose -f docker/docker-compose_test.yaml exec -u root -T cnaas_api /bin/chown -R www-data:www-data /opt/cnaas/jwtcert/ + docker compose -f docker/docker-compose_test.yaml exec -u root -T cnaas_api /opt/cnaas/createca.sh - name: Check running containers run: docker ps -a @@ -93,10 +94,10 @@ jobs: run: curl -ks --connect-timeout 5 --max-time 10 --retry 10 --retry-delay 5 --retry-max-time 120 https://localhost/api/v1.0/system/version - name: Fix permissions for code coverage - run: docker-compose -f docker/docker-compose_test.yaml exec -u root -T cnaas_api chown -R www-data:www-data /opt/cnaas/venv/cnaas-nms/src/ + run: docker compose -f docker/docker-compose_test.yaml exec -u root -T cnaas_api chown -R www-data:www-data /opt/cnaas/venv/cnaas-nms/src/ - name: Run unit tests in container - run: docker-compose -f docker/docker-compose_test.yaml exec -u www-data -T cnaas_api /opt/cnaas/pytest.sh + run: docker compose -f docker/docker-compose_test.yaml exec -u www-data -T cnaas_api /opt/cnaas/pytest.sh - name: Check logs if: always()