-
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
build: add Python 3 tests to Travis CI #29196
Conversation
@nodejs/python @nodejs/build-files This seems like a very good idea to me: Add Python 3 to Travis but mark it as allowed-to-fail. |
No need to run the full test suite in Jenkins for a change to |
Is the intent (once Those could possibly be fixed up later (which is why I'm not blocking this despites my concerns above). |
configure.py is already Python 3 compatible but it is the files that come afterwards that are not.
Correct. Small moves. Let’s get the parts working separately before we try to get them working together. |
script: | ||
- NODE=$(which node) make lint lint-py | ||
- python3.7 ./configure.py | ||
- NODE=$(which node) make test |
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.
You could also prefix this with PYTHON=python3.7
to run tools/gyp_node.py and tools/test.py with Python 3 too. There's also an install
target that could exercise tools/install.py, but maybe that can be added later. It'll be important for making sure that release builds can be done with Python 3.
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.
Thanks. Will add these after make test
goes green.
language: node_js | ||
node_js: "node" | ||
install: | ||
- pyenv global 3.7.1 |
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.
Why not 3.7.4 since it's the latest ?
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.
3.7.4 is not available on the pyenv on Travis CI. pyenv list --install
We might even need to temporarily downgrade to Python 3.6 because async is a reserved word in Python >= 3.7 and that messes with inspector_protocol/code_generator.py
This comment has been minimized.
This comment has been minimized.
Looks like same on travis, see https://travis-ci.com/nodejs/node/jobs/226154301#L573. macOS is full compatible with python3 with the patch applied. |
This is how I do it. Make sure your master is up to date and then:
Go to your Travis CI page and watch the tests... Remember that Travis CI is running the Py3 tests in allow_failures mode so read the test logs carefully and don't be fooled by green results the Py3 run.
|
Looks like this need to change. cc @cclauss
|
I'm treating this as a helpful but non-blocking comment. Many things will need to change before this works which is why it's marked as "allowed to fail" for now. See https://github.com/nodejs/node/search?q=is%3Aopen+label%3Apython&type=Issues and in particular #25789, which includes a comment about ninja.py. |
Landed in f70261f |
These tests are run in allow_failures mode on Python 3.7.1 and they bypasses the Python version checks in ./configure by directly running ./configure.py. PR-URL: #29196 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Michaël Zasso <targos@protonmail.com>
@gengjiawen @Trott Thanks much for this. I could do mass conversion of the codebase with tools like futurize or modernize but my approach on this codebase is different. I am deliberately taking a fix-as-I-go approach because I sense that many of our dependencies and much of our code is dead code. If once this port is complete, we can identify and strip away some of that dead code which would give us a smaller codebase to port over to JavaScript. So let’s convert code as our test break for a few more weeks so the code paths become crystal clear. For evidence of the dead code, see the scads of excludes in our .flake8 file. |
These tests are run in allow_failures mode on Python 3.7.1 and they bypasses the Python version checks in ./configure by directly running ./configure.py. PR-URL: #29196 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesBased on the lessons learned in #29193, this pull request adds Travis CI test suite named Python 3 is EXPERIMENTAL. These tests are run in allow_failures mode on Python 3.7.1 and they bypasses the Python version checks in ./configure by directly running ./configure.py.