Skip to content

Commit 3883092

Browse files
committed
Add Node 17 to the build matrix
Modify the build matrix to add Node 17 to the environments under test. The GCC setup from Node 16 is reused here. As a workaround for a bug caused by Node 17 switching to OpenSSL 3, we add the `--openssl-legacy-provider` option to the `NODE_OPTIONS` environment variable. See [this node issue][node] and [this webpack issue][webpack] for details. [node]: nodejs/node#40455 [webpack]: webpack/webpack#14532
1 parent 67d7fc1 commit 3883092

File tree

3 files changed

+139
-19
lines changed

3 files changed

+139
-19
lines changed

.semaphore/semaphore.yml

Lines changed: 115 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,23 @@ blocks:
6262
- name: Git Lint (Lintje)
6363
commands:
6464
- script/lint_git
65-
- name: Node.js 16 - Build
65+
- name: Node.js 17 - Build
6666
dependencies:
6767
- Validation
6868
task:
6969
env_vars:
70+
- &1
71+
name: NODE_OPTIONS
72+
value: "--openssl-legacy-provider"
7073
- name: NODE_VERSION
71-
value: '16'
74+
value: '17'
7275
prologue:
7376
commands:
7477
- sem-version c 8
7578
- cache restore
7679
- mono bootstrap --ci
7780
- cache store
78-
epilogue: &1
81+
epilogue: &2
7982
on_fail:
8083
commands:
8184
- cat /tmp/appsignal-*-install.report
@@ -86,6 +89,106 @@ blocks:
8689
- cache store $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION packages
8790
- cache store $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
8891
/tmp/appsignal-*-install.report
92+
- name: Node.js 17 - Tests
93+
dependencies:
94+
- Node.js 17 - Build
95+
task:
96+
env_vars:
97+
- *1
98+
- name: NODE_VERSION
99+
value: '17'
100+
- name: _APPSIGNAL_EXTENSION_INSTALL
101+
value: 'false'
102+
prologue:
103+
commands:
104+
- sem-version c 8
105+
- cache restore
106+
- cache restore $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
107+
- cache restore $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
108+
- mono bootstrap --ci
109+
epilogue: *2
110+
jobs:
111+
- name: "@appsignal/nodejs - nodejs"
112+
commands:
113+
- mono test --package=@appsignal/nodejs
114+
- name: "@appsignal/nodejs - nodejs - diagnose"
115+
commands:
116+
- git submodule init
117+
- git submodule update
118+
- LANGUAGE=nodejs test/integration/diagnose/bin/test
119+
- name: "@appsignal/nodejs-ext - nodejs-ext"
120+
commands:
121+
- mono test --package=@appsignal/nodejs-ext
122+
- mono run --package @appsignal/nodejs-ext -- npm run test:failure
123+
- name: "@appsignal/apollo-server - apollo-server@latest - integrations"
124+
commands:
125+
- script/install_test_example_packages apollo-server apollo-server-plugin-base@latest
126+
- script/test_package_integration apollo-server
127+
- name: "@appsignal/apollo-server - [email protected] - integrations"
128+
commands:
129+
- script/install_test_example_packages apollo-server [email protected]
130+
- script/test_package_integration apollo-server
131+
- name: "@appsignal/apollo-server - [email protected] - integrations"
132+
commands:
133+
- script/install_test_example_packages apollo-server [email protected]
134+
- script/test_package_integration apollo-server
135+
- name: "@appsignal/apollo-server - [email protected] - integrations"
136+
commands:
137+
- script/install_test_example_packages apollo-server [email protected]
138+
- script/test_package_integration apollo-server
139+
- name: "@appsignal/express - express@latest - integrations"
140+
commands:
141+
- script/install_test_example_packages express express@latest
142+
- script/test_package_integration express
143+
- name: "@appsignal/express - [email protected] - integrations"
144+
commands:
145+
- script/install_test_example_packages express [email protected]
146+
- script/test_package_integration express
147+
- name: "@appsignal/koa - koa@latest - integrations"
148+
commands:
149+
- script/install_test_example_packages koa koa@latest
150+
- script/test_package_integration koa
151+
- name: "@appsignal/koa - [email protected] - integrations"
152+
commands:
153+
- script/install_test_example_packages koa [email protected]
154+
- script/test_package_integration koa
155+
- name: "@appsignal/koa - [email protected] - integrations"
156+
commands:
157+
- script/install_test_example_packages koa [email protected]
158+
- script/test_package_integration koa
159+
- name: "@appsignal/nextjs - next.js@latest - integrations"
160+
commands:
161+
- script/install_test_example_packages nextjs next@latest react@latest react-dom@latest
162+
- script/test_package_integration nextjs
163+
- name: "@appsignal/nextjs - [email protected] - integrations"
164+
commands:
165+
- script/install_test_example_packages nextjs [email protected] [email protected] [email protected]
166+
- script/test_package_integration nextjs
167+
- name: "@appsignal/nextjs - [email protected] - integrations"
168+
commands:
169+
- script/install_test_example_packages nextjs [email protected] [email protected] [email protected]
170+
- script/test_package_integration nextjs
171+
- name: Node.js 16 - Build
172+
dependencies:
173+
- Validation
174+
task:
175+
env_vars:
176+
- name: NODE_VERSION
177+
value: '16'
178+
prologue:
179+
commands:
180+
- sem-version c 8
181+
- cache restore
182+
- mono bootstrap --ci
183+
- cache store
184+
epilogue: *2
185+
jobs:
186+
- name: Build
187+
commands:
188+
- mono build
189+
- cache store $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION packages
190+
- cache store $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
191+
/tmp/appsignal-*-install.report
89192
- name: Node.js 16 - Tests
90193
dependencies:
91194
- Node.js 16 - Build
@@ -102,7 +205,7 @@ blocks:
102205
- cache restore $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
103206
- cache restore $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
104207
- mono bootstrap --ci
105-
epilogue: *1
208+
epilogue: *2
106209
jobs:
107210
- name: "@appsignal/nodejs - nodejs"
108211
commands:
@@ -176,7 +279,7 @@ blocks:
176279
- cache restore
177280
- mono bootstrap --ci
178281
- cache store
179-
epilogue: *1
282+
epilogue: *2
180283
jobs:
181284
- name: Build
182285
commands:
@@ -199,7 +302,7 @@ blocks:
199302
- cache restore $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
200303
- cache restore $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
201304
- mono bootstrap --ci
202-
epilogue: *1
305+
epilogue: *2
203306
jobs:
204307
- name: "@appsignal/nodejs - nodejs"
205308
commands:
@@ -273,7 +376,7 @@ blocks:
273376
- cache restore
274377
- mono bootstrap --ci
275378
- cache store
276-
epilogue: *1
379+
epilogue: *2
277380
jobs:
278381
- name: Build
279382
commands:
@@ -296,7 +399,7 @@ blocks:
296399
- cache restore $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
297400
- cache restore $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
298401
- mono bootstrap --ci
299-
epilogue: *1
402+
epilogue: *2
300403
jobs:
301404
- name: "@appsignal/nodejs - nodejs"
302405
commands:
@@ -370,7 +473,7 @@ blocks:
370473
- cache restore
371474
- mono bootstrap --ci
372475
- cache store
373-
epilogue: *1
476+
epilogue: *2
374477
jobs:
375478
- name: Build
376479
commands:
@@ -393,7 +496,7 @@ blocks:
393496
- cache restore $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
394497
- cache restore $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
395498
- mono bootstrap --ci
396-
epilogue: *1
499+
epilogue: *2
397500
jobs:
398501
- name: "@appsignal/nodejs - nodejs"
399502
commands:
@@ -467,7 +570,7 @@ blocks:
467570
- cache restore
468571
- mono bootstrap --ci
469572
- cache store
470-
epilogue: *1
573+
epilogue: *2
471574
jobs:
472575
- name: Build
473576
commands:
@@ -490,7 +593,7 @@ blocks:
490593
- cache restore $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
491594
- cache restore $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
492595
- mono bootstrap --ci
493-
epilogue: *1
596+
epilogue: *2
494597
jobs:
495598
- name: "@appsignal/nodejs - nodejs"
496599
commands:

Rakefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22

3+
require "set"
34
require "yaml"
45

56
namespace :build_matrix do
@@ -13,13 +14,19 @@ namespace :build_matrix do
1314
matrix["nodejs"].each do |nodejs|
1415
nodejs_version = nodejs["nodejs"]
1516
setup = nodejs.fetch("setup", [])
17+
env_vars = nodejs.fetch("env_vars", [])
1618

1719
build_block_name = "Node.js #{nodejs_version} - Build"
1820
build_block = build_semaphore_task(
1921
"name" => build_block_name,
2022
"dependencies" => ["Validation"],
2123
"task" => {
22-
"env_vars" => ["name" => "NODE_VERSION", "value" => nodejs_version],
24+
"env_vars" => env_vars + [
25+
{
26+
"name" => "NODE_VERSION",
27+
"value" => nodejs_version
28+
}
29+
],
2330
"prologue" => {
2431
"commands" => setup + [
2532
"cache restore",
@@ -98,7 +105,7 @@ namespace :build_matrix do
98105
"name" => primary_block_name,
99106
"dependencies" => [build_block_name],
100107
"task" => {
101-
"env_vars" => [
108+
"env_vars" => env_vars + [
102109
{
103110
"name" => "NODE_VERSION",
104111
"value" => nodejs_version

build_matrix.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,22 @@ matrix:
7070
- "cat /tmp/appsignal-*-install.report"
7171

7272
nodejs:
73-
- nodejs: "16"
74-
setup:
75-
# Configure the host to use GCC 8.3 for Node.js 16. This is the minimal
76-
# required version for Node.js 16, and the extension won't compile
77-
# without it.
73+
- nodejs: "17"
74+
setup: &gcc8
75+
# Configure the host to use GCC 8.3 for Node.js 16 and above. This
76+
# is the minimal required version for Node.js 16 and above, and the
77+
# extension won't compile without it.
7878
- sem-version c 8
79+
env_vars:
80+
# Set `NODE_OPTIONS` to `--openssl-legacy-provider`, as a workaround
81+
# for this `webpack` bug affecting the `@appsignal/nextjs` tests
82+
# when running on Node 17:
83+
# https://github.com/webpack/webpack/issues/14532
84+
# https://github.com/nodejs/node/issues/40455
85+
- name: NODE_OPTIONS
86+
value: "--openssl-legacy-provider"
87+
- nodejs: "16"
88+
setup: *gcc8
7989
- nodejs: "15"
8090
- nodejs: "14"
8191
- nodejs: "13"

0 commit comments

Comments
 (0)