Skip to content
Permalink
Browse files

Add some failing tests diagnostics

  • Loading branch information
mederly committed Sep 28, 2018
1 parent 57683c7 commit 8de6c1c447f518ce87e2b92926dcdefa96948b66
Showing with 13 additions and 5 deletions.
  1. +7 −5 demo/complex/tests/main.bats
  2. +6 −0 library.bash
@@ -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?)
}
@@ -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
@@ -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
}

0 comments on commit 8de6c1c

Please sign in to comment.
You can’t perform that action at this time.