Skip to content

Reenable controller tests and drop focus#2650

Merged
levan-m merged 2 commits intomainfrom
levan-m/reenable-controller-tests
Feb 25, 2026
Merged

Reenable controller tests and drop focus#2650
levan-m merged 2 commits intomainfrom
levan-m/reenable-controller-tests

Conversation

@levan-m
Copy link
Copy Markdown
Collaborator

@levan-m levan-m commented Feb 24, 2026

What does this PR do?

Drop the focus feature to reenable all tests. Tests fail with

--- FAIL: TestReconcileDatadogAgentV2_Reconcile (3.74s)
    --- FAIL: TestReconcileDatadogAgentV2_Reconcile/DCA_status_condition_should_be_deleted_when_disabled#01 (0.14s)
        controller_v2_test.go:74: 
            	Error Trace:	/home/runner/work/datadog-operator/datadog-operator/internal/controller/datadogagent/controller_v2_test.go:198
            	            				/home/runner/work/datadog-operator/datadog-operator/internal/controller/datadogagent/controller_v2_test.go:74
            	Error:      	Received unexpected error:
            	            	Object 'Kind' is missing in 'unstructured object has no kind'
            	Test:       	TestReconcileDatadogAgentV2_Reconcile/DCA_status_condition_should_be_deleted_when_disabled#01
            	Messages:   	Failed to reconcile datadogagentinternal

d9eca94 resolves the issue.

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

Write there any instructions and details you may have to test your PR.

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label
  • All commits are signed (see: signing commits)

@levan-m levan-m added this to the v1.25.0 milestone Feb 24, 2026
@levan-m levan-m requested a review from a team February 24, 2026 23:25
@levan-m levan-m requested a review from a team as a code owner February 24, 2026 23:25
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.43%. Comparing base (d57a7fb) to head (d9eca94).

Files with missing lines Patch % Lines
internal/controller/datadogagent/store/store.go 50.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2650      +/-   ##
==========================================
+ Coverage   38.26%   38.43%   +0.16%     
==========================================
  Files         305      305              
  Lines       26271    26276       +5     
==========================================
+ Hits        10053    10098      +45     
+ Misses      15459    15425      -34     
+ Partials      759      753       -6     
Flag Coverage Δ
unittests 38.43% <50.00%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
internal/controller/datadogagent/store/store.go 65.92% <50.00%> (-1.04%) ⬇️

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d57a7fb...d9eca94. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

// Try to get GVK from the listed object first (works in production)
gvk := objAPIServer.GetObjectKind().GroupVersionKind()

// If GVK is empty (e.g., in fake client tests), get it from the scheme
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! It's a test-only code path, so should be fine, but if we have different versions for a given object e.g. v1alpha1 and v2alpha1, we have no guarantee on it. Shouldn't matter once again for a test path and I don't see a clean way to guarantee the version as we can't know in advance.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a good point but yes, it's expected to affect only test fallbacks cases (single test case now) since current setup works fine in real clusters.

@levan-m levan-m merged commit e9a6dec into main Feb 25, 2026
35 checks passed
@levan-m levan-m deleted the levan-m/reenable-controller-tests branch February 25, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants