Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Try to make tests pass
mederly committed Sep 28, 2018
1 parent c80f7e4 commit cb2154a
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Jenkinsfile
@@ -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) {
10 changes: 7 additions & 3 deletions demo/complex/tests/main.bats
@@ -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
}
4 changes: 2 additions & 2 deletions library.bash
@@ -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.