Skip to content

Commit 501e55b

Browse files
committed
Capture Dataverse logs after test run
Adds a step to save Dataverse container logs to dv/dataverse-logs.log after unit tests complete, aiding in debugging and post-test analysis.
1 parent 57d0cda commit 501e55b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

run-tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,18 @@ done
6767

6868
# Check if "unit-test" container has failed
6969
EXIT_CODE=$(docker inspect -f '{{.State.ExitCode}}' unit-tests 2>/dev/null)
70+
7071
if [ -z "$EXIT_CODE" ]; then
7172
printf "\n❌ Unit tests container not found or failed to start\n"
7273
EXIT_CODE=1
7374
else
7475
printf "\n📋 Unit tests completed with exit code: ${EXIT_CODE}\n"
7576
fi
7677

78+
# Capture Dataverse logs after tests complete
79+
printf "\n📝 Capturing Dataverse logs...\n"
80+
docker logs dataverse > dv/dataverse-logs.log 2>&1
81+
7782
if [ "${EXIT_CODE}" -ne 0 ]; then
7883
printf "\n❌ Unit tests failed. Showing test results...\n\n"
7984
printf "=== PYTEST OUTPUT ===\n"
@@ -84,6 +89,7 @@ if [ "${EXIT_CODE}" -ne 0 ]; then
8489
docker logs unit-tests
8590
fi
8691
printf "\n=== END PYTEST OUTPUT ===\n"
92+
8793

8894
printf "\n🧹 Stopping containers...\n"
8995
docker compose \

0 commit comments

Comments
 (0)