nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1# Setup hook for stestr
2# shellcheck shell=bash
3
4echo "Sourcing stestr-check-hook"
5
6function stestrCheckPhase() {
7 echo "Executing stestrCheckPhase"
8 runHook preCheck
9
10 local -a patterns=()
11
12 # Append regex pattern
13 read -ra patterns <<< "$disabledTestsRegex"
14
15 # Sanitize disabledTests options
16 if [[ -n "${disabledTests[*]-}" ]] || [[ -n "${disabledTestsRegex[*]-}" ]]; then
17 # Prevent unintentional matching for specific tests
18 for test in ${disabledTests[@]-}; do
19 patterns+=("^${test}$")
20 done
21 fi
22
23 # Compose arguments
24 local -a flagsArray=()
25 if [[ -n "${patterns[*]}" ]]; then
26 flagsArray+=(--exclude-regex "($(concatStringsSep "|" patterns))")
27 fi
28
29 echoCmd 'stestr flags' "${flagsArray[@]}"
30 @pythonCheckInterpreter@ -m stestr run "${flagsArray[@]}"
31
32 runHook postCheck
33 echo "Finished executing stestrCheckPhase"
34}
35
36if [ -z "${dontUseStestrCheck-}" ] && [ -z "${installCheckPhase-}" ]; then
37 echo "Using stestrCheckPhase"
38 appendToVar preDistPhases stestrCheckPhase
39fi