Skip to content
Permalink
Browse files

Try to make tests pass

  • Loading branch information
mederly committed Sep 28, 2018
1 parent c80f7e4 commit cb2154a0eb261758e7d25d15dfd1c50db344c730
Showing with 12 additions and 8 deletions.
  1. +3 −3 Jenkinsfile
  2. +7 −3 demo/complex/tests/main.bats
  3. +2 −2 library.bash
@@ -55,9 +55,9 @@ pipeline {
sh 'bin/test.sh 2>&1 | tee debug ; test ${PIPESTATUS[0]} -eq 0'
sh 'echo Docker containers before compositions tests ; docker ps -a' // temporary

//sh '(cd demo/simple ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0'
//sh '(cd demo/shibboleth ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0'
//sh '(cd demo/complex ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0'
sh '(cd demo/simple ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0'
sh '(cd demo/shibboleth ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0'
sh '(cd demo/complex ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0'

// sh 'echo Test output ; cat debug'
} catch (error) {
@@ -4,8 +4,12 @@ load ../../../common
load ../../../library

@test "000 Cleanup before running the tests" {
cd ../shibboleth ; docker-compose down -v ; true
run docker-compose down -v
pwd > /tmp/log
echo a1 >> /tmp/log
(cd ../shibboleth ; docker-compose down -v ; sleep 60) || true
echo a2 >> /tmp/log
(docker-compose down -v ; sleep 60) || true
echo a3 >> /tmp/log
}

@test "010 Initialize and start the composition" {
@@ -67,5 +71,5 @@ load ../../../library
}

@test "999 Clean up" {
docker-compose down -v
# docker-compose down -v
}
@@ -120,14 +120,14 @@ function test_resource () {
local TMPFILE_ERR=$(mktemp /tmp/test.resource.err.XXXXXX)

curl -k --user administrator:5ecr3t -H "Content-Type: application/xml" -X POST "https://localhost:8443/midpoint/ws/rest/resources/$OID/test" >$TMPFILE || (rm $TMPFILE $TMPFILE_ERR ; return 1)
if [[ $(xmllint --xpath "*/status/text()" $TMPFILE) == "success" ]]; then
if [[ $(xmllint --xpath "/*/*[local-name()='status']/text()" $TMPFILE) == "success" ]]; then
echo "Resource $OID test succeeded"
rm $TMPFILE
return 0
else
echo "Resource $OID test failed"
cat $TMPFILE
# rm $TMPFILE
rm $TMPFILE
return 1
fi
}

0 comments on commit cb2154a

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