Skip to content

v3.2.0

Latest

Choose a tag to compare

@cloudposse-releaser cloudposse-releaser released this 11 Jul 02:22
89c34b2
fix: install-wrapper silent no-op regression Erik Osterman (Cloud Posse) (@osterman) (#115) ## what * Add a real, unmocked integration test (`wrapper-cache-integration.test.ts`) that runs the installer's actual `tc.cacheDir()` copy and then spawns the resulting `atmos` wrapper as a real child process. * Add a focused test (`wrapper-entrypoint.test.ts`) that runs the compiled `dist/wrapper/index.js` directly, isolated from the installer/tool-cache entirely. * Add a mocked-level regression guard in `setup-atmos.test.ts` for the `install-wrapper: true` fresh-install cache path. * Add an assertion to the `integration` CI job in `main.yml` so it fails if the wrapper's `stdout` output comes back empty.

why

  • Users reported that atmos terraform deploy/apply steps with install-wrapper: true complete instantly with exit code 0 and zero output — a silent no-op.
  • These new tests reproduce that exact symptom today (empty stdout, exit code 0), pinpointing the cause: dist/wrapper/index.js's if (require.main === module) entry guard evaluates to false once bundled by @vercel/ncc, so runWrapper() is never invoked in production.
  • Existing tests never caught this because wrapper.test.ts imports and calls runWrapper() directly, bypassing the guard, and the CI integration job printed wrapper output without ever asserting it was non-empty.
  • This PR is reproduction-only (per request); the actual entry-guard fix is a follow-up.

references

  • Reported in the community Slack thread about github-action-setup-atmos@v3.