mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-11-05 04:10:19 +00:00
Handle disabledTestsRegex with concatTo, as it is a Bash array under __structuredAttrs and `read -ra` only picked up its first element.
41 lines
1.1 KiB
Bash
41 lines
1.1 KiB
Bash
# Setup hook for stestr
|
|
# shellcheck shell=bash
|
|
|
|
echo "Sourcing stestr-check-hook"
|
|
|
|
function stestrCheckPhase() {
|
|
echo "Executing stestrCheckPhase"
|
|
runHook preCheck
|
|
|
|
local -a patterns=()
|
|
|
|
# Append regex pattern
|
|
concatTo patterns disabledTestsRegex
|
|
|
|
# Sanitize disabledTests options
|
|
if [[ -n "${disabledTests[*]-}" ]] || [[ -n "${disabledTestsRegex[*]-}" ]]; then
|
|
# Prevent unintentional matching for specific tests
|
|
for test in ${disabledTests[@]-}; do
|
|
patterns+=("^${test}$")
|
|
done
|
|
fi
|
|
|
|
# Compose arguments
|
|
local -a flagsArray=()
|
|
if [[ -n "${patterns[*]}" ]]; then
|
|
flagsArray+=(--exclude-regex "($(concatStringsSep "|" patterns))")
|
|
fi
|
|
|
|
concatTo flagsArray stestrFlags
|
|
echoCmd 'stestr flags' "${flagsArray[@]}"
|
|
@pythonCheckInterpreter@ -m stestr run "${flagsArray[@]}"
|
|
|
|
runHook postCheck
|
|
echo "Finished executing stestrCheckPhase"
|
|
}
|
|
|
|
if [ -z "${dontUseStestrCheck-}" ] && [ -z "${installCheckPhase-}" ]; then
|
|
echo "Using stestrCheckPhase"
|
|
appendToVar preDistPhases stestrCheckPhase
|
|
fi
|