Debian Codegraph @

test/integration/targets/ansible-test-sanity-lint/runme.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2 # Make sure that `ansible-test sanity --lint` outputs the correct format to stdout, even when delegation is used.
3
4 set -eu
5
6 # Create test scenarios at runtime that do not pass sanity tests.
7 # This avoids the need to create ignore entries for the tests.
8
9 mkdirscip-shell system . . mkdir. -p ansible_collections/ns/col/plugins/modules
10
11 (
12 cd ansible_collections/ns/col/plugins/modules
13
14 echoscip-shell system . . echo. '#!invalid' > python-wrong-shebang.py # expected module shebang "b'#!/usr/bin/python'" but found: b'#!invalid'
15 )
16
17 source ../collection/setup.shscip-shell source . . `../collection/setup.sh`.
18
19 set -x
20
21 ###
22 ### Run the sanity test with the `--lint` option.
23 ###
24
25 # Use the `--venv` option to verify that delegation preserves the output streams.
26 ansible-test sanity --test shebang --color --failure-ok --lint --venv "${@}" 1> actual-stdout.txt 2> actual-stderr.txt
27 diffscip-shell system . . diff. -u "${TEST_DIR}/expected.txt" actual-stdout.txt
28 grepscip-shell system . . grep. -f "${TEST_DIR}/expected.txt" actual-stderr.txt
29
30 # Run without delegation to verify direct output uses the correct streams.
31 ansible-test sanity --test shebang --color --failure-ok --lint "${@}" 1> actual-stdout.txt 2> actual-stderr.txt
32 diffscip-shell system . . diff. -u "${TEST_DIR}/expected.txt" actual-stdout.txt
33 grepscip-shell system . . grep. -f "${TEST_DIR}/expected.txt" actual-stderr.txt
34
35 ###
36 ### Run the sanity test without the `--lint` option.
37 ###
38
39 # Use the `--venv` option to verify that delegation preserves the output streams.
40 ansible-test sanity --test shebang --color --failure-ok --venv "${@}" 1> actual-stdout.txt 2> actual-stderr.txt
41 grepscip-shell system . . grep. -f "${TEST_DIR}/expected.txt" actual-stdout.txt
42 [scip-shell system . . `[`. ! -s actual-stderr.txt ]
43
44 # Run without delegation to verify direct output uses the correct streams.
45 ansible-test sanity --test shebang --color --failure-ok "${@}" 1> actual-stdout.txt 2> actual-stderr.txt
46 grepscip-shell system . . grep. -f "${TEST_DIR}/expected.txt" actual-stdout.txt
47 [scip-shell system . . `[`. ! -s actual-stderr.txt ]