Skip to content

Remove the stale orchestrator integration test, and gate module tidiness (#907) - #914

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/907
Oct 15, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/907

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #907

Why it broke

#862 (dead-code removal, #811) deleted pkg/orchestrator, but pkg/integration/orchestrator_test.go still imported it. That file is //go:build integration, and nothing in make check or CI compiles that tag, so build, vet and test stayed green while go mod tidy failed outright. The test only covered the deleted package (LoadConfig, New, scaling decisions), plus one registry.EnsureTable call that hybrid_test.go already makes. Nothing left to port, so it is removed.

Tidy result (checked: no churn)

  • root: drops github.com/robfig/cron/v3, which only the deleted package required. Promotes github.com/spf13/pflag to direct, because cmd/flag_arity_test.go and cmd/inert_flags_test.go import it.
  • lambda/dashboard-api: drops an unused aws-sdk-go-v2/service/sqs requirement (no import of it anywhere in that module).
  • No version changes anywhere.

Gate

scripts/check-tidy.sh runs go mod tidy -diff on every go.mod in the repo. The modules are found by the same find that scripts/nested-modules.sh uses, plus the root, and the script refuses to pass if that search doesn't find ./go.mod. -diff exits non-zero in two cases: when tidy would rewrite the files, and when tidy can't run at all (the #907 case). Wired in as:

  • make check-tidy, and step 6 of make check
  • a new CI step "Module tidiness gate" (make check-tidy). CI doesn't run make check; it calls individual targets.

Watched it fail (exit 2) against each of these, then restored:

  1. the stale test put back: pkg/orchestrator: no matching versions for query "latest"
  2. main's untidy root go.mod/go.sum: diff shown
  3. an unused require appended to lambda/ttl-reaper/go.mod: diff shown

It also exits 1 when run from a directory with no modules. Clean on Go 1.27.2 and on CI's 1.26.9 (GOTOOLCHAIN=go1.26.9).

Conflict with #900

#900 hand-edits go.mod to drop // indirect from golang.org/x/term, leaving it in the indirect block. The hunks don't overlap textually. But once both are merged, go mod tidy will want to move x/term into the direct block, so this new gate will fail on whichever PR lands second. The fix is to run go mod tidy on that branch and commit the result.

Not in scope, filed

#913: the root integration_test.go has never compiled under -tags integration (undefined: config, then a wrong awsconfig.Config return type). Tidy can't catch type errors. It's left alone here because those tests launch billable instances and need a cost-safety review before they're revived.

Local make check

Everything passes except the known Docker-only TestGenerateWrapper_ChownFixesCrossUIDStickyUnlink_Docker (no Docker locally). check-nested (9 modules) and check-tidy (10 modules) were run separately and pass.

…ess (#907)

pkg/integration/orchestrator_test.go imported pkg/orchestrator, which #862
deleted as dead code (#811). The test sat behind //go:build integration, and
nothing in make check or CI compiles that tag, so build, vet and test all stayed
green while `go mod tidy` failed outright. It covered only the deleted package
(LoadConfig, New, scaling decisions) plus a registry.EnsureTable call that
hybrid_test.go already exercises, so there is nothing to port.

With tidy runnable again, the root module drops robfig/cron (required only by
the deleted package) and promotes spf13/pflag to direct (cmd tests import it).
lambda/dashboard-api drops an unused service/sqs requirement.

The gate: scripts/check-tidy.sh runs `go mod tidy -diff` over every go.mod in
the repo, discovered rather than listed, and refuses to pass if discovery misses
the root module. Tidy is the only tool here that loads every build tag, which is
why it is the one that could see this. Wired into `make check` (step 6) and CI
as `make check-tidy`. Watched it fail against the restored test, main's untidy
go.mod/go.sum, and a nested module with an unused require.

Fixes #907
@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 6f7c929 into main Oct 15, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the fix/907 branch October 15, 2026 18:26
scttfrdmn added a commit that referenced this pull request Oct 15, 2026
The root integration_test.go had not compiled since the initial release:
`config.LoadDefaultConfig` with the package imported as awsconfig, and
loadAWSConfig declared to return the awsconfig.Config interface instead of
aws.Config. Nothing in make check or CI vetted the integration tag, so it went
unseen. pkg/integration/orchestrator_test.go (#907, the deleted orchestrator)
is removed here as well, identically to #914, so the new gate passes either way.

The scheduler tests are removed. They wrote parameter_file_key/execution_time/
cron_expression items, which the scheduler has never read (it reads
s3_params_key/schedule_expression), and waited for execution to follow a
DynamoDB edit, but schedules fire from EventBridge Scheduler. Their inline param
files used a pre-defaults/params format and set no TTL. The queue tests and
the result-collection test were t.Skip placeholders. The make targets that ran
only those tests are removed.

The surviving multi-region sweep tests launch real instances and now meet the
cost-safety rule. cancelSweep passes --yes: without it, cancel prompted, read
EOF and terminated nothing. Cancel runs from a t.Cleanup registered at launch,
so a mid-test t.Fatalf can't skip it. A leak-check then polls EC2 directly in
every region the param file names, terminates anything still tagged with the
sweep ID, and fails the test. test-integration builds bin/spawn first and runs
-count=1.

scripts/check-build-tags.sh discovers custom tags from //go:build lines per
module and runs `go vet -tags <tag> ./...` for each; nothing is executed. It
fails when no tag is found anywhere, and when a tagged file was compiled by no
single-tag run (a combination such as `a && b`). Wired in as make
check-build-tags, step 6 of make check, and a CI step.
scttfrdmn added a commit that referenced this pull request Oct 15, 2026
#927)

* Make integration-tagged tests compile, and gate every build tag (#913)

The root integration_test.go had not compiled since the initial release:
`config.LoadDefaultConfig` with the package imported as awsconfig, and
loadAWSConfig declared to return the awsconfig.Config interface instead of
aws.Config. Nothing in make check or CI vetted the integration tag, so it went
unseen. pkg/integration/orchestrator_test.go (#907, the deleted orchestrator)
is removed here as well, identically to #914, so the new gate passes either way.

The scheduler tests are removed. They wrote parameter_file_key/execution_time/
cron_expression items, which the scheduler has never read (it reads
s3_params_key/schedule_expression), and waited for execution to follow a
DynamoDB edit, but schedules fire from EventBridge Scheduler. Their inline param
files used a pre-defaults/params format and set no TTL. The queue tests and
the result-collection test were t.Skip placeholders. The make targets that ran
only those tests are removed.

The surviving multi-region sweep tests launch real instances and now meet the
cost-safety rule. cancelSweep passes --yes: without it, cancel prompted, read
EOF and terminated nothing. Cancel runs from a t.Cleanup registered at launch,
so a mid-test t.Fatalf can't skip it. A leak-check then polls EC2 directly in
every region the param file names, terminates anything still tagged with the
sweep ID, and fails the test. test-integration builds bin/spawn first and runs
-count=1.

scripts/check-build-tags.sh discovers custom tags from //go:build lines per
module and runs `go vet -tags <tag> ./...` for each; nothing is executed. It
fails when no tag is found anywhere, and when a tagged file was compiled by no
single-tag run (a combination such as `a && b`). Wired in as make
check-build-tags, step 6 of make check, and a CI step.

* Consolidate CHANGELOG groups after rebase
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.

go mod tidy fails on main: pkg/integration imports nonexistent pkg/orchestrator

1 participant