Skip to content

test: e2e coverage for bundled plugin loading, certificate and config; stronger rollback/update unit assertions - #857

Open
chetan2002 wants to merge 1 commit into
adobe:masterfrom
chetan2002:e2e-plugin-load-coverage
Open

chetan2002 wants to merge 1 commit into
adobe:masterfrom
chetan2002:e2e-plugin-load-coverage

Conversation

@chetan2002

@chetan2002 chetan2002 commented Nov 27, 2026 •

Copy link
Copy Markdown

Description

Adds tests where coverage was missing:

  • e2e: load every bundled plugin command. e2e/load-commands.js loads each core plugin and require()s every command module (18 plugins, 213 command modules, about 2 seconds). The test fails if a bundled plugin is missing or any command module fails to load.
  • e2e: offline certificate round-trip. Runs certificate generate, fingerprint and verify, and checks the output against Node's crypto.X509Certificate: subject, key match, validity period and SHA-1 fingerprint. Also checks that invalid PEM input is rejected.
  • e2e: offline config round-trip. Runs config set, get and delete for global and --local keys, using an isolated AIO_CONFIG_FILE, with telemetry disabled and AIO_*/WSK_* variables from the shell ignored.
  • Unit tests: rollback and update. The tests now assert the exact plugins:uninstall / plugins:install calls made. New cases cover a declined --confirm prompt and an accepted one.
  • e2e.yml. e2e now also runs on PRs, across Node 20.17.0, 22.x and 24.x. CONTRIBUTING.md is updated to match.

Related Issue

No issue. Follow-up to #856, where open could not be updated because its fixed release is ESM-only. No test would have caught a bundled plugin breaking that way on the minimum Node version.

Motivation and Context

  • Unit coverage of src/ is already 100% and enforced.
  • e2e had only 2 tests: oclif error rendering and app init. Nothing checked that the 17 bundled plugins actually load.
  • Node 20.17.0 is the engines minimum. Node 20.19 and later, and 22.12 and later, can require() ES modules, so a CI job on floating 20.x cannot catch an ESM-only dependency. Only a pinned 20.17.0 can.
  • e2e previously ran only after merge, so these failures were not visible on PRs.

How Has This Been Tested?

Check Result
npm run e2e on Node 20.17.0, 22.23.4, 24.22.3 5/5 passed on each
npm test (Node 22): unit tests, coverage, lint 55/55 passed, 100% coverage, lint clean
Config test with AIO_E2E_LEAK=leaked set in the shell passes; without the env filter the variable reached the CLI and the test failed

Mutation checks. Each mutation was applied, the tests were run, and the code was then restored:

Mutation New tests Old tests
ESM-only open@10 in plugin-app, on Node 20.17.0 load test fails (app:deploy, app:run, app:dev: ERR_REQUIRE_ESM) not covered
Remove node-forge load test and certificate test fail not covered
Remove plugin-events plugins assertion fails not covered
rollback ignores a declined prompt fails passes
update ignores a declined prompt fails passes
rollback -i uninstalls every plugin instead of only the selected ones fails passes
update passes the wrong install argument fails passes

Cost: the new offline e2e tests take about 16 seconds per Node version. The networked app init test now runs three times per PR. If that is too much, the PR trigger can be reverted on its own.

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 and CI 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 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…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
@chetan2002
chetan2002 force-pushed the e2e-plugin-load-coverage branch from ae2afd2 to 42ba732 Compare November 30, 2026 08:00
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