Commit 1dedc0c
Add k8s-operator unit tests to PR CI (#27387)
* Add k8s-operator unit tests to PR CI pipeline
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>
* Remove -DfailIfNoTests=false — we want to catch missing tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix k8s-operator tests: add surefire includes and remove unnecessary 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>
* Rename k8s-operator to k8s_operator in workflow outputs
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>
* Fix filesystem paths — underscore rename only applies to output keys
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>
* Drop -am flag from k8s-operator test command
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>
* Fix invalid YAML in conf/openmetadata.yaml
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>
* Build k8s-operator deps before running tests
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>
* Reintroduce lenient client mock to prevent flaky NPE
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>
* Revert conf/openmetadata.yaml — fix belongs in a separate PR
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent f4c9398 commit 1dedc0c
3 files changed
Lines changed: 74 additions & 2 deletions
File tree
- .github/workflows
- openmetadata-k8s-operator
- src/test/java/org/openmetadata/operator/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
| 64 | + | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| |||
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
124 | 176 | | |
125 | 177 | | |
126 | 178 | | |
127 | 179 | | |
128 | 180 | | |
129 | 181 | | |
130 | | - | |
| 182 | + | |
131 | 183 | | |
132 | 184 | | |
133 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
190 | 195 | | |
191 | 196 | | |
192 | 197 | | |
| |||
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
49 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
50 | 65 | | |
51 | 66 | | |
52 | 67 | | |
| |||
0 commit comments