Skip to content

Commit

Permalink
Add some failing tests diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Sep 28, 2018
1 parent 57683c7 commit 8de6c1c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 7 additions & 5 deletions demo/complex/tests/main.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ load ../../../library
@test "000 Cleanup before running the tests" {
pwd > /tmp/log
echo a1 >> /tmp/log
(cd ../shibboleth ; docker-compose down -v ; sleep 60) || true
(cd ../shibboleth ; docker-compose down -v ; sleep 1) || true
echo a2 >> /tmp/log
(docker-compose down -v ; sleep 60) || true
(docker-compose down -v ; sleep 1) || true
echo a3 >> /tmp/log
}

@test "010 Initialize and start the composition" {
docker ps -a
docker-compose up -d
docker ps -a >> /tmp/log
docker ps
! (docker ps | grep complex_midpoint-server_1)
docker-compose up -d --build
}

@test "020 Wait until components are started" {
touch $BATS_TMPDIR/not-started
wait_for_midpoint_start complex_midpoint-server_1
wait_for_midpoint_start complex_midpoint-server_1 complex_midpoint-data_1
rm $BATS_TMPDIR/not-started
# TODO wait for shibboleth, grouper-ui, (also something other?)
}
Expand Down
6 changes: 6 additions & 0 deletions library.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Waits until midPoint starts
function wait_for_midpoint_start () {
CONTAINER_NAME=$1
DATABASE_CONTAINER_NAME=$2
ATTEMPT=0
MAX_ATTEMPTS=20
DELAY=10
Expand All @@ -23,6 +24,11 @@ function wait_for_midpoint_start () {
echo "========== Container log =========="
docker logs $CONTAINER_NAME 2>&1
echo "========== End of the container log =========="
if [ -n "$DATABASE_CONTAINER_NAME" ]; then
echo "========== Container log ($DATABASE_CONTAINER_NAME) =========="
docker logs $DATABASE_CONTAINER_NAME 2>&1
echo "========== End of the container log ($DATABASE_CONTAINER_NAME) =========="
fi
return 1
}

Expand Down

0 comments on commit 8de6c1c

Please sign in to comment.