test(oetf): KIND-safe workflow-labels scenario (D1) - #1254
Open
jiaenren wants to merge 7 commits into
Open
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
jiaenren
force-pushed
the
jiaenr/osmo-6501-d1-label-oetf
branch
from
July 30, 2026 18:25
cde9d2d to
bd4f40b
Compare
jiaenren
force-pushed
the
jiaenr/osmo-6501-d1-label-oetf
branch
from
July 30, 2026 22:31
bd4f40b to
890fb80
Compare
jiaenren
force-pushed
the
jiaenr/osmo-6501-d1-label-oetf
branch
from
July 30, 2026 23:47
890fb80 to
1048b3f
Compare
jiaenren
force-pushed
the
jiaenr/osmo-6501-d1-label-oetf
branch
from
July 31, 2026 22:02
1048b3f to
72c2698
Compare
Adds test/scenarios/workflow_labels.py, the KIND-runnable subset of the label feature verified through the OSMO API (the only channel a sandboxed OETF test has): - policy gate off/warn/enforce via validation-only submits (no rows, nothing schedules), asserting warn surfaces warnings and enforce rejects with 400 and leaves no row; - label-syntax rejection (nested value, invalid key, empty value); - list filtering by label, glob, and no_label; - one real end-to-end labeled workflow that runs to COMPLETED, whose labels survive submit -> persistence -> API surface + list filtering. Tagged `kind` so it runs in the `oetf:deploy_and_run --env kind` gate, which builds the whole stack locally and deploys it. Serial + exclusive because the policy tests mutate labels_config; each restores the baseline in tearDown, and mutation tests skip in ConfigMap mode. The heavier lifecycle and ConfigMap-fixture matrix runs on dev/Orin, not here. Based on B9 (#1227), the current stack tip, so the KIND gate validates the full label stack end to end. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Tagging a scenario `kind` is necessary but not sufficient — the KIND gate runs an explicit, cost-narrowed target-pattern allowlist (smoke + templates + mount-validation). Add //test/scenarios:workflow-labels so the label policy gate, filters, and one real labeled end-to-end run are covered on every full-stack KIND deployment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pass label/policy submit kwargs explicitly instead of **splatting a dict[str, str] into typed parameters, and narrow the rejection path with a single _expect_rejected helper (assertIsNotNone does not narrow for mypy; the try/except + self.fail idiom does). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
oetf_scenario_test runs the file as __main__ (main = src). Without an `if __name__ == "__main__": unittest.main()` block the py_test imported the module and exited 0 without executing any test method — a hollow pass. Add the standard entry point (matching every other scenario).
Three fixes found by actually running the tests on the KIND gate: - _set_policy compares only key/enforcement/allow_list; the LabelPolicy model carries extra fields (assert_message) that default in on read-back, so an exact-dict compare was wrong. - list-filter assertions use the workflow id returned by submit (which carries the "-<job>" suffix the list echoes), not the base name. - the end-to-end test asserts the label round-trip (submit -> persist -> workflow API + list filter) instead of run-to-completion: the PR-gate KIND does not run workflows to completion (only validation scenarios are gated), and pod stamping is covered by unit tests.
The label scenario is green (Ran 6 tests, OK); restore the upload step's if: failure() guard now that the diagnostic served its purpose. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jiaenren
force-pushed
the
jiaenr/osmo-6501-d1-label-oetf
branch
from
July 31, 2026 22:07
72c2698 to
dbd9d4c
Compare
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.
Summary
Issue - None
Track D1 of the workflow-labels split (from #1194). Adds the OETF label scenario, based on B9 (#1227) — the current stack tip — so its KIND gate validates the whole label stack (B5–B9) end to end.
test/scenarios/workflow_labels.pyis the KIND-safe subset, verified purely through the OSMO API (a sandboxed OETF test has no in-cluster kubeconfig):warnings, enforce rejects with 400 and leaves no row, off accepts anything;label, glob, andno_label;COMPLETED, and its labels survive submit → persistence → workflow API + list filtering.Tagged
kind, so it runs in theoetf:deploy_and_run --env kindgate (which--build-locals the whole stack and deploys it to KIND in DB mode). Serial + exclusive because the policy tests mutatelabels_config; each restores the baseline intearDown, and mutation testsskipTestin ConfigMap mode.Scope note (pod-object verification)
A literal in-cluster pod-label assertion is not reachable from the gate: OETF scenarios run via
bazel testwith onlyOETF_URL+ auth +OETF_POOLforwarded, so the test can't reach the KIND cluster with kubectl. The end-to-end test therefore verifies the label through the API (submit → run → persisted labels echoed + filterable). The actual pod stamping (apply_workflow_labels) is covered by unit tests (B4) and dev/Orin runs. A true pod-object check would need kubeconfig forwarded into the OETF test env — a small runner change we can add later if wanted.The heavier lifecycle + ConfigMap-fixture matrix (the prototype's
test_ppp_enforcement_matrix) runs on dev/Orin and is out of scope for this KIND smoke.Verification
bazel build //test/scenarios:workflow-labelsand//test/scenarios:workflow-labels-pylintpass locally.workflow_dispatch(theLocal KIND Deploymentworkflow auto-triggers only on PRs tomain; this PR is stacked on B9, so the gate is dispatched manually until the stack retargetsmain).Checklist
🤖 Generated with Claude Code