Skip to content

test(e2e): cover CLI, config, runtime, plugin lifecycle, app and dev-server flows - #858

Open
chetan2002 wants to merge 2 commits into
adobe:masterfrom
chetan2002:e2e-command-coverage
Open

chetan2002 wants to merge 2 commits into
adobe:masterfrom
chetan2002:e2e-command-coverage

Conversation

@chetan2002

@chetan2002 chetan2002 commented Nov 30, 2026 •

Copy link
Copy Markdown

Description

Depends on #857. Until #857 merges, this diff also shows its commit. Review only the last commit.

Adds 35 e2e tests (40 in total, up from 5). They run the real bin/run with a temporary home, config, data and cache directory, ignore AIO_*/WSK_* variables from the shell, and need no Adobe login.

Suite Tests Covers
cli.e2e.js 12 --version/-v, help, the rt alias, unknown commands, aio info, telemetry off/on, the update notice, autocomplete and bash completion
config.e2e.js 6 global/local precedence, .env and env var overrides, config list/set --file, aio where, aio console where, aio auth ctx
runtime.e2e.js 2 rt property set/get/unset, the no-credentials error
plugins.e2e.js 2 link, install, run, help, completion, rollback and uninstall of a fixture plugin
app.e2e.js 10 app init per linter, app info, app add/delete ci, app delete action, app build (runs the built zip), app pack (excludes .aio and .env), app dev (HTTP 200/404, hot reload, Ctrl+C)
network.e2e.js 3 discover (filter and sort) and update --list against the npm registry

load-commands.js now also renders help for all 213 bundled commands. npm run e2e now runs e2e/e2e.js and every e2e/*.e2e.js file. CONTRIBUTING.md lists the suites.

Related Issue

No issue. Follow-up to #857.

Motivation and Context

Before this PR, e2e did not run aio info, help, autocomplete, plugins install, rollback, app build, app pack or app dev. A dependency update that broke any of them would not have failed CI.

Found while writing the tests. These are upstream plugin bugs, not fixed here:

  1. aio-cli-plugin-runtime 8.5.0: rt property set fails with properties.set is not a function when ~/.wskprops does not exist. The test creates the file first.
  2. aio-cli-plugin-runtime 8.5.0: rt property set --apihost <url> fails with Unexpected argument, because --apihost is a boolean flag.
  3. aio-cli-plugin-app 14.10.0: app delete action my.app/generic deletes the code but leaves the app.config.yaml entry when the package name contains a dot.

How Has This Been Tested?

Check Result
npm run e2e -- --ci --runInBand on Node 20.17.0, 22.23.4, 24.22.3 (macOS) 40/40 passed on each, about 3 minutes
app dev test run 5 times in a row 5/5 passed
Runtime suite with WSK_CONFIG_FILE pointing at another .wskprops passed; that file was not changed
app dev requests TLS is verified against the test's own certificate for localhost; certificate checks are never turned off
Same run with outbound network blocked (sandbox-exec) only the 3 network.e2e.js tests and the existing cli init test failed, as expected
npm test (Node 22) 55/55 passed, 100% coverage, lint clean

Mutation checks. Each change was applied, the suite was run, and the code was restored. Every mutation was caught:

Mutation Failing tests
Remove the rt alias from src/custom-help.js 3 help tests
formatCommand returns an empty string load-and-render-help test
Invert the Node version check in src/index.js 4 cli tests
rollback selects link plugins instead of user 2 plugin tests
rollback skips the uninstall install/rollback test
Invert the discover sort order 2 discover tests
app dev certificate not issued to localhost app dev test (hostname check fails)

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Test changes only. Runtime code is unchanged.

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Chetan Aggarwal added 2 commits November 30, 2026 13:24
…t rollback/update side effects

- e2e: load every command of every bundled plugin, round-trip
  certificate generate/fingerprint/verify and config set/get/delete
  offline with an isolated config file
- run e2e on pull requests across Node 20.17.0 (engines minimum),
  22.x and 24.x
- unit: assert the exact plugins:install/uninstall calls for rollback
  and update, including declined and accepted confirmation prompts
…server flows

Add e2e suites that run the real bin/run in an isolated home, config,
data and cache directory, with no Adobe login:

- cli: version, help and the rt alias, unknown commands, aio info,
  telemetry, update notice, autocomplete and bash completion
- config: global/local precedence, .env and env overrides, where,
  console where and auth ctx
- runtime: rt property set/get/unset and the no-credentials error
- plugins: link/install/run/help/completion/rollback/uninstall of a
  fixture plugin
- app: app init per linter, app info, add/delete ci, delete action,
  build, pack and the local dev server
- network: discover and update --list against the npm registry

load-commands.js now also renders help for every command. The e2e
script runs e2e/e2e.js and every e2e/*.e2e.js file.
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.

1 participant