Skip to content

Commit 59a5487

Browse files
committed
ci(end-to-end): test jazzer CLI across node versions
- before this, only jest was tested
1 parent b756e92 commit 59a5487

3 files changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/run-all-tests-pr.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ jobs:
107107

108108
# Run with different node.js versions
109109
# all in one job to avoid rebuilding
110+
# each runtime executes both jest-runner and direct CLI smoke tests
110111
# Node 14 only has binaries for x64 runners
111112
- name: "node 14"
112113
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'
@@ -117,6 +118,10 @@ jobs:
117118
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'
118119
run: cd end-to-end && npx jest
119120
shell: bash
121+
- name: run CLI smoke test (node 14)
122+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'
123+
run: cd end-to-end && npm run fuzz:cli
124+
shell: bash
120125

121126
- name: "node 16"
122127
uses: actions/setup-node@v6
@@ -125,6 +130,9 @@ jobs:
125130
- name: run tests (node 16)
126131
run: cd end-to-end && npx jest
127132
shell: bash
133+
- name: run CLI smoke test (node 16)
134+
run: cd end-to-end && npm run fuzz:cli
135+
shell: bash
128136

129137
- name: "node 18"
130138
uses: actions/setup-node@v6
@@ -133,6 +141,9 @@ jobs:
133141
- name: run tests (node 18)
134142
run: cd end-to-end && npx jest
135143
shell: bash
144+
- name: run CLI smoke test (node 18)
145+
run: cd end-to-end && npm run fuzz:cli
146+
shell: bash
136147

137148
- name: "node 20"
138149
uses: actions/setup-node@v6
@@ -141,6 +152,9 @@ jobs:
141152
- name: run tests (node 20)
142153
run: cd end-to-end && npx jest
143154
shell: bash
155+
- name: run CLI smoke test (node 20)
156+
run: cd end-to-end && npm run fuzz:cli
157+
shell: bash
144158

145159
- name: "node 22"
146160
uses: actions/setup-node@v6
@@ -149,6 +163,9 @@ jobs:
149163
- name: run tests (node 22)
150164
run: cd end-to-end && npx jest
151165
shell: bash
166+
- name: run CLI smoke test (node 22)
167+
run: cd end-to-end && npm run fuzz:cli
168+
shell: bash
152169

153170
- name: "node 24"
154171
uses: actions/setup-node@v6
@@ -157,6 +174,9 @@ jobs:
157174
- name: run tests (node 24)
158175
run: cd end-to-end && npx jest
159176
shell: bash
177+
- name: run CLI smoke test (node 24)
178+
run: cd end-to-end && npm run fuzz:cli
179+
shell: bash
160180
auto-merge:
161181
needs:
162182
- linting

end-to-end/cli-smoke.cjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright 2026 Code Intelligence GmbH
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
module.exports.fuzz = function fuzz(data) {
18+
if (data.length > 1024) {
19+
throw new Error("Unexpectedly large input");
20+
}
21+
};

end-to-end/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"scripts": {
55
"build": "tsc",
66
"dryRun": "jest",
7+
"fuzz:cli": "jazzer cli-smoke.cjs --sync -- -runs=1 -seed=123456789",
78
"fuzz": "JAZZER_FUZZ=1 jest --coverage",
89
"coverage": "jest --coverage"
910
},

0 commit comments

Comments
 (0)