ROX-29771: Prefactor roxctl_verification.sh#17294
Merged
Conversation
Contributor
Author
|
This change is part of the following stack: Change managed by git-spice. |
Contributor
|
Images are ready for the commit at 5d4848e. To use with deploy scripts, first |
Contributor
Author
|
/test gke-nongroovy-e2e-tests |
Contributor
|
/retest |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17294 +/- ##
==========================================
- Coverage 48.86% 48.86% -0.01%
==========================================
Files 2720 2720
Lines 203364 203364
==========================================
- Hits 99381 99374 -7
- Misses 96161 96166 +5
- Partials 7822 7824 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
13 tasks
janisz
approved these changes
Oct 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refactored
tests/yamls/roxctl_verification.shto decouple roxctl verification tests from YAML file contents, preventing brittle test failures when YAML files are modified for other purposes.Problem:
The original test used a wildcard (
*.yaml) to test all YAML files and blindly expected exactly 2 specific alerts from every file. This created tight coupling between the roxctl test and the YAML file contents:TestPods,container_instances_test), the roxctl verification test would break unexpectedlySolution:
TEST_CASESarrayAdditional Improvements:
--output jsoninstead of deprecated--jsonflag.results[].violatedPolicies[].name)#!/usr/bin/env bashfor portabilityset -euo pipefailfor safer script executionROX_PASSWORDenvironment variable support for authentication--insecure-skip-tls-verifyfallback whenCAis not providedWhy This Matters:
This refactoring prevents the common scenario where:
multi-container-pod.yamlfor a pod lifecycle testNow, the test expectations are explicit and maintainable. When a YAML file changes, the developer can immediately see and update the corresponding entry in
TEST_CASES.AI Assistance:
The core refactoring logic and test structure were generated with AI assistance. Manual corrections included: fixing bash array iteration issues, updating to the correct jq path for the new roxctl output format, adding
--insecure-skip-tls-verifysupport, and validating all test expectations against a live Central instance.User-facing documentation
Testing and quality
Automated testing
How I validated my change
Local Validation:
localhost:8443API_ENDPOINT="localhost:8443" ROX_PASSWORD="..." ./tests/yamls/roxctl_verification.sh--output json)make shell-styleto verify no style violations/bin/bashand Homebrew bash on macOSDecoupling Validation:
TEST_CASESentryCI Validation: