Commit 901d102
OCPBUGS-66219: fix: kubernetes/conformance suite execution from list and failure propagation (#82)
## Summary
This PR implements two critical fixes for OCP 4.20+ compatibility and
improved CI efficiency:
1. Failure propagation mechanism to stop dependent plugins when
prerequisites fail
2. Support for consuming extracted Kubernetes conformance tests from
init container
## Changes
### 1. Failure Propagation (plugin.go)
**Problem**: When a conformance plugin fails, subsequent dependent
plugins continue running and waste execution time on tests that cannot
succeed.
**Solution**: Added failure detection in `RunDependencyWaiter()` that:
- Checks if blocker plugin status is "failed"
- Returns error to stop dependent plugin execution
- Exception: Plugin 99 (artifacts-collector) always runs to collect logs
**Code change** (`openshift-tests-plugin/pkg/plugin/plugin.go:714-719`):
```go
// Check if the blocker plugin failed and propagate failure to dependent plugins
// Exception: artifacts collector (99-openshift-artifacts-collector) should always run
if pStatusBlocker.Status == "failed" && p.ID() != PluginId99 {
log.Errorf("Blocker plugin[%s] failed. Propagating failure to dependent plugin[%s]", pluginBlocker, p.Name())
return fmt.Errorf("blocker plugin %s failed, stopping execution of dependent plugin %s", pluginBlocker, p.Name())
}
```
**Failure propagation chain**:
- 05 (upgrade) → blocks → 10 (kube-conformance)
- 10 (kube-conformance) → blocks → 20 (conformance-validated)
- 20 (conformance-validated) → blocks → 80 (replay)
- 80 (replay) → blocks → 99 (artifacts-collector)
### 2. Kubernetes Conformance Test Extraction (entrypoint-tests.sh)
**Problem**: OCP 4.20+ removed the `kubernetes/conformance` suite from
openshift-tests.
**Solution**: Added logic to consume extracted test list from init
container:
- Checks for `/tmp/shared/k8s-conformance-tests.list` (created by init
container in opct repo)
- Uses extracted tests if available and non-empty
- Falls back to default suite if extraction fails or file is missing
**Code change**
(`openshift-tests-plugin/plugin/entrypoint-tests.sh:59-76`):
```bash
# Check if we have extracted k8s conformance tests from OTE
K8S_CONFORMANCE_LIST="/tmp/shared/k8s-conformance-tests.list"
if [[ "${PLUGIN_NAME:-}" == "openshift-kube-conformance" ]] && [[ -f "${K8S_CONFORMANCE_LIST}" ]]; then
TEST_COUNT=$(wc -l < "${K8S_CONFORMANCE_LIST}")
if [[ $TEST_COUNT -gt 0 ]]; then
echo "Using extracted Kubernetes conformance tests from OTE (${TEST_COUNT} tests)"
cp "${K8S_CONFORMANCE_LIST}" "${CTRL_SUITE_LIST}"
echo "Tests extracted from k8s-tests-ext binary" > ${CTRL_SUITE_LIST}.log
else
# Fallback to default suite
fi
fi
```
## Benefits
1. **Improved CI efficiency**: Stops wasted execution time on dependent
tests
2. **Clearer failure signals**: Failed prerequisites immediately
propagate
3. **OCP 4.20+ support**: Works with extracted conformance tests
4. **Backward compatible**: Falls back gracefully on older versions
5. **Cleaner code**: Uses plugin ID instead of name/alias checks
## Related PRs
- OPCT PR: redhat-openshift-ecosystem/opct#183
- Adds init container to extract k8s conformance tests from OTE
## Testing
Validated with CI rehearsal jobs on OCP 4.20+ clusters.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>1 parent e846623 commit 901d102
File tree
4 files changed
+388
-9
lines changed- openshift-tests-plugin
- pkg/plugin
- plugin
4 files changed
+388
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
| |||
193 | 196 | | |
194 | 197 | | |
195 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
196 | 213 | | |
197 | 214 | | |
198 | 215 | | |
| |||
476 | 493 | | |
477 | 494 | | |
478 | 495 | | |
| 496 | + | |
479 | 497 | | |
480 | 498 | | |
481 | 499 | | |
482 | 500 | | |
483 | 501 | | |
| 502 | + | |
484 | 503 | | |
485 | 504 | | |
486 | 505 | | |
| |||
511 | 530 | | |
512 | 531 | | |
513 | 532 | | |
| 533 | + | |
| 534 | + | |
514 | 535 | | |
515 | 536 | | |
516 | 537 | | |
| |||
521 | 542 | | |
522 | 543 | | |
523 | 544 | | |
524 | | - | |
525 | | - | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
526 | 549 | | |
527 | 550 | | |
528 | 551 | | |
| |||
623 | 646 | | |
624 | 647 | | |
625 | 648 | | |
| 649 | + | |
626 | 650 | | |
627 | 651 | | |
628 | 652 | | |
| |||
710 | 734 | | |
711 | 735 | | |
712 | 736 | | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
713 | 745 | | |
714 | 746 | | |
715 | 747 | | |
| |||
0 commit comments