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

test_: unique project per run #5996

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Changes from 1 commit
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
21 changes: 14 additions & 7 deletions _assets/scripts/run_functional_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,36 @@ mkdir -p "${merged_coverage_reports_path}"
mkdir -p "${test_results_path}"

all_compose_files="-f ${root_path}/docker-compose.anvil.yml -f ${root_path}/docker-compose.test.status-go.yml"
timestamp=$(date +%s)

# Run functional tests
echo -e "${GRN}Running tests${RST}, HEAD: $(git rev-parse HEAD)"
docker-compose ${all_compose_files} up -d --build --remove-orphans
docker-compose -p ${timestamp} ${all_compose_files} up -d --build --remove-orphans
antdanchenko marked this conversation as resolved.
Show resolved Hide resolved

echo -e "${GRN}Running tests-rpc${RST}" # Follow the logs, wait for them to finish
docker-compose ${all_compose_files} logs -f tests-rpc > "${root_path}/tests-rpc.log"
docker-compose -p ${timestamp} ${all_compose_files} logs -f tests-rpc > "${root_path}/tests-rpc.log"
antdanchenko marked this conversation as resolved.
Show resolved Hide resolved

# Stop containers
echo -e "${GRN}Stopping docker containers${RST}"
docker-compose ${all_compose_files} stop
docker-compose -p ${timestamp} ${all_compose_files} stop

# Save logs
echo -e "${GRN}Saving logs${RST}"
docker-compose ${all_compose_files} logs status-go > "${root_path}/statusd.log"
docker-compose ${all_compose_files} logs status-go-no-funds > "${root_path}/statusd-no-funds.log"
docker-compose -p ${timestamp} ${all_compose_files} logs status-go > "${root_path}/statusd.log"
docker-compose -p ${timestamp} ${all_compose_files} logs status-backend > "${root_path}/status-backend.log"

if [ "$(uname)" = "Darwin" ]; then
separator="-"
else
separator="_"
fi

# Retrieve exit code
exit_code=$(docker inspect tests-functional_tests-rpc_1 -f '{{.State.ExitCode}}');
exit_code=$(docker inspect ${timestamp}${separator}tests-rpc${separator}1 -f '{{.State.ExitCode}}');

# Cleanup containers
echo -e "${GRN}Removing docker containers${RST}"
docker-compose ${all_compose_files} down
docker-compose -p ${timestamp} ${all_compose_files} down

# Collect coverage reports
echo -e "${GRN}Collecting code coverage reports${RST}"
Expand Down
Loading