Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHINENG-10424: Use podman-compose for compatability with rhel8 jenkins nodes #301

Merged
merged 4 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions build/docker-compose-unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

12 changes: 10 additions & 2 deletions unit_test.sh
Original file line number Diff line number Diff line change
@@ -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
<testsuite tests="1">
<testcase classname="dummy" name="dummytest"/>
</testsuite>
EOF
Loading