Skip to content

Commit

Permalink
Update test for debug option to check logs in the container
Browse files Browse the repository at this point in the history
  • Loading branch information
georgetarazevich committed Dec 14, 2023
1 parent 9b6d0ee commit b272acb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/Options/config/validator/debug.bats
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ teardown() {
@test "--debug, Outputs all processed file names, debug=true" {

run curl -F "file=@$PROJECT_ROOT/Resources/a.pdf" localhost:8080/api/validate/1b -H "Accept:text/html"
assert_output --partial "a.pdf"

[ "$status" -eq 0 ]

sleep 5 # sleep 5 sec

run docker logs $DOCKER_CONTAINER -t --since=$test_logs_starting_time
assert_output --partial "INFO: a.pdf"
}
4 changes: 4 additions & 0 deletions tests/tools/test_helper/common-setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ _common_setup() {

export DOCKER_CONTAINER=$(echo $(docker ps | grep "rest:" | awk '{print $1}'))
echo -e "\nDOCKER_CONTAINER_ID: $DOCKER_CONTAINER \n" >&3

echo "Checking docker container logs...at:" >&3
export test_logs_starting_time=$(date +%s)
echo $(date -d @"$test_logs_starting_time") >&3
}

remove_verapdf_config_files() {
Expand Down

0 comments on commit b272acb

Please sign in to comment.