forked from AtsushiSakai/PythonRobotics
-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (113 loc) · 3.51 KB
/
Copy pathci_autopsy_control_suite.yml
File metadata and controls
127 lines (113 loc) · 3.51 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: CI Autopsy Control Suite
on:
workflow_dispatch:
inputs:
case:
description: "Synthetic failure case"
required: true
type: choice
options:
- deps_pip_missing_pkg
- config_env_missing
- paths_missing_file
- env_mismatch_python
- flaky_random
- test_pytest_assert
- compile_gcc_error
- network_timeout
- cache_artifact_missing
jobs:
control:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Print context
# Always run so log has environment hints.
run: |
echo "CI_AUTOPSY_CASE=${{ inputs.case }}"
uname -a
python --version || true
node --version || true
npm --version || true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Run synthetic case
shell: bash
run: |
set -euxo pipefail
case "${{ inputs.case }}" in
deps_pip_missing_pkg)
cat > requirements.txt <<'EOF'
numpy==1.24.0
ml-ai-data-science-pro==2024.1
EOF
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
;;
config_env_missing)
python -c "import os; print(os.environ['MISSING_ENV'])"
;;
paths_missing_file)
cat ./does/not/exist.txt
;;
env_mismatch_python)
python -m pip install --upgrade pip
# Produce an explicit Requires-Python mismatch hint.
python - <<'PY'
import sys
print("python:", sys.version)
print("ERROR: Ignored the following versions that require a different python version: 1.2.3 Requires-Python >=3.7,<3.11")
raise SystemExit(1)
PY
;;
flaky_random)
# Intentionally ambiguous failure: looks flaky / timing-like.
python - <<'PY'
import time, random
time.sleep(1)
print("Random failure without a stable signature")
raise SystemExit(1)
PY
;;
test_pytest_assert)
python -m pip install --upgrade pip
python -m pip install pytest
mkdir -p tests
cat > tests/test_demo.py <<'PY'
def test_demo():
assert 1 == 2
PY
pytest -q
;;
compile_gcc_error)
sudo apt-get update
sudo apt-get install -y build-essential
cat > bad.c <<'C'
int main() {
return does_not_compile(
}
C
gcc bad.c -o bad
;;
network_timeout)
# Prefer a timeout signature (better mapping to `timeout` than "error:" noise).
# 10.255.255.1 is commonly unroutable in private networks.
curl -sS --connect-timeout 2 --max-time 3 https://10.255.255.1 || true
echo "ETIMEDOUT: transient network timeout"
exit 1
;;
cache_artifact_missing)
# Simulate common cache/artifact failure signatures.
echo "Cache not found for input keys: Linux-pip-abcdef123456"
echo "Failed to restore cache: checksum mismatch"
echo "Error: Artifact not found for name: build-logs"
exit 1
;;
*)
echo "Unknown case"
exit 2
;;
esac