diff --git a/build/docker-compose-unit_test.yml b/build/docker-compose-unit_test.yml index 889dad7..9209bdf 100644 --- a/build/docker-compose-unit_test.yml +++ b/build/docker-compose-unit_test.yml @@ -6,11 +6,10 @@ services: context: ../ dockerfile: build/Dockerfile target: test - command: sh -c "npm run test:ci && chmod -fR 777 artifacts" - volumes: - - ../artifacts:/opt/app-root/src/artifacts + command: sh -c "npm run test:ci" depends_on: - - db + db: + condition: service_healthy ports: - "9006:9006" environment: @@ -28,8 +27,9 @@ services: - POSTGRESQL_PASSWORD=remediations - POSTGRESQL_DATABASE=remediations healthcheck: - test: "psql -c 'SELECT datname FROM pg_database;'" - start_period: 3s + test: [ "CMD-SHELL", "pg_isready" ] interval: 10s + timeout: 5s + start_period: 15s retries: 6 diff --git a/unit_test.sh b/unit_test.sh index 03e817b..7afcf84 100755 --- a/unit_test.sh +++ b/unit_test.sh @@ -1,10 +1,18 @@ #!/bin/bash # run our tests... -docker-compose -f build/docker-compose-unit_test.yml up --build --exit-code-from remediations-consumer +podman-compose -f build/docker-compose-unit_test.yml up --build --exit-code-from remediations-consumer # save result... result=$? # tidy up... -docker-compose -f build/docker-compose-unit_test.yml down +podman-compose -f build/docker-compose-unit_test.yml down + +# TODO: add unittest-xml-reporting to rbac so that junit results can be parsed by jenkins +mkdir -p $WORKSPACE/artifacts +cat << EOF > $WORKSPACE/artifacts/junit-dummy.xml + + + +EOF