Skip to content

[V2] Add GitHub Actions workflow for Go unit tests#6999

Open
pingsutw wants to merge 6 commits intov2from
init-ci
Open

[V2] Add GitHub Actions workflow for Go unit tests#6999
pingsutw wants to merge 6 commits intov2from
init-ci

Conversation

@pingsutw
Copy link
Member

@pingsutw pingsutw commented Mar 9, 2026

Why are the changes needed?

The Flyte repository currently has no CI workflow for running Go unit tests. There's check-generate.yml for generated file validation and build-ci-image.yml for Docker image builds, but no actual test execution on PRs.

What changes were proposed in this pull request?

Add a new GitHub Actions workflow (.github/workflows/go-tests.yml) that runs Go unit tests across all 9 components in parallel using a matrix strategy:

Component Test Files Notes
flyteplugins 88 Standard go test
flytestdlib 74 Standard go test
runs 12 Excludes test/ dir (integration tests)
executor 6 Needs envtest for controller tests
flytecopilot 5 Standard go test
dataproxy 3 Standard go test
flyteidl2 2 Standard go test
actions 2 Standard go test
manager 1 Standard go test

Key design decisions:

  • Uses actions/setup-go@v5 with Go 1.24 (matching go.mod) instead of the Docker CI image
  • Race detector and coverage enabled for all components
  • Envtest setup for executor controller tests (version pinned to controller-runtime dependency)
  • Integration/e2e tests excluded (runs/test, executor/e2e)
  • Concurrency control to cancel superseded runs on the same PR

How was this patch tested?

  • YAML syntax validated
  • Verified all 9 component directories exist and contain the expected number of test files
  • Envtest setup matches the pattern used in executor/Makefile

Labels

  • added: New CI workflow for Go unit tests

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Run Go tests in parallel across 9 components (flyteplugins, flytestdlib,
runs, executor, flytecopilot, dataproxy, flyteidl2, actions, manager)
on PRs and pushes to v2/main. Includes envtest setup for executor
controller tests and excludes integration/e2e test directories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
@pingsutw pingsutw changed the title Add GitHub Actions workflow for Go unit tests [V2] Add GitHub Actions workflow for Go unit tests Mar 9, 2026
@pingsutw pingsutw marked this pull request as draft March 9, 2026 22:45
@pingsutw pingsutw self-assigned this Mar 9, 2026
@pingsutw pingsutw added the flyte2 label Mar 9, 2026
@github-actions github-actions bot mentioned this pull request Mar 9, 2026
3 tasks
pingsutw and others added 5 commits March 9, 2026 15:47
The executor/e2e directory doesn't exist — the grep -v /e2e was copied
from the kubebuilder-scaffolded Makefile but serves no purpose here.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
- flytestdlib: Update semconv import from v1.24.0 to v1.34.0 to match
  OTel SDK version, fixing schema URL conflict in resource merge
- flyteplugins: Return pointer types from mock methods to match
  interface signatures (TaskExecutionIdentifier, SecurityContext)
- runs: Rename stale QueueServiceURL to ActionsServiceURL in config
  test, fix time.Now() race in CreateTask by capturing once
- executor: Add required taskType and taskTemplate fields to test
  fixture to satisfy CRD validation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
- Remove dead code (initConfig, run functions) from executor/cmd/main.go
  that referenced undefined symbols (cobra, tls, setupLog, etc.) left
  over from pre-refactor kubebuilder scaffold
- Provide PluginRegistry and FakeRecorder to controller test so
  Reconcile can execute without panicking on nil fields; the reconciler
  sets a Failed condition when no plugin is found for the task type

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Set up a real controller-runtime Manager, initialize the plugin registry
with the pod plugin (via blank import), create an in-memory DataStore,
and use a proper protobuf-serialized TaskTemplate with a container spec.
The test now exercises the full Reconcile → plugin Handle path, verifying
that the pod plugin creates a Pod and sets status conditions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
The labeled metrics package panics if metrics are created before
SetMetricKeys is called. Initialize with project/domain keys before
creating the in-memory DataStore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
@pingsutw pingsutw marked this pull request as ready for review March 10, 2026 00:51
@pingsutw pingsutw added this to the V2 GA milestone Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant