Skip to content

WIP: integration tests poc - #1314

Draft
opokornyy wants to merge 5 commits into
openshift:masterfrom
opokornyy:integration-tests-poc
Draft

WIP: integration tests poc#1314
opokornyy wants to merge 5 commits into
openshift:masterfrom
opokornyy:integration-tests-poc

Conversation

@opokornyy

@opokornyy opokornyy commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Integration tests rework POC created during shiftweek

Summary by CodeRabbit

  • New Features

    • Added a new integration test runner and commands for executing, listing, and focusing integration tests.
    • Introduced end-to-end coverage for gatherer output, anonymization, configuration toggles, and periodic data collection.
  • Documentation

    • Added planning and implementation notes for the new integration testing approach and test structure.
  • Tests

    • Added shared test utilities for archive handling, cluster access, and data-gather validation.
    • Added suite entrypoints and setup for the new integration test packages.

opokornyy added 5 commits July 3, 2026 12:36
Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 7, 2026
@openshift-ci

openshift-ci Bot commented Jul 7, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Jul 7, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: opokornyy

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

The pull request process is described 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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

📝 Walkthrough

Walkthrough

Adds a Ginkgo/OpenShift Tests Extension-based integration test framework: a new CLI entrypoint, extension registry, shared client/archive/context utilities, four gatherer test suites (basic, anonymization, config, periodic), Makefile targets, go.mod dependency updates, and two planning markdown documents.

Changes

Planning Documentation

Layer / File(s) Summary
Implementation notes and plan
INTEGRATION_TESTS_IMPLEMENTATION_NOTES.md, INTEGRATION_TESTS_PLAN.md
Documents the shared-archive testing strategy, suite organization, OTE binary structure, phased implementation plan, and verification steps.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Integration Test Framework

Layer / File(s) Summary
Dependencies
go.mod
Adds ginkgo/v2, gomega, openshift-tests-extension, and related indirect dependencies.
Extension registry and CLI entrypoint
test/integration/util/init.go, cmd/insights-operator-tests/main.go
Registers the insights-operator OTE extension with all/gatherers/controllers suites; adds a Cobra CLI wiring extension subcommands.
Build tooling
Makefile
Adds test-integration, test-integration-list, test-integration-focus targets and a legacy integration-test alias with KUBECONFIG/FOCUS validation.
Client and context initialization
test/integration/util/clients.go, test/integration/util/test_context.go
Caches Kubernetes/Insights clients and REST config; validates KUBECONFIG and provides a random-suffix helper.
Archive access and DataGather helpers
test/integration/util/archive.go
Reads/extracts archives from PVCs via a temporary pod, lists archive contents, creates PVCs, checks DataGather conditions, and waits for/validates gather completion.
Suite entrypoints
test/integration/all_test.go, test/integration/gatherers/gatherers_suite_test.go, test/integration/gatherers/doc.go
Wires Gomega fail handlers into Ginkgo suite runners and documents the gatherers package.
Basic gathering test
test/integration/gatherers/basic_test.go
Runs an all-gatherers DataGather, reads the archive, and validates output files for nodes, clusteroperators, namespaces, and clusterversion.
Anonymization test
test/integration/gatherers/anonymization_test.go
Table-driven tests validating network IP/domain obfuscation and workload-name replacement in archive contents.
Config test
test/integration/gatherers/config_test.go
Tests disabling/enabling specific gatherers and the clusterconfig gatherer as a whole, checking resulting archive contents.
Periodic test
test/integration/gatherers/periodic_test.go
Updates the insights-config interval and polls for new DataGather resources created on the expected schedule.

Estimated code review effort: 4 (Complex) | ~60 minutes

Suggested reviewers: ncaak

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Comment @coderabbitai help to get the list of available commands.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant