@@ -159,6 +159,7 @@ coverage-clean:
159
159
# instrumented for any additional runs the user may want to make.
160
160
# For C++ coverage reporting, this needs to be run in conjunction with configure
161
161
# --coverage. html coverage reports will be created under coverage/
162
+ # Related CI job: node-test-commit-linux-coverage
162
163
coverage : coverage-test # # Run the tests and generate a coverage report.
163
164
164
165
.PHONY : coverage-build
@@ -209,6 +210,7 @@ coverage-test: coverage-build
209
210
| sed ' s/<[^>]*>//g' | sed ' s/ //g'
210
211
211
212
.PHONY : cctest
213
+ # Runs the C++ tests using the built `cctest` executable.
212
214
cctest : all
213
215
@out/$(BUILDTYPE ) /$@ --gtest_filter=$(GTEST_FILTER )
214
216
@@ -220,12 +222,16 @@ endif
220
222
@out/$(BUILDTYPE)/cctest --gtest_list_tests
221
223
222
224
.PHONY : v8
225
+ # Related CI job: node-test-commit-v8-linux
226
+ # Rebuilds deps/v8 as a git tree, pulls its third-party dependencies, and
227
+ # builds it.
223
228
v8 :
224
229
tools/make-v8.sh
225
230
$(MAKE ) -C deps/v8 $(V8_ARCH ) .$(BUILDTYPE_LOWER ) $(V8_BUILD_OPTIONS )
226
231
227
232
.PHONY : test
228
- test : all # # Default test target. Runs default tests, linters, and builds docs.
233
+ # This does not run tests of third-party libraries inside deps.
234
+ test : all # # Runs default tests, linters, and builds docs.
229
235
$(MAKE ) -s build-addons
230
236
$(MAKE ) -s build-addons-napi
231
237
$(MAKE ) -s doc-only
@@ -237,15 +243,15 @@ test: all ## Default test target. Runs default tests, linters, and builds docs.
237
243
$(CI_DOC )
238
244
239
245
.PHONY : test-only
240
- # For a quick test, does not run linter or build doc
241
- test-only : all
246
+ test-only : all # # For a quick test, does not run linter or build docs.
242
247
$(MAKE ) build-addons
243
248
$(MAKE ) build-addons-napi
244
249
$(MAKE ) cctest
245
250
$(PYTHON ) tools/test.py --mode=release -J \
246
251
$(CI_JS_SUITES ) \
247
252
$(CI_NATIVE_SUITES )
248
253
254
+ # Used by `make coverage-test`
249
255
test-cov : all
250
256
$(MAKE ) build-addons
251
257
$(MAKE ) build-addons-napi
@@ -408,6 +414,7 @@ CI_DOC := doctool
408
414
409
415
.PHONY : test-ci-native
410
416
# Build and test addons without building anything else
417
+ # Related CI job: node-test-commit-arm-fanned
411
418
test-ci-native : LOGLEVEL := info
412
419
test-ci-native : | test/addons/.buildstamp test/addons-napi/.buildstamp
413
420
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
@@ -416,6 +423,7 @@ test-ci-native: | test/addons/.buildstamp test/addons-napi/.buildstamp
416
423
417
424
.PHONY : test-ci-js
418
425
# This target should not use a native compiler at all
426
+ # Related CI job: node-test-commit-arm-fanned
419
427
test-ci-js : | clear-stalled
420
428
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
421
429
--mode=release --flaky-tests=$(FLAKY_TESTS ) \
@@ -428,6 +436,7 @@ test-ci-js: | clear-stalled
428
436
fi
429
437
430
438
.PHONY : test-ci
439
+ # Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned
431
440
test-ci : LOGLEVEL := info
432
441
test-ci : | clear-stalled build-addons build-addons-napi doc-only
433
442
out/Release/cctest --gtest_output=tap:cctest.tap
@@ -441,6 +450,23 @@ test-ci: | clear-stalled build-addons build-addons-napi doc-only
441
450
echo $$ {PS_OUT} | xargs kill ; exit 1; \
442
451
fi
443
452
453
+ .PHONY : build-ci
454
+ # Prepare the build for running the tests.
455
+ # Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned
456
+ build-ci :
457
+ $(PYTHON ) ./configure $(CONFIG_FLAGS )
458
+ $(MAKE )
459
+
460
+ .PHONY : run-ci
461
+ # Run by CI tests, exceptions:
462
+ # - node-test-commit-arm-fanned (Raspberry Pis), where the binaries are
463
+ # cross-compiled, then transferred elsewhere to run different subsets
464
+ # of tests. See `test-ci-native` and `test-ci-js`.
465
+ # - node-test-commit-linux-coverage: where the build and the tests need
466
+ # to be instrumented, see `coverage`.
467
+ run-ci : build-ci
468
+ $(MAKE ) test-ci
469
+
444
470
test-release : test-build
445
471
$(PYTHON ) tools/test.py --mode=release
446
472
@@ -467,17 +493,19 @@ test-tick-processor: all
467
493
$(PYTHON ) tools/test.py tick-processor
468
494
469
495
.PHONY : test-hash-seed
496
+ # Verifies the hash seed used by V8 for hashing is random.
470
497
test-hash-seed : all
471
498
$(NODE ) test/pummel/test-hash-seed.js
472
499
473
500
.PHONY : test-doc
474
- test-doc : doc-only
501
+ test-doc : doc-only # # Builds, lints, and verifies the docs.
475
502
$(MAKE ) lint
476
503
$(PYTHON ) tools/test.py $(CI_DOC )
477
504
478
505
test-known-issues : all
479
506
$(PYTHON ) tools/test.py known_issues
480
507
508
+ # Related CI job: node-test-npm
481
509
test-npm : $(NODE_EXE ) # # Run the npm test suite on deps/npm.
482
510
$(NODE ) tools/test-npm-package --install --logfile=test-npm.tap deps/npm test-node
483
511
@@ -528,8 +556,12 @@ test-with-async-hooks:
528
556
.PHONY : test-v8-benchmarks
529
557
.PHONY : test-v8-intl
530
558
ifneq ("","$(wildcard deps/v8/tools/run-tests.py) ")
559
+ # Related CI job: node-test-commit-v8-linux
531
560
test-v8 : v8 # # Runs the V8 test suite on deps/v8.
532
- # note: performs full test unless QUICKCHECK is specified
561
+ # Performs a full test unless QUICKCHECK is specified.
562
+ # Note that we cannot run the tests in deps/v8 directly without rebuilding a
563
+ # git tree and using gclient to pull the third-party dependencies, which is
564
+ # done by the `v8` target.
533
565
deps/v8/tools/run-tests.py --arch=$(V8_ARCH) \
534
566
--mode =$(BUILDTYPE_LOWER ) $(V8_TEST_OPTIONS ) $(QUICKCHECK_ARG ) \
535
567
--no-presubmit \
@@ -540,7 +572,7 @@ test-v8: v8 ## Runs the V8 test suite on deps/v8.
540
572
$(MAKE) test-hash-seed
541
573
542
574
test-v8-intl : v8
543
- # note: performs full test unless QUICKCHECK is specified
575
+ # Performs a full test unless QUICKCHECK is specified.
544
576
deps/v8/tools/run-tests.py --arch=$(V8_ARCH) \
545
577
--mode =$(BUILDTYPE_LOWER ) --no-presubmit $(QUICKCHECK_ARG ) \
546
578
--shell-dir=deps/v8/out/$(V8_ARCH ) .$(BUILDTYPE_LOWER ) intl \
@@ -574,8 +606,7 @@ apidocs_json = $(addprefix out/,$(apidoc_sources:.md=.json))
574
606
apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/* ) ) )
575
607
576
608
.PHONY : doc-only
577
- # This uses the locally built node if available, otherwise uses the global node
578
- doc-only : $(apidoc_dirs ) $(apiassets )
609
+ doc-only : $(apidoc_dirs ) $(apiassets ) # # Builds the docs with the local or the global Node.js binary.
579
610
# If it's a source tarball, assets are already in doc/api/assets,
580
611
# no need to install anything, we have already copied the docs over
581
612
if [ ! -d doc/api/assets ]; then \
@@ -639,15 +670,6 @@ docopen: $(apidocs_html)
639
670
docclean :
640
671
$(RM ) -r out/doc
641
672
642
- .PHONY : build-ci
643
- build-ci :
644
- $(PYTHON ) ./configure $(CONFIG_FLAGS )
645
- $(MAKE )
646
-
647
- .PHONY : run-ci
648
- run-ci : build-ci
649
- $(MAKE ) test-ci
650
-
651
673
RAWVER =$(shell $(PYTHON ) tools/getnodeversion.py)
652
674
VERSION =v$(RAWVER )
653
675
@@ -870,8 +892,10 @@ $(PKG): release-only
870
892
SIGN="$(PRODUCTSIGN_CERT)" PKG="$(PKG)" bash tools/osx-productsign.sh
871
893
872
894
.PHONY : pkg
895
+ # Builds the macOS installer for releases.
873
896
pkg : $(PKG )
874
897
898
+ # Note: this is strictly for release builds on release machines only.
875
899
pkg-upload : pkg
876
900
ssh $(STAGINGSERVER ) " mkdir -p nodejs/$( DISTTYPEDIR) /$( FULLVERSION) "
877
901
chmod 664 $(TARNAME ) .pkg
@@ -905,6 +929,7 @@ endif
905
929
.PHONY : tar
906
930
tar : $(TARBALL ) # # Create a source tarball.
907
931
932
+ # Note: this is strictly for release builds on release machines only.
908
933
tar-upload : tar
909
934
ssh $(STAGINGSERVER ) " mkdir -p nodejs/$( DISTTYPEDIR) /$( FULLVERSION) "
910
935
chmod 664 $(TARNAME ) .tar.gz
@@ -916,6 +941,7 @@ ifeq ($(XZ), 0)
916
941
ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME).tar.xz.done"
917
942
endif
918
943
944
+ # Note: this is strictly for release builds on release machines only.
919
945
doc-upload : doc
920
946
ssh $(STAGINGSERVER ) " mkdir -p nodejs/$( DISTTYPEDIR) /$( FULLVERSION) /docs/"
921
947
chmod -R ug=rw-x+X,o=r+X out/doc/
@@ -978,8 +1004,10 @@ endif
978
1004
$(RM) $(BINARYNAME).tar
979
1005
980
1006
.PHONY : binary
1007
+ # This requires NODE_VERSION_IS_RELEASE defined as 1 in src/node_version.h.
981
1008
binary : $(BINARYTAR ) # # Build release binary tarballs.
982
1009
1010
+ # Note: this is strictly for release builds on release machines only.
983
1011
binary-upload : binary
984
1012
ssh $(STAGINGSERVER ) " mkdir -p nodejs/$( DISTTYPEDIR) /$( FULLVERSION) "
985
1013
chmod 664 $(TARNAME ) -$(OSTYPE ) -$(ARCH ) .tar.gz
@@ -1038,7 +1066,7 @@ bench-dgram: all
1038
1066
bench-all : bench bench-misc bench-array bench-buffer bench-url bench-events bench-dgram bench-util
1039
1067
1040
1068
.PHONY : bench
1041
- bench : bench-net bench-http bench-fs bench-tls # # Run node benchmarks.
1069
+ bench : bench-net bench-http bench-fs bench-tls
1042
1070
1043
1071
.PHONY : bench-ci
1044
1072
bench-ci : bench
@@ -1078,6 +1106,7 @@ tools/.miscmdlintstamp: $(LINT_MD_FILES)
1078
1106
1079
1107
tools/.mdlintstamp : tools/.miscmdlintstamp tools/.docmdlintstamp
1080
1108
1109
+ # Lints the markdown documents maintained by us in the codebase.
1081
1110
lint-md : | tools/.mdlintstamp
1082
1111
else
1083
1112
lint-md :
@@ -1099,6 +1128,8 @@ lint-js-fix:
1099
1128
fi
1100
1129
1101
1130
.PHONY : lint-js
1131
+ # Note that on the CI `lint-js-ci` is run instead.
1132
+ # Lints the JavaScript code with eslint.
1102
1133
lint-js :
1103
1134
@echo " Running JS linter..."
1104
1135
@if [ -x $( NODE) ]; then \
@@ -1111,6 +1142,7 @@ jslint: lint-js
1111
1142
@echo " Please use lint-js instead of jslint"
1112
1143
1113
1144
.PHONY : lint-js-ci
1145
+ # On the CI the output is emitted in the TAP format.
1114
1146
lint-js-ci :
1115
1147
@echo " Running JS linter..."
1116
1148
@if [ -x $( NODE) ]; then \
@@ -1156,6 +1188,7 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
1156
1188
ADDON_DOC_LINT_FLAGS =-whitespace/ending_newline,-build/header_guard
1157
1189
1158
1190
.PHONY : lint-cpp
1191
+ # Lints the C++ code with cpplint.py and check-imports.py.
1159
1192
lint-cpp : tools/.cpplintstamp
1160
1193
1161
1194
tools/.cpplintstamp : $(LINT_CPP_FILES )
@@ -1181,6 +1214,8 @@ lint: ## Run JS, C++, MD and doc linters.
1181
1214
$(MAKE ) lint-addon-docs || EXIT_STATUS=$$? ; \
1182
1215
exit $$ EXIT_STATUS
1183
1216
CONFLICT_RE =^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+
1217
+
1218
+ # Related CI job: node-test-linter
1184
1219
lint-ci : lint-js-ci lint-cpp lint-md lint-addon-docs
1185
1220
@if ! ( grep -IEqrs " $( CONFLICT_RE) " benchmark deps doc lib src test tools ) \
1186
1221
&& ! ( find . -maxdepth 1 -type f | xargs grep -IEqs " $( CONFLICT_RE) " ); then \
0 commit comments