Skip to content

Test infrastructure (1 of 2) - #182

Merged
ajaynes-godaddy merged 3 commits into
masterfrom
poc/add-tests-infra
Oct 5, 2026
Merged

ajaynes-godaddy merged 3 commits into
masterfrom
poc/add-tests-infra

Conversation

@ajaynes-godaddy

@ajaynes-godaddy ajaynes-godaddy commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the test infrastructure needed to run a node:test-based test suite against sake: a SAKE_TEST_MODE gate so lib/sake.js can be imported outside a real plugin directory, a minimal fixture plugin directory, npm test/test:watch scripts, and a GitHub Actions workflow to run the suite on every push and pull request.

Details

No new dependencies were added — the gate, fixture, and workflow are scaffolding only. The actual test coverage built on top of this infrastructure is split out into a separate PR (#181), now rebased on top of this branch.

QA

  • Checks pass
  • npm test passes locally

Before merge

  • Checks pass

…ipts

- Guard sake.initConfig() behind a SAKE_TEST_MODE env var, since
  importing lib/sake.js otherwise calls initConfig() at module load
  time and exits the process outside a real plugin directory
- Add a minimal fixture plugin directory and a chdir helper so tests
  can exercise sake's config logic against a realistic plugin
- Add npm test and test:watch scripts, and a throwaway import-crash
  smoke check across every tasks/*.js file to prove the gate works
Runs on ubuntu-latest with actions SHA-pinned to node24-native releases
(checkout v7.0.1, setup-node v7.0.0), resolving the Node version from
package.json's existing engines field rather than hardcoding one.
@ajaynes-godaddy ajaynes-godaddy self-assigned this Oct 4, 2026
@ajaynes-godaddy ajaynes-godaddy mentioned this pull request Oct 4, 2026
2 of 4 tasks
@ajaynes-godaddy ajaynes-godaddy changed the title [PoC] Test infrastructure [PoC] Test infrastructure (1 of 2) Oct 4, 2026
ajaynes-godaddy added a commit that referenced this pull request Oct 4, 2026
Covers the logic introduced for MWC-1505: isNonInteractive()/isDryRunDeploy()/
newPluginVersion() in helpers/arguments.js, the --skip-linting gating in
compile(), the --dry-run/--non-interactive gating in deployTask(), the
--new-version fallback in replaceVersionTask(), and the non-interactive
short-circuits in promptDeployTask/promptWcUploadTask/promptTestedReleaseZipTask.

Builds on the test infrastructure merged in from PR #182 rather than
reinventing it; does not re-cover the pre-existing functions/behavior
already tested by PR #181.
@ajaynes-godaddy ajaynes-godaddy changed the title [PoC] Test infrastructure (1 of 2) Test infrastructure (1 of 2) Oct 5, 2026
Comment thread test/fixtures/plugin/composer.json Outdated
@ajaynes-godaddy
ajaynes-godaddy merged commit 2dcc54e into master Oct 5, 2026
1 check failed
@ajaynes-godaddy
ajaynes-godaddy deleted the poc/add-tests-infra branch October 5, 2026 20:57
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.

2 participants