Repository navigation
Add short test mode to skip long-running tests - #1605
Merged
Merged
Conversation
Add support for Go's `-short` flag to skip tests taking >2 seconds. This enables faster feedback during development while preserving comprehensive testing in CI. **Changes:** - Add `SkipIfShort()` helper function in tests/preconditions.go - Add `short` field to YAML test case schema (defaults to true) - Mark 13 Go tests with `SkipIfShort()` (Git ops, vendor pulls, binary builds, Terraform, AWS SDK) - Mark 9 YAML tests with `short: false` (vendor pulls requiring network I/O) - Add `make test-short` and `make test-short-cover` targets - Update CLAUDE.md and tests/README.md with usage examples - Add AWS profile preconditions to 2 tests that require credentials **Performance:** - Quick tests: ~2m30s (skips 30+ seconds of long tests) - Full tests: ~3m+ (runs all tests including long ones) **Usage:** ```bash make test-short # Quick tests only make testacc # All tests including long ones go test -short ./... # Direct Go command ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Erik Osterman (Cloud Posse) (osterman)
requested review from
a team
as code owners
October 7, 2025 13:17
Contributor
|
Important Cloud Posse Engineering Team Review RequiredThis pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes. To expedite this process, reach out to us on Slack in the |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1605 +/- ##
==========================================
+ Coverage 63.49% 63.52% +0.02%
==========================================
Files 323 323
Lines 37061 37067 +6
==========================================
+ Hits 23533 23547 +14
+ Misses 11580 11568 -12
- Partials 1948 1952 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Andriy Knysh (aknysh)
approved these changes
Oct 7, 2025
Erik Osterman (Cloud Posse) (osterman)
added a commit
that referenced
this pull request
Oct 7, 2025
Add support for Go's `-short` flag to skip tests taking >2 seconds. This enables faster feedback during development while preserving comprehensive testing in CI. **Changes:** - Add `SkipIfShort()` helper function in tests/preconditions.go - Add `short` field to YAML test case schema (defaults to true) - Mark 13 Go tests with `SkipIfShort()` (Git ops, vendor pulls, binary builds, Terraform, AWS SDK) - Mark 9 YAML tests with `short: false` (vendor pulls requiring network I/O) - Add `make test-short` and `make test-short-cover` targets - Update CLAUDE.md and tests/README.md with usage examples - Add AWS profile preconditions to 2 tests that require credentials **Performance:** - Quick tests: ~2m30s (skips 30+ seconds of long tests) - Full tests: ~3m+ (runs all tests including long ones) **Usage:** ```bash make test-short # Quick tests only make testacc # All tests including long ones go test -short ./... # Direct Go command ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
|
These changes were released in v1.194.0. |
Erik Osterman (Cloud Posse) (osterman)
added a commit
that referenced
this pull request
Jul 11, 2026
… CLAUDE.md internal/exec/describe_affected_test.go's shared setup helpers (setupDescribeAffectedTest, setupDescribeAffectedTestWithFixture) copy the entire repo into a tempdir for each of 11 tests, and the copy's exclude filter never accounted for this repo's own gitignored build output (build/, custom-gcl, website/build - ~820MB combined), nor did these tests respect the testing.Short() convention the rest of the package already uses (introduced in #1605). Add a short-mode skip to both helpers and extend the exclude filter to skip those three paths. Measured: `go test ./internal/exec/...` 178s (was ~600s), `go test -short ./internal/exec/...` ~60s. CLAUDE.md's "Essential Commands"/"Testing"/"Pre-commit"/"Compilation" sections were accidentally reverted from atmos custom commands back to the old, now-dead `make ...` targets (which just print a migration notice and exit 1) by an unrelated PR. Restore the correct `atmos build`/`atmos test`/`atmos test --full`/ `atmos test --coverage`/`atmos lint --changed` references (verified against .atmos.d/test.yaml and .atmos.d/lint.yaml), and change the mandatory post-change check from an unscoped `go test ./...` to short-mode `atmos test`. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Andriy Knysh (aknysh)
added a commit
that referenced
this pull request
Jul 12, 2026
#2715) * feat(vendor): add vendor update/diff, archived-repo detection, component.yaml support Closes the guess-and-hand-edit workflow for bumping vendored components: `atmos vendor update` checks Git-backed sources for newer versions (honoring semver constraints) and writes the new version in place via the format-preserving pkg/yaml engine, and `atmos vendor diff` shows the diff between two versions with no local checkout. Both now work against per-component component.yaml manifests (not just vendor.yaml), detect archived upstream repos, respect vendor.base_path/--chdir, and gained a spinner/progress UI with a tabular update report. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(vendor): address CodeRabbit review findings on vendor update/diff PR - Guard against a nil UpdateReport before calling UpdatedCount(): reachable when the user quits the spinner (keypress) before the background update finishes, which previously panicked with --pull set. - Reset --stack/--tags before delegating to `vendor pull` on the single-component --pull path, matching the repo-wide path, so they don't trip validateVendorFlags' component/stack and component/tags exclusivity. - Wrap ExecuteComponentVendorPullBatch's per-component resolution errors with the failing component's name so multi-component --pull failures are debuggable. - Split the spinner's progress/done channel so a still-buffered progress message can no longer cause the terminal updateDoneMsg to be dropped, which hung the spinner forever waiting on a message that would never arrive. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(vendor): fix CI acceptance test failures on vendor update/diff PR - atmos_vendor_pull: a PTY opened without Setsize (as the acceptance test harness's simulateTtyCommand does) reports size 0x0. maskedWriter.Fd() (this PR's own pkg/io/streams.go change) makes bubbletea's WindowSizeMsg reach the vendor-pull spinner again, and its handler was unconditionally adopting that 0x0, overwriting the already-correct fallback width and truncating "Pulling <name>" down to a bare ellipsis for the whole run. Guard both initialModelWidth and the WindowSizeMsg handler against non-positive widths, with a regression test reproducing the exact failure. - atmos_toolchain_info_shows_atmos-inline_registry / raw_format_tool: this PR's indicator-column width fix (cmd/version/formatters.go, pkg/toolchain/info.go) legitimately changes table column widths; regenerate only the affected table rows in the two golden snapshots. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * test(vendor): raise patch coverage on vendor update/diff PR, fix mixin-failure summary bug Coverage additions target this PR's actual diff (verified against `git diff origin/main` line ranges, not whole-file coverage): - cmd/vendor/update_spinner.go: Init/Update/waitForUpdateMsg (0% -> 100%) and runUpdateWithSpinner's TTY branch (12% -> 88%), driven directly as a bubbletea tea.Model plus one real-PTY end-to-end test. - cmd/vendor/update.go: single-component runVendorPull path, resetUnchangedFlag, and the typeChanged branch. - pkg/vendoring/resolve.go: DefaultComponentDirResolver's real (non-fake) path, VendorFilePresent's remaining branches, notFoundError, and DiscoverComponentManifests/DiscoverAllComponentManifests error paths. - internal/exec/vendor_component_utils.go: ExecuteComponentVendorInternal (previously untested directly) and buildComponentVendorPackages' template/ mixin error branches. - pkg/vendoring/update.go, archived.go, pkg/io/streams.go, cmd/vendor/update_report.go: remaining small diff-relevant gaps. Also fixes a real bug found while extending vendor_model_test.go's mixin coverage: a mixin-only failure (component itself succeeds) rendered as "Failed to vendor 0 components" in both the TTY and non-TTY summaries, indistinguishable from full success even though vendorFailureError still fails the command. Both summaries now say so explicitly ("Failed to vendor N mixins"). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(vendor): batch component.yaml pulls by component type, not just basename partitionUpdatedResults grouped every component.yaml-declared update into one ExecuteComponentVendorPullBatch call regardless of type, but DiscoverAllComponentManifests' repo-wide sweep (no explicit --type) can mix terraform/helmfile/packer updates in a single report. Forwarding a mixed batch under one componentType resolved non-matching types under the wrong components/<type>/<name> path. Thread ComponentType through ResolvedSource and SourceUpdateResult (set by ResolveComponentSource's component.yaml fallback and DiscoverComponentManifests/DiscoverAllComponentManifests, empty for vendor.yaml-declared sources) and group the batch by it, calling ExecuteComponentVendorPullBatch once per type. Added a regression test (TestRunVendorPull_BatchesByComponentType) that reproduces the wrong-path failure without the fix and passes with it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * perf(test): skip full-repo copy in short mode; fix stale make refs in CLAUDE.md internal/exec/describe_affected_test.go's shared setup helpers (setupDescribeAffectedTest, setupDescribeAffectedTestWithFixture) copy the entire repo into a tempdir for each of 11 tests, and the copy's exclude filter never accounted for this repo's own gitignored build output (build/, custom-gcl, website/build - ~820MB combined), nor did these tests respect the testing.Short() convention the rest of the package already uses (introduced in #1605). Add a short-mode skip to both helpers and extend the exclude filter to skip those three paths. Measured: `go test ./internal/exec/...` 178s (was ~600s), `go test -short ./internal/exec/...` ~60s. CLAUDE.md's "Essential Commands"/"Testing"/"Pre-commit"/"Compilation" sections were accidentally reverted from atmos custom commands back to the old, now-dead `make ...` targets (which just print a migration notice and exit 1) by an unrelated PR. Restore the correct `atmos build`/`atmos test`/`atmos test --full`/ `atmos test --coverage`/`atmos lint --changed` references (verified against .atmos.d/test.yaml and .atmos.d/lint.yaml), and change the mandatory post-change check from an unscoped `go test ./...` to short-mode `atmos test`. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(vendor): skip two new tests on Windows for platform-specific behavior - TestRunUpdateWithSpinner_TTY_RunsSpinnerAndReturnsResult: creack/pty.Open() returns "unsupported" on Windows, matching the existing PTY-skip precedent in pkg/io/streams_test.go. - TestDiscoverComponentManifests_BasePathIsAFile: os.ReadDir on a regular file path doesn't return an error on Windows (unlike ENOTDIR on Unix), so the test's premise doesn't hold there. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(docs): fix broken floci.io link in quick-start-advanced README examples/quick-start-advanced/README.md linked https://floci.io/ for Floci, which now 404s. Every other Floci reference in the repo (docs/prd/emulators.md, examples/terraform-tests/README.md, examples/emulator-aws/README.md) already points at https://github.com/floci-io/floci; fix the one inconsistent link to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Andriy Knysh <aknysh@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
-shortflag to skip long-running tests (>2 seconds)SkipIfShort()helper function for Go testsshortfield to YAML test case schema (defaults totrue)make test-shortandmake test-short-coverMakefile targetswhy
-shortflag convention for test skippingPerformance Impact
Before: Full test suite only (~3+ minutes)
After:
make test-short): ~2m30s (skips 30+ seconds of slow tests)make testacc): ~3m+ (runs everything including slow tests)Changes by Category
Go Tests Marked Long (13 tests)
TestDescribeAffectedWithTargetRefClone(36s - Git cloning)TestExecuteAtlantisGenerateRepoConfigAffectedOnly(21s - Git ops)TestExecuteTerraformAffectedWithDependents(26s - Git + Terraform)TestVendorComponentPullCommand(6s)TestVendorPullFullWorkflow(network + OCI)TestVendorPullBasicExecution(4s)TestAssumeRoleIdentity_newSTSClient_RegionFallbackAndPersistTestPermissionSetIdentity_newSSOClient_SuccessYAML Tests Marked Long (9 tests)
All vendor pull tests requiring network I/O:
tests/test-cases/vendor-test.yaml(2 tests)tests/test-cases/demo-vendoring.yaml(2 tests)tests/test-cases/demo-globs.yaml(1 test)tests/test-cases/vendoring-ssh-dryrun.yaml(3 tests)Infrastructure
tests.SkipIfShort(t)intests/preconditions.goshortfield totests/test-cases/schema.jsontests/cli_test.goto check short mode before running teststest-shortandtest-short-coverCLAUDE.mdandtests/README.mdTesting
Usage
references
tests/preconditions.go🤖 Generated with Claude Code