mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-07 14:58:56 +00:00
fix windows ci hangs
This commit is contained in:
@@ -1,9 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
pytest_cmd=(pytest -vv ${STRESS_ARGS} \
|
pytest_args=(-vv)
|
||||||
--cov=src --cov-report=xml --cov-report=term-missing \
|
if [[ -n "${STRESS_ARGS:-}" ]]; then
|
||||||
--cov-fail-under=20 src/tests)
|
pytest_args+=(${STRESS_ARGS})
|
||||||
|
fi
|
||||||
|
if [[ "${RUNNER_OS:-}" == "Windows" ]]; then
|
||||||
|
pytest_args+=(-n 1)
|
||||||
|
fi
|
||||||
|
pytest_args+=(--cov=src --cov-report=xml --cov-report=term-missing --cov-fail-under=20 src/tests)
|
||||||
|
|
||||||
timeout_bin="timeout"
|
timeout_bin="timeout"
|
||||||
if ! command -v "$timeout_bin" >/dev/null 2>&1; then
|
if ! command -v "$timeout_bin" >/dev/null 2>&1; then
|
||||||
@@ -15,11 +20,11 @@ if ! command -v "$timeout_bin" >/dev/null 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$timeout_bin" ]]; then
|
if [[ -n "$timeout_bin" ]]; then
|
||||||
$timeout_bin 15m "${pytest_cmd[@]}" 2>&1 | tee pytest.log
|
$timeout_bin 15m pytest "${pytest_args[@]}" 2>&1 | tee pytest.log
|
||||||
status=${PIPESTATUS[0]}
|
status=${PIPESTATUS[0]}
|
||||||
else
|
else
|
||||||
echo "timeout command not found; running tests without timeout" >&2
|
echo "timeout command not found; running tests without timeout" >&2
|
||||||
"${pytest_cmd[@]}" 2>&1 | tee pytest.log
|
pytest "${pytest_args[@]}" 2>&1 | tee pytest.log
|
||||||
status=${PIPESTATUS[0]}
|
status=${PIPESTATUS[0]}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user