Skip to content

Commit cead93b

Browse files
committed
add smoke tests
Lightweight smoke test suite that runs common commands so that we can also have a holistic check during CI.
1 parent 2b3d1f9 commit cead93b

13 files changed

+1889
-1
lines changed

.github/workflows/ci.yml

+42
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,48 @@ jobs:
3737
- name: Run linting
3838
run: node . run licenses
3939

40+
smoke-tests:
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
node-version: ['10.1', 10.x, '12.1', 12.x, '14.1', 14.x]
45+
platform:
46+
- os: ubuntu-latest
47+
shell: bash
48+
- os: macos-latest
49+
shell: bash
50+
- os: windows-latest
51+
shell: bash
52+
- os: windows-latest
53+
shell: powershell
54+
55+
runs-on: ${{ matrix.platform.os }}
56+
defaults:
57+
run:
58+
shell: ${{ matrix.platform.shell }}
59+
60+
steps:
61+
# Checkout the npm/cli repo
62+
- uses: actions/checkout@v2
63+
64+
# Installs the specific version of Node.js
65+
- name: Use Node.js ${{ matrix.node-version }}
66+
uses: actions/setup-node@v1
67+
with:
68+
node-version: ${{ matrix.node-version }}
69+
70+
# Run the installer script
71+
- name: Install dependencies
72+
run: |
73+
node . install --ignore-scripts --no-audit
74+
node . rebuild
75+
76+
# Run the smoke tests
77+
- name: Run Smoke tests
78+
run: node . run --ignore-scripts smoke-tests -- --no-check-coverage -t600 -Rbase -c
79+
env:
80+
DEPLOY_VERSION: testing
81+
4082
build:
4183
strategy:
4284
fail-fast: false

.npmignore

+4
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ docs/template.html
3939
Session.vim
4040
.nyc_output
4141
/.editorconfig
42+
43+
# don't ship smoke tests
44+
smoke-tests/
45+
tap-snapshots/smoke-tests-index.js-TAP.test.js

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@
207207
"lint": "npm run eslint -- test/lib test/bin \"lib/**/*.js\"",
208208
"lintfix": "npm run lint -- --fix",
209209
"prelint": "rimraf test/npm_cache*",
210-
"resetdeps": "bash scripts/resetdeps.sh"
210+
"resetdeps": "bash scripts/resetdeps.sh",
211+
"smoke-tests": "tap smoke-tests/index.js"
211212
},
212213
"//": [
213214
"XXX temporarily only run unit tests while v7 beta is in progress",

0 commit comments

Comments
 (0)