|
251 | 251 | set -o pipefail |
252 | 252 | : > {{ openstack_test_log_path }} |
253 | 253 | py_exit=0 |
254 | | - expected=0 |
255 | 254 | resolve="{{ openstack_test_ote_resolve_script }}" |
| 255 | + # Pre-count from the list file (do not increment in-loop; in-loop |
| 256 | + # expected stays wrong under /bin/sh and false-fails |
| 257 | + # resolvable!=expected after a clean LB serial run; same fix as coda). |
| 258 | + expected="$(grep -cve '^[[:space:]]*$' {{ tests_to_run_path }} || true)" |
| 259 | + if [ "${expected:-0}" -eq 0 ]; then |
| 260 | + echo "ote serial: empty filtered test list (expected=0); failing" |
| 261 | + exit 1 |
| 262 | + fi |
256 | 263 | while IFS= read -r test || [[ -n "$test" ]]; do |
257 | 264 | [[ -z "${test// }" ]] && continue |
258 | | - expected=$((expected + 1)) |
259 | 265 | tmp=$(mktemp) |
260 | 266 | # OTE often exits non-zero on pass/skip (Deserializaion Error on |
261 | 267 | # leading I... klog). Ignore per-test rc; end-of-suite resolver is |
|
265 | 271 | cat "$tmp" >> {{ openstack_test_log_path }} |
266 | 272 | rm -f "$tmp" |
267 | 273 | done < {{ tests_to_run_path }} |
268 | | - if [ "$expected" -eq 0 ]; then |
269 | | - echo "ote serial: empty filtered test list (expected=0); failing" |
270 | | - exit 1 |
271 | | - fi |
272 | 274 | python3 "$resolve" junit \ |
273 | 275 | "{{ openstack_test_log_path }}" "{{ openstack_test_junit_path }}" || py_exit=$? |
274 | 276 | failed_count=$(python3 "$resolve" count \ |
|
539 | 541 | must_gather_suffix: "openstack-tests" |
540 | 542 | when: (number_of_failed_tests | default('0')) | int > 0 |
541 | 543 |
|
| 544 | + # Hard-fail incomplete/inflated resolve so block/rescue cannot soft-recover |
| 545 | + # a resolvable!=expected gate miss (UNSTABLE alone still clears the block). |
| 546 | + - name: Fail when OTE resolvable count does not match expected |
| 547 | + ansible.builtin.fail: |
| 548 | + msg: >- |
| 549 | + openstack-test resolvable={{ number_of_resolvable_tests | default('0') }} |
| 550 | + != expected={{ number_of_expected_tests | default('0') }} |
| 551 | + (incomplete or inflated resolve; cannot soft-recover) |
| 552 | + when: |
| 553 | + - openstack_test_use_ote | bool |
| 554 | + - > |
| 555 | + (number_of_resolvable_tests | default('0')) | int |
| 556 | + != (number_of_expected_tests | default('0')) | int |
| 557 | +
|
542 | 558 | # Serial coda after the main batch (or filtered serial) suite. |
543 | 559 | - name: Run serial-coda tests after main suite |
544 | 560 | ansible.builtin.include_tasks: run_machines_leak_cluster_serial.yml |
|
0 commit comments