Skip to content

TRT-2865: Add CI job to run the integration tests - #3854

Open
openshift-trt-agent[bot] wants to merge 1 commit into
openshift:mainfrom
openshift-trt:trt-2865
Open

TRT-2865: Add CI job to run the integration tests#3854
openshift-trt-agent[bot] wants to merge 1 commit into
openshift:mainfrom
openshift-trt:trt-2865

Conversation

@openshift-trt-agent

@openshift-trt-agent openshift-trt-agent Bot commented Jul 30, 2026

Copy link
Copy Markdown

Summary

Adds CI support for running integration tests as a PR requirement (TRT-2865).

The integration tests currently rely on testcontainers-go to spin up a Postgres container, which requires a container runtime (Docker/Podman) unavailable in OpenShift CI test pods. This PR adds an external Postgres mode: when SIPPY_INTEGRATION_DSN is set, tests connect to the provided Postgres instance directly, bypassing testcontainers.

Changes:

  • test/integration/util/testdb.go: Added ConnectToExternalPostgres() for CI environments where Postgres is provided as a service. Fixed template DB cleanup to handle re-runs on the same Postgres instance (unmark template before dropping).
  • test/integration/jobs_test.go: TestMain checks SIPPY_INTEGRATION_DSN env var to choose between external Postgres and testcontainers.
  • scripts/integration.sh: CI runner script (modeled after scripts/e2e.sh) that handles Postgres setup in devcontainer/host environments and runs make integration.
  • Makefile: Added ci-integration target that runs the integration script.

CI Configuration (openshift/release)

To complete this work, add a ci-operator test step in the openshift/release repo that:

  1. Runs a Postgres sidecar container (e.g., quay.io/enterprisedb/postgresql)
  2. Sets SIPPY_INTEGRATION_DSN pointing to the sidecar
  3. Runs make integration

Test plan

  • go vet ./test/integration/... passes
  • golangci-lint run ./test/integration/... passes (0 issues)
  • All 133 integration tests pass with external Postgres (SIPPY_INTEGRATION_DSN set)
  • All 133 integration tests pass via scripts/integration.sh in devcontainer
  • All 15,124 Go unit tests pass (gotestsum ./pkg/...)

Jira: https://issues.redhat.com/browse/TRT-2865


Generated with Claude Code

Add external Postgres support so integration tests can run in CI
environments where a container runtime is unavailable. When the
SIPPY_INTEGRATION_DSN env var is set, tests connect to the provided
Postgres instance instead of spinning up a testcontainer.

- Add ConnectToExternalPostgres to test/integration/util for CI use
- Add scripts/integration.sh for Postgres setup in devcontainer/host
- Add ci-integration Makefile target
- Fix template DB cleanup to handle re-runs on the same Postgres

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 30, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 30, 2026

Copy link
Copy Markdown

@openshift-trt-agent[bot]: This pull request references TRT-2865 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the spike to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

Adds CI support for running integration tests as a PR requirement (TRT-2865).

The integration tests currently rely on testcontainers-go to spin up a Postgres container, which requires a container runtime (Docker/Podman) unavailable in OpenShift CI test pods. This PR adds an external Postgres mode: when SIPPY_INTEGRATION_DSN is set, tests connect to the provided Postgres instance directly, bypassing testcontainers.

Changes:

  • test/integration/util/testdb.go: Added ConnectToExternalPostgres() for CI environments where Postgres is provided as a service. Fixed template DB cleanup to handle re-runs on the same Postgres instance (unmark template before dropping).
  • test/integration/jobs_test.go: TestMain checks SIPPY_INTEGRATION_DSN env var to choose between external Postgres and testcontainers.
  • scripts/integration.sh: CI runner script (modeled after scripts/e2e.sh) that handles Postgres setup in devcontainer/host environments and runs make integration.
  • Makefile: Added ci-integration target that runs the integration script.

CI Configuration (openshift/release)

To complete this work, add a ci-operator test step in the openshift/release repo that:

  1. Runs a Postgres sidecar container (e.g., quay.io/enterprisedb/postgresql)
  2. Sets SIPPY_INTEGRATION_DSN pointing to the sidecar
  3. Runs make integration

Test plan

  • go vet ./test/integration/... passes
  • golangci-lint run ./test/integration/... passes (0 issues)
  • All 133 integration tests pass with external Postgres (SIPPY_INTEGRATION_DSN set)
  • All 133 integration tests pass via scripts/integration.sh in devcontainer
  • All 15,124 Go unit tests pass (gotestsum ./pkg/...)

Jira: https://issues.redhat.com/browse/TRT-2865


Generated with Claude Code

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Jul 30, 2026
@openshift-ci
openshift-ci Bot requested review from dgoodwin and petr-muller July 30, 2026 17:28
@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: openshift-trt-agent[bot]
Once this PR has been reviewed and has the lgtm label, please assign xueqzhan 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

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 30, 2026
@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Hi @openshift-trt-agent[bot]. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@redhat-chai-bot

redhat-chai-bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

/close

Closing this PR — the approach did not match the intent of TRT-2865. The work will be done as a ci-operator config change in openshift/release instead.

@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: You can't close an active issue/PR unless you authored it or you are a collaborator.

Details

In response to this:

/close

Closing this PR — the approach did not match the intent of TRT-2865. The work will be done as a ci-operator config change in openshift/release instead.

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.

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

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants