-
Notifications
You must be signed in to change notification settings - Fork 7
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
add integrationtest-sda-doa and build-sda-doa to Makefile #1305
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to move as much as possible into the .github/integration/
folder so that everything is in the same place.
While this tests DOA, full interaction with the rest of the stack will also have to be tested to ensure that all containers with a specific tag works together properly.
@@ -36,6 +36,8 @@ build-sda-sftp-inbox: | |||
@cd sda-sftp-inbox && docker build -t ghcr.io/neicnordic/sensitive-data-archive:PR$$(date +%F)-sftp-inbox . | |||
build-sda-admin: | |||
@cd sda-admin && go build | |||
build-sda-doa: | |||
@cd sda-doa && docker build -t ghcr.io/neicnordic/sensitive-data-archive:PR$$(date +%F)-sda-doa . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cd sda-doa && docker build -t ghcr.io/neicnordic/sensitive-data-archive:PR$$(date +%F)-sda-doa . | |
@cd sda-doa && docker build -t ghcr.io/neicnordic/sensitive-data-archive:PR$$(date +%F)-doa . |
In order to match the rest of the artifacts generated.
@@ -127,6 +129,8 @@ integrationtest-sda-sync-run: | |||
@PR_NUMBER=$$(date +%F) docker compose -f .github/integration/sda-sync-integration.yml run integration_test | |||
integrationtest-sda-sync-down: | |||
@PR_NUMBER=$$(date +%F) docker compose -f .github/integration/sda-sync-integration.yml down -v --remove-orphans | |||
integrationtest-sda-doa: | |||
@cd sda-doa/test/run && sh run_sda_doa_tests.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rework this to match the rest of the test suite i.e.
integrationtest-sda-doa: build-all
@PR_NUMBER=$$(date +%F) docker compose -f .github/integration/sda-doa-integration.yml run integration_test
@PR_NUMBER=$$(date +%F) docker compose -f .github/integration/sda-doa-integration.yml down -v --remove-orphans
integrationtest-sda-doa-run:
@PR_NUMBER=$$(date +%F) docker compose -f .github/integration/sda-doa-integration.yml run integration_test
integrationtest-sda-doa-down:
@PR_NUMBER=$$(date +%F) docker compose -f .github/integration/sda-doa-integration.yml down -v --remove-orphans
ports: | ||
- 8000:8000 | ||
volumes: | ||
- ../../sda-doa/test/mock_auth.py:/mock_auth.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should us the same mock-auth as the pother services, update to match if needed.
container_name: doa | ||
build: | ||
context: ../../sda-doa | ||
dockerfile: ../../sda-doa/Dockerfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dockerfile: ../../sda-doa/Dockerfile |
Implicit and should not be needed
links: | ||
- rabbitmq | ||
- postgres |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
links: | |
- rabbitmq | |
- postgres |
Handled by proper configuration.
volumes: | ||
- client_certs:/certs | ||
- ../../sda-doa/test/body.enc:/test/body.enc | ||
- ../../sda-doa/outbox:/outbox |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't write data to the repository, always use the system temp for this.
container_name: doa | ||
build: | ||
context: ../../sda-doa | ||
dockerfile: ../../sda-doa/Dockerfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dockerfile: ../../sda-doa/Dockerfile |
links: | ||
- rabbitmq | ||
- postgres |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
links: | |
- rabbitmq | |
- postgres |
- OPENID_CONFIGURATION_URL=http://mockauth:8000/openid-configuration | ||
- USERINFO_ENDPOINT_URL=http://mockauth:8000/userinfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- OPENID_CONFIGURATION_URL=http://mockauth:8000/openid-configuration | |
- USERINFO_ENDPOINT_URL=http://mockauth:8000/userinfo | |
- OPENID_CONFIGURATION_URL=http://localhost:8000/openid-configuration | |
- USERINFO_ENDPOINT_URL=http://localhost:8000/userinfo |
#!/bin/bash | ||
|
||
cd "$(dirname "$0")/../.." || exit 1 | ||
|
||
PR_NUMBER=$(date +%F) | ||
export PR_NUMBER | ||
|
||
storage_types=("posix" "s3") | ||
|
||
show_spinner() { | ||
printf "\033[33;7mStarting up services...\033[0m\n" | ||
for ((i = 0; i < 25; i++)); do | ||
for s in / - \\ \|; do | ||
printf "\r\033[33m%s\033[0m" "$s" | ||
sleep 0.1 | ||
done | ||
done | ||
echo "" | ||
} | ||
|
||
for storage_type in "${storage_types[@]}"; do | ||
printf "\033[0;35mRunning test for %s \033[0m\n" "$storage_type" | ||
docker compose -f ../.github/integration/sda-doa-"$storage_type"-outbox.yml -p sda-doa up -d | ||
show_spinner | ||
|
||
|
||
for script in "test/setup"/*.sh; do | ||
echo "Running $script..." | ||
bash "$script" | ||
done | ||
|
||
if [[ $storage_type == "posix" ]]; then | ||
export OUTBOX_TYPE="POSIX" | ||
else | ||
export OUTBOX_TYPE="S3" | ||
fi | ||
|
||
if ! mvn test; then | ||
echo "Tests failed for $storage_type. Stopping." | ||
fi | ||
|
||
docker compose -f ../.github/integration/sda-doa-"$storage_type"-outbox.yml down -v | ||
unset OUTBOX_TYPE | ||
[[ $storage_type == "posix" ]] && rm -rf outbox | ||
|
||
rm -rf test/crypt4gh | ||
done | ||
unset PR_NUMBER | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should not be needed
Related issue(s) and PR(s)
#901
Description
Testing sda doa locally is now possible. sda-doa uses libraries hosted on GitHub Packages, so make sure your settings.xml is configured with authentication.
How to test
make integrationtest-sda-doa
make build-sda-doa