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

add smoke tests #2959

Merged
merged 1 commit into from
Mar 25, 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
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,48 @@ jobs:
- name: Run linting
run: node . run licenses

smoke-tests:
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x]
platform:
- os: ubuntu-latest
shell: bash
- os: macos-latest
shell: bash
- os: windows-latest
shell: bash
- os: windows-latest
shell: powershell

runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}

steps:
# Checkout the npm/cli repo
- uses: actions/checkout@v2

# Installs the specific version of Node.js
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

# Run the installer script
- name: Install dependencies
run: |
node . install --ignore-scripts --no-audit
node . rebuild

# Run the smoke tests
- name: Run Smoke tests
run: node . run --ignore-scripts smoke-tests -- --no-check-coverage -t600 -Rbase -c
env:
DEPLOY_VERSION: testing

build:
strategy:
fail-fast: false
Expand Down
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ docs/template.html
Session.vim
.nyc_output
/.editorconfig

# don't ship smoke tests
smoke-tests/
tap-snapshots/smoke-tests-index.js-TAP.test.js
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ docs/content/using-npm/config.md: scripts/config-doc.js lib/utils/config/*.js
test: dev-deps
node bin/npm-cli.js test

smoke-tests: dev-deps
node bin/npm-cli.js run smoke-tests

ls-ok:
node . ls --production >/dev/null

Expand All @@ -93,7 +96,7 @@ prune:
@[[ "$(shell git status -s)" != "" ]] && echo "ERR: found unpruned files" && exit 1 || echo "git status is clean"


publish: gitclean ls-ok link test docs prune
publish: gitclean ls-ok link test smoke-tests docs prune
@git push origin :v$(shell node bin/npm-cli.js --no-timing -v) 2>&1 || true
git push origin $(BRANCH) &&\
git push origin --tags &&\
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@
"lint": "npm run eslint -- test/lib test/bin \"lib/**/*.js\"",
"lintfix": "npm run lint -- --fix",
"prelint": "rimraf test/npm_cache*",
"resetdeps": "bash scripts/resetdeps.sh"
"resetdeps": "bash scripts/resetdeps.sh",
"smoke-tests": "tap smoke-tests/index.js"
},
"//": [
"XXX temporarily only run unit tests while v7 beta is in progress",
Expand Down
Loading