Skip to content

Srep 3019 add more e2e tests#395

Open
tkong-redhat wants to merge 2 commits intoopenshift:masterfrom
tkong-redhat:SREP-3019-add-more-e2e-test
Open

Srep 3019 add more e2e tests#395
tkong-redhat wants to merge 2 commits intoopenshift:masterfrom
tkong-redhat:SREP-3019-add-more-e2e-test

Conversation

@tkong-redhat
Copy link

@tkong-redhat tkong-redhat commented Mar 17, 2026

Adding more e2e tests for the following scenarios

  • Add tests for SplunkForwarder CR creation and reconciliation
  • Add tests for Splunk HEC endpoint connectivity (using mock endpoint)
  • Add tests for failure check and retry
  • Add tests for index configuration
  • Add tests log collection and forwarding workflow configuration

Tests have been tested locally and in e2e image. Both passed without error.

SREP-3019

Assisted by Claude code

@openshift-ci openshift-ci bot requested review from dem4gus and sam-nguyen7 March 17, 2026 06:28
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 17, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tkong-redhat
Once this PR has been reviewed and has the lgtm label, please assign bergmannf for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.44%. Comparing base (a141ee9) to head (ab6624a).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #395   +/-   ##
=======================================
  Coverage   72.44%   72.44%           
=======================================
  Files          11       11           
  Lines         704      704           
=======================================
  Hits          510      510           
  Misses        173      173           
  Partials       21       21           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

return sfv1alpha1.SplunkForwarder{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: operatorNamespace,
Copy link
Contributor

Choose a reason for hiding this comment

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

My local language server is saying that operatorNamespace is undefined, is there some e2e harness trickery going on with it?

Copy link
Author

Choose a reason for hiding this comment

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

This file and e2e test are in the same package, so they share the same global variables.
However, thanks for pointing out. I have made the namespace as a parameter for better practice. Please check.

// generateSelfSignedCACert returns a PEM-encoded self-signed CA cert for testing
// This is a minimal test certificate - sufficient for testing secret mounting
func generateSelfSignedCACert() string {
return `-----BEGIN CERTIFICATE-----
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any way to generate these dynamically with crypto/x509 or crypto/tls instead of inlining the string?

Choose a reason for hiding this comment

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

+1 or add comments about what these certs contain, when they expire, and how they can be regenerated when authoring/fixing tests.

Might also be more readable and less objectionable with the blobs in separate test-data files and read in by the function, if possible.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for review. I've updated the code to dynamically generate the certs for 1 month for tests. Those certs will be removed after tests.
Please have a look.

@tkong-redhat tkong-redhat force-pushed the SREP-3019-add-more-e2e-test branch from 06294a4 to 9c4b5d4 Compare March 19, 2026 22:58
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 20, 2026

@tkong-redhat: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants