Add yaml-mapper integration tests#2143
Conversation
e39cf35 to
54c555a
Compare
d6a23c8 to
0450509
Compare
b463f70 to
62cc8a0
Compare
| kubectl get nodes | ||
| helm dependency build ./charts/datadog | ||
| helm dependency build ./charts/datadog-operator | ||
| make integ-test-mapper |
There was a problem hiding this comment.
| make integ-test-mapper | |
| make integ-test-mapper-strict |
Use strict mode to require equal agent config between helm and dda agent deployments when this PR is merged
6b485e8 to
b32025a
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0341677d2c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
- update readme for datadog
- Add t.Helper() to validateExpectedPodsAgainstValues, validateExpectedPodCount,
and assertBaseValuesCoverage for correct failure attribution
- Fix assertBaseValuesCoverage to also check the inverse: fail if any values
file on disk has no matching test case in baseTestCases
- Fix applyDDAAndWaitForAgents to wait for ClusterAgent and CCR pods in
addition to DaemonSet agent pods; add ExpectedComponentPods parameter
- Use specific ExpectedErrMsg "mapping completed with" in negative test cases
instead of the generic "error"
- Equalize getHelmAgentConf and getOperatorAgentConf to both use defaultPodRetries
- Handle []interface{} in normalizeDataWithPath so nested booleans inside
list-valued config fields are normalized correctly
- Remove unused fmt import from integ_test.go
- Remove redundant test/datadog/yamlmapper/** path from workflow triggers
- Fix typo in createTestResources comment
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The yaml-mapper tests validate mapper transformation logic and agent config equivalence — neither of which is k8s-version-sensitive. Cross-version compatibility for the Helm chart and operator is already covered by go-test-operator.yaml (11 versions) and ci.yaml (kubeconform). Running 3x the jobs provided no meaningful additional coverage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Now that there is a single k8s version, replace the matrix with hardcoded values directly in the step definitions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The inverse check was failing because it only looked at baseTestCases, but the values directory also contains files referenced by testCasesWithDependencies, negativeTestCases, and TestInvalidYAMLChartInstall. Fix by building a combined set of all referenced filenames across all test slices before checking for uncovered files on disk. Extract invalidYAMLValuesFile as a constant so the hardcoded reference in TestInvalidYAMLChartInstall is included in the coverage set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- update readme for datadog
P1: Point mapper tests at the canonical mapping file in charts/datadog/files/ instead of maintaining a stale copy in the test directory. Delete the duplicate. P2: Replace local charts/datadog-operator path with the remote datadog/datadog-operator chart reference, reading the pinned version at test time from charts/datadog/requirements.yaml. This ensures CI always tests against the same operator version the chart ships. Remove the now- unnecessary helm dependency build for charts/datadog-operator from CI. Add Remote/Version fields to common.HelmCommand to support remote chart references in InstallChart without corrupting the chart path via filepath.Abs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GetFullValues was added in #2068 alongside the original mapper integration tests, but was never called after those tests were reverted and rewritten. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
766a053 to
2d6c741
Compare
- mapper.yaml.disabled: fix mapping file path, add description comment, add mapping file to trigger paths - utils.go: add license header, rename context var to avoid shadowing package, extract isEnvTruthy helper, add forceDeleteThreshold constant - helpers.go: getMappingPath logs warning on Abs failure, add duplicate checks for all test case slices - integ_test.go: remove redundant kubectlOptions param from installAndVerifyOperatorAgent - negative_test.go: use case-sensitive error assertion, remove unused strings import - common.go: require.NoError instead of require.Nil in CurrentContext Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Add test/common/** to catch changes to shared test utilities used by the yamlmapper integration tests. Keep test/datadog/** and charts/datadog/** broad to ensure regressions from any chart or test change are caught. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Document prerequisites, make targets, environment variables, and cleanup steps for running the YAML mapper integration tests locally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
What this PR does / why we need it:
Adds integration tests for the yaml-mapper binary, testing the mapping of various values.yaml configurations supported by the yaml-mapper to DDA and validating successful agent installation using the mapped DDA in kind cluster.
Validations:
Validated Helm configs:
Not tested at this time:
Agent Config diff exceptions:
Which issue this PR fixes
(optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close that issue when PR gets merged)Special notes for your reviewer:
or
make integ-test-mapperIf you exit the test early and wish to re-run the tests, you can prepend the command with
YAMLMAPPER_CLEANUP_STALE=trueto clean up resources from previous test runsChecklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
<chartName>/minor-version,<chartName>/patch-version, or<chartName>/no-version-bump)datadogordatadog-operatorchart or value changes, update the test baselines (run:make update-test-baselines)GitHub CI takes care of the below, but are still required:
.github/helm-docs.sh)CHANGELOG.mdhas been updatedREADME.md