Skip to content

perf(ci): remove container from go, go-postgres, go-bench jobs#19743

Draft
davdhacs wants to merge 1 commit intodavdhacs/host-runner-test-fixesfrom
davdhacs/remove-container-go-tests
Draft

perf(ci): remove container from go, go-postgres, go-bench jobs#19743
davdhacs wants to merge 1 commit intodavdhacs/host-runner-test-fixesfrom
davdhacs/remove-container-go-tests

Conversation

@davdhacs
Copy link
Copy Markdown
Contributor

@davdhacs davdhacs commented Apr 1, 2026

Description

Run Go test jobs directly on ubuntu-latest instead of in the apollo-ci container image. Saves ~55s container init overhead per job and enables faster GHA cache I/O (no overlay filesystem).

Changes per job:

  • go: remove container, add setup-go + GOTOOLCHAIN=auto
  • go-postgres: remove container, switch from su postgres to docker run postgres, add readiness retry loop
  • go-bench: same as go-postgres, plus skip on PRs (if: github.event_name == 'push')

Test commands unchanged — still uses make go-unit-tests, make go-postgres-unit-tests, etc.

Stacked on #19712 (host-runner test fixes — required for tests to pass outside containers).
Split from #19678.

Testing and quality

Automated testing

  • modified existing tests

How I validated my change

CI validation. Previously validated on #19678 (combined PR).

🤖 Generated with Claude Code

Run Go test jobs directly on ubuntu-latest instead of in the CI
container image. This saves ~55s container init overhead per job
and enables faster cache I/O (no overlay filesystem).

Changes per job:
- Remove container: block
- Add actions/setup-go with GOTOOLCHAIN=auto override
- Replace su postgres with docker run postgres
- Add pg_isready retry loop (docker postgres needs warmup time)
- go-bench: skip on PRs (if: github.event_name == 'push')

Depends on #19712 (host-runner test fixes).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 1, 2026

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

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The docker run ... --name postgres in both go-postgres and go-bench jobs never stops/removes the container explicitly; consider adding a cleanup step (e.g., docker stop postgres || true) to avoid name/port conflicts on reused runners or when debugging failures.
  • The Postgres setup and readiness loop are duplicated between go-postgres and go-bench; consider extracting this into a reusable action or composite step to keep the workflow DRY and make future changes to the DB bootstrap logic less error-prone.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `docker run ... --name postgres` in both `go-postgres` and `go-bench` jobs never stops/removes the container explicitly; consider adding a cleanup step (e.g., `docker stop postgres || true`) to avoid name/port conflicts on reused runners or when debugging failures.
- The Postgres setup and readiness loop are duplicated between `go-postgres` and `go-bench`; consider extracting this into a reusable action or composite step to keep the workflow DRY and make future changes to the DB bootstrap logic less error-prone.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

davdhacs added a commit that referenced this pull request Apr 1, 2026
Split the monolithic go job into 5 shards (pkg-helm, pkg-other,
central-1, central-2, rest) and go-postgres into 2 shards
(main, migrator) for parallel execution.

Also split integration and operator tests into separate jobs
(go-integration, go-operator-integration) so they run in parallel
with unit tests instead of sequentially after them.

Depends on #19743 (container removal) and #19742 (SKIP_DEPS +
postgres subtargets).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rhacs-bot
Copy link
Copy Markdown
Contributor

Images are ready for the commit at f0fa0ff.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-529-gf0fa0ffb2e.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.59%. Comparing base (58ea483) to head (f0fa0ff).

Additional details and impacted files
@@                         Coverage Diff                         @@
##           davdhacs/host-runner-test-fixes   #19743      +/-   ##
===================================================================
- Coverage                            49.59%   49.59%   -0.01%     
===================================================================
  Files                                 2756     2756              
  Lines                               208036   208036              
===================================================================
- Hits                                103180   103179       -1     
- Misses                               97196    97197       +1     
  Partials                              7660     7660              
Flag Coverage Δ
go-unit-tests 49.59% <ø> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants