Conversation
The k8s operator tests only ran during manual release builds. Add a path-filtered job so they run on PRs touching openmetadata-k8s-operator/**, following the same Detect Changes pattern used by the service unit tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a path-filtered CI job to run openmetadata-k8s-operator unit tests on pull requests that touch operator code, aligning it with the existing “Detect Changes” gating used for service unit tests.
Changes:
- Extend the
changesjob path filters to detect modifications underopenmetadata-k8s-operator/**. - Add a new
k8s-operator-unit-testsjob to run Maven tests for the operator module and publish surefire reports. - Include the new job in the workflow’s required-check gate job dependencies.
…stub Parent POM surefire includes only match org.openmetadata.service.*, so operator tests under org.openmetadata.operator.* were silently skipped. Override with **/*Test.java in the operator pom.xml. Also remove unused KubernetesClient mock stub from CronOMJobReconcilerTest.setUp — no test reaches the code path that calls context.getClient(), causing UnnecessaryStubbingException. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hyphens in output names are parsed as subtraction in GitHub Actions expressions dot notation, so the job condition would never trigger. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The replace_all incorrectly changed directory names from openmetadata-k8s-operator to openmetadata-k8s_operator. Only the GitHub Actions output key needs the underscore; all file paths must use the actual hyphenated directory name. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
openmetadata-service is a provided-scope dependency, so -am tries to compile it including shaded ES/OS jars that aren't available in a clean CI environment. The operator module compiles fine on its own. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The CSP policy line has unescaped colons inside the value which the YAML parser interprets as mapping indicators. Use a folded block scalar (>-) so the value is parsed as a plain string. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The operator depends on openmetadata-service (provided scope) which won't be in the Maven cache on a cold CI runner. Build with -am -DskipTests first, then run operator tests separately — same pattern as docker-k8s-operator.yml. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The reconcile flow is time-dependent — tests using "0 * * * *" can reach context.getClient() near the top of the hour. Stub the full client.resources().inNamespace().resource().create() chain as lenient so early-return tests aren't penalized but happy-path tests won't NPE. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code Review ✅ Approved 2 resolved / 2 findingsUnit tests for the k8s-operator are now integrated into PR CI, with the path filtering naming and build caching logic addressed. ✅ 2 resolved✅ Bug: Path filter uses wrong directory name (underscore vs hyphen)
✅ Bug: Removing -am may break build when openmetadata-service is not cached
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
🟡 Playwright Results — all passed (25 flaky)✅ 3631 passed · ❌ 0 failed · 🟡 25 flaky · ⏭️ 84 skipped
🟡 25 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Summary
k8s-operator-unit-testsjob to the service unit tests workflowopenmetadata-k8s-operator/**docker-k8s-operator.yml)Test plan
🤖 Generated with Claude Code