-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
test, build: add test-ci wrappers #12874
Changes from all commits
7ff770c
4fa2a44
964b2a1
7d757da
f666543
1860972
e9b2d11
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ LOGLEVEL ?= silent | |
OSTYPE := $(shell uname -s | tr '[A-Z]' '[a-z]') | ||
COVTESTS ?= test | ||
GTEST_FILTER ?= "*" | ||
export PYTHON | ||
|
||
ifdef JOBS | ||
PARALLEL_ARGS = -j $(JOBS) | ||
|
@@ -43,6 +44,7 @@ NODE_EXE = node$(EXEEXT) | |
NODE ?= ./$(NODE_EXE) | ||
NODE_G_EXE = node_g$(EXEEXT) | ||
NPM ?= ./deps/npm/bin/npm-cli.js | ||
TEST_CI = ./tools/test-ci.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you made this something like: TEST_CI = tools/test.py --mode=release -J then wouldn't you get the same deduplication without the indirection of a separate file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But what about Anyway we should all move to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure
This doesn't help with that though, you still have the I think people should run
SGTM There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What about creating a mechanism with an explicit configuration file, that all script derive from... test-cl:
"${PYTHON}" tools/test.py -J --mode=release $*
test-seq:
"${PYTHON}" tools/test.py --mode=release $*
test-deopt:
${test-cl} --check-deopts $* There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or hooking it into $ git tool test-cl parallel/test-stream2-transform
$ git tool lint
$ git tool benchmark buffers/buffer-tostring.js len=1024 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @refack There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
so a dual runner, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @addaleax for the whole concept? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I don’t think we should duplicate the same functionality over 2 or even 3 implementations. If you want honest advice: Close this PR, or at least let it rest until you find somebody that thinks this is a good idea. Multiple people here have expressed doubt about the usefulness of this, and in a consensus-seeking model that’s a sign that it’s just not going to happen. And so the chances are, the more work you put into this, the more frustrated you’re going to be when the PR just stalls and doesn’t go anywhere. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah I've already put it on the back burner #12874 (comment) Just kicking around the idea... |
||
|
||
# Flags for packaging. | ||
BUILD_DOWNLOAD_FLAGS ?= --download=all | ||
|
@@ -195,18 +197,18 @@ test: all | |
$(MAKE) build-addons | ||
$(MAKE) build-addons-napi | ||
$(MAKE) cctest | ||
$(PYTHON) tools/test.py --mode=release -J \ | ||
$(TEST_CI) \ | ||
doctool inspector known_issues message pseudo-tty parallel sequential $(CI_NATIVE_SUITES) | ||
$(MAKE) lint | ||
|
||
test-parallel: all | ||
$(PYTHON) tools/test.py --mode=release parallel -J | ||
$(TEST_CI) parallel | ||
|
||
test-valgrind: all | ||
$(PYTHON) tools/test.py --mode=release --valgrind sequential parallel message | ||
|
||
test-check-deopts: all | ||
$(PYTHON) tools/test.py --mode=release --check-deopts parallel sequential -J | ||
$(TEST_CI) --check-deopts parallel sequential | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have to admit I don’t quite get what the goal of these changes is? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Standardizing the calls to |
||
|
||
# Implicitly depends on $(NODE_EXE). We don't depend on it explicitly because | ||
# it always triggers a rebuild due to it being a .PHONY rule. See the comment | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pushd %~dp0\.. | ||
python tools\test.py -J --mode=release %* | ||
set TEST_CI_EXIT=%ERRORLEVEL% | ||
popd | ||
exit /b %TEST_CI_EXIT% |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #!/usr/bin/env bash would be more portable, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. But here it should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ack |
||
cd `dirname $0`/.. > /dev/null | ||
if [ -z "${PYTHON}" ]; then export PYTHON=`which python`; fi | ||
"${PYTHON}" tools/test.py -J --mode=release $* | ||
exit $? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to export it? Modifying environment variables as a side effect of
make
may be an unexpected behavior. I'd rather require users to either export it explicitly or prepend each command withPYTHON=...
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I read in the
Makefile
man it is only "exported" to subshells, no the caller.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified. It does not leak.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay. If that's the case, then fine.