Skip to content

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Sep 18, 2025

Summary

Optimizes the E2E tests workflow by building the ToolHive binary only once and reusing it across all matrix jobs, significantly reducing CI execution time.

Changes

  • Added build-binary job: Creates a separate job that builds the ToolHive binary once using the existing build process
  • Binary artifact management: Uploads the built binary as an artifact with 1-day retention
  • Job dependency: Modified e2e-tests job to depend on build-binary via needs: build-binary
  • Eliminated redundant builds: Removed the "Build ToolHive binary" step from each matrix job and replaced with artifact download
  • Maintained necessary dependencies: Kept Go setup and Ginkgo CLI installation in test jobs since they're still needed

Benefits

  • Reduced build time: Instead of building the binary 3 times (once per matrix job), it's now built only once
  • Parallel execution: All three matrix jobs (core, mcp, proxy-mw) can now run in parallel after the single build completes
  • Resource optimization: Less CPU and memory usage in the CI pipeline
  • Maintained test coverage: No changes to actual test execution or coverage

Workflow Structure

Before: e2e-tests (3 parallel jobs, each building binary)
After: build-binarye2e-tests (3 parallel jobs using shared binary)

Testing

The workflow maintains the same test execution pattern and environment variables. The only change is how the binary is obtained (artifact download vs. local build).

- Add separate 'build-binary' job that builds the ToolHive binary once
- Upload binary as artifact with 1-day retention
- Modify e2e-tests job to depend on build-binary and download the artifact
- Remove redundant binary builds from each matrix job (core, mcp, proxy-mw)
- Maintain Go setup in test jobs for Ginkgo CLI installation

This optimization reduces CI time by eliminating duplicate builds while
maintaining the same test coverage across all matrix configurations.
@codecov
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.69%. Comparing base (68db7a6) to head (7bcd256).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1937   +/-   ##
=======================================
  Coverage   46.69%   46.69%           
=======================================
  Files         220      220           
  Lines       27378    27378           
=======================================
  Hits        12785    12785           
  Misses      13620    13620           
  Partials      973      973           

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

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

@JAORMX JAORMX requested review from rdimitrov and yrobla September 18, 2025 08:32
@JAORMX JAORMX merged commit ded08b4 into main Sep 18, 2025
21 checks passed
@JAORMX JAORMX deleted the optimize-e2e-workflow-binary-build branch September 18, 2025 08:44
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.

3 participants