File: run.sh

package info (click to toggle)
knot-resolver 5.7.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 14,976 kB
  • sloc: javascript: 42,732; ansic: 34,752; python: 4,225; cpp: 2,110; sh: 1,887; makefile: 199; xml: 193
file content (27 lines) | stat: -rwxr-xr-x 1,241 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
MAKEDIR="$(dirname "$0")"

pytest_uncollected_ecode=5  # https://docs.pytest.org/en/stable/reference/exit-codes.html
ci_skip_ecode=77            # https://mesonbuild.com/Unit-tests.html#skipped-tests-and-hard-errors

# Currently there no tests requiring faking monotonic time in this repository (there are some elsewhere)
# pytest returns code 5 on "no tests were run" so we just ignore it
faketime -m "" python3 -m pytest -c "${MAKEDIR}/deckard_pytest.ini" --tb=short -q ${VERBOSE:+"--log-level=DEBUG"} "${MAKEDIR}" ${DECKARDFLAGS:-} ${TESTS:+"--scenarios=${TESTS}"} -m "monotonic" --forked "$@"
MONO_RES=$?
faketime -m --exclude-monotonic "" python3 -m pytest -c "${MAKEDIR}/deckard_pytest.ini" --tb=short -q ${VERBOSE:+"--log-level=DEBUG"} "${MAKEDIR}" ${DECKARDFLAGS:-} ${TESTS:+"--scenarios=${TESTS}"} -m "not monotonic" --forked "$@"
NONMONO_RES=$?

if [ $MONO_RES -eq $pytest_uncollected_ecode -a $NONMONO_RES -eq $pytest_uncollected_ecode ]
then
    # everything seems to have been skipped
    exit $ci_skip_ecode
fi

if [ $NONMONO_RES -ne 0 -a $NONMONO_RES -ne $pytest_uncollected_ecode ]
then
    exit $NONMONO_RES
fi
if [ $MONO_RES -ne 0 -a $MONO_RES -ne $pytest_uncollected_ecode ]
then
    exit $MONO_RES
fi