Skip to content

fix(e2e): repair CGO build flag and stale test assertions#83

Merged
mrhillsman merged 4 commits into
mainfrom
fix/e2e-tests
May 23, 2026
Merged

fix(e2e): repair CGO build flag and stale test assertions#83
mrhillsman merged 4 commits into
mainfrom
fix/e2e-tests

Conversation

@mrhillsman

@mrhillsman mrhillsman commented May 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Set CGO_ENABLED=1 in the E2E test binary builder — go-sqlite3 requires CGO, and the previous CGO_ENABLED=0 produced a binary that failed to initialize the audit subsystem, breaking all 18 E2E tests
  • Fix error substring in dryrun_test.go — the workload registry returns "workload not found", not "unknown workload"
  • Update 4 cleanup assertions in cleanup_test.go and fullcycle_test.go to match structured slog JSON output ("vms_deleted":N) after the fmt.Fprintfslog migration

Resolves #82

@exe-prow-github-app
exe-prow-github-app Bot requested a review from OchiengEd May 23, 2026 18:11
@exe-prow-github-app

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mrhillsman

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

@exe-prow-github-app exe-prow-github-app Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 23, 2026
When an explicit kubeconfig path is provided (via --kubeconfig flag,
VIRTWORK_KUBECONFIG env, or KUBECONFIG env), skip in-cluster config
detection and use the explicit path directly. Previously, in-cluster
config was always attempted first, silently ignoring explicit paths
when running inside a pod.

Resolution order: --kubeconfig > VIRTWORK_KUBECONFIG > KUBECONFIG >
in-cluster service-account > ~/.kube/config.

Extract ResolveKubeconfigPath for testable env-var resolution and
configFromKubeconfig to reduce duplication.

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
Cover the explicit kubeconfig precedence chain introduced in the
previous commit: explicit path wins over env/in-cluster, KUBECONFIG
env is the fallback, and default loading rules apply when both are
absent.

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
Add a dedicated section explaining the four-step kubeconfig
resolution order and cross-reference it from the flag and
environment variable tables.

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
go-sqlite3 requires CGO; the previous CGO_ENABLED=0 produced a binary
that could not initialize the audit subsystem, failing every E2E test.

The registry returns "workload not found", not "unknown workload".

The codebase migrated from fmt.Fprintf to structured slog logging, so
cleanup output is now JSON with "vms_deleted":N rather than the old
"N VMs deleted" human-readable format. Update 4 assertions across
cleanup_test.go and fullcycle_test.go.

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
@mrhillsman
mrhillsman merged commit db0d602 into main May 23, 2026
3 of 4 checks passed
@mrhillsman
mrhillsman deleted the fix/e2e-tests branch May 24, 2026 06:15
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: E2E tests fail — CGO_ENABLED override and stale assertions after slog migration

1 participant