Debian Codegraph @

test/integration/targets/ansible-test-units-forked/runme.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 source ../collection/setup.shscip-shell source . . `../collection/setup.sh`.
4
5 set -x
6
7 options=$("${TEST_DIR}"/../ansible-test/venv-pythons.py --only-versions)
8 IFS=', ' read -r -a pythons <<< "${options}"
9
10 for python in "${pythons[@]}"; do
11 echoscip-shell system . . echo. "*** Checking Python ${python} ***"
12
13 if ansible-test units --truncate 0 --target-python "venv/${python}" "${@}" > output.log 2>&1 ; then
14 catscip-shell system . . cat. output.log
15 echoscip-shell system . . echo. "Unit tests on Python ${python} did not fail as expected. See output above."
16 exit 1
17 fi
18
19 catscip-shell system . . cat. output.log
20 echoscip-shell system . . echo. "Unit tests on Python ${python} failed as expected. See output above. Checking for expected output ..."
21
22 # Verify that the appropriate tests passed, failed or xfailed.
23 grepscip-shell system . . grep. 'PASSED tests/unit/plugins/modules/test_ansible_forked.py::test_passed' output.log
24 grepscip-shell system . . grep. 'PASSED tests/unit/plugins/modules/test_ansible_forked.py::test_warning' output.log
25 grepscip-shell system . . grep. 'XFAIL tests/unit/plugins/modules/test_ansible_forked.py::test_kill_xfail' output.log
26 grepscip-shell system . . grep. 'FAILED tests/unit/plugins/modules/test_ansible_forked.py::test_kill' output.log
27 grepscip-shell system . . grep. 'FAILED tests/unit/plugins/modules/test_ansible_forked.py::test_exception' output.log
28 grepscip-shell system . . grep. 'XFAIL tests/unit/plugins/modules/test_ansible_forked.py::test_exception_xfail' output.log
29
30 # Verify that warnings are properly surfaced.
31 grepscip-shell system . . grep. 'UserWarning: This verifies that warnings generated at test time are reported.' output.log
32 grepscip-shell system . . grep. 'UserWarning: This verifies that warnings generated during test collection are reported.' output.log
33
34 # Verify there are no unexpected warnings.
35 grepscip-shell system . . grep. 'Warning' output.log | grepscip-shell system . . grep. -v 'UserWarning: This verifies that warnings generated ' && exit 1
36
37 # Verify that details from failed tests are properly surfaced.
38 grepscip-shell system . . grep. "^Test CRASHED with exit code -9.$" output.log
39 grepscip-shell system . . grep. "^This stdout message should be reported since we're throwing an exception.$" output.log
40 grepscip-shell system . . grep. "^This stderr message should be reported since we're throwing an exception.$" output.log
41 grepscip-shell system . . grep. '^> *raise Exception("This error is expected and should be visible.")$' output.log
42 grepscip-shell system . . grep. "^E *Exception: This error is expected and should be visible.$" output.log
43
44 echoscip-shell system . . echo. "*** Done Checking Python ${python} ***"
45 done