Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: speed up serving-functions test by pre-generating oclif manifest #3517

Merged
merged 2 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ jobs:
- name: Linting
run: npm run format:ci
if: "${{ matrix.node-version == '*' && !steps.release-check.outputs.IS_RELEASE}}"
- name: Create manifest file
# This caches the commands, so oclif doesn't need to re-load them on each run of the CLI
run: npx oclif-dev manifest
- name: Tests
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
run: npm run test:ci
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"format:fix:prettier": "cross-env-shell prettier --write $npm_package_config_prettier",
"test:dev": "run-s test:init:* test:dev:*",
"test:ci": "run-s test:init:* test:ci:*",
"test:init:build": "run-s build:*",
"test:init:cli-version": "npm run start -- --version",
"test:init:cli-help": "npm run start -- --help",
"test:init:eleventy-deps": "npm ci --prefix tests/eleventy-site --no-audit",
Expand All @@ -65,7 +66,8 @@
"test:ci:ava": "nyc -r json ava",
"docs": "node ./site/scripts/docs.js",
"watch": "nyc --reporter=lcov ava --watch",
"prepack": "oclif-dev manifest && npm prune --prod",
"build:manifest": "oclif-dev manifest",
"prepack": "npm run build:manifest && npm prune --prod",
"postpack": "rm -f oclif.manifest.json && npm i",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we currently try to only generate the manifest during the packing process. What's the idea behind that? Do we fear it becoming stale during development?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we fear it becoming stale during development?

I'm not sure this was a very conscious choice, but yes - this can happen.
We could add another cleanup step to remove it (we'll need to propagate the exit code from the test run though).

"site:build": "run-s site:build:*",
"site:build:install": "cd site && npm ci --no-audit",
Expand Down