Commit Graph

55 Commits

Author SHA1 Message Date
Mikhail Golubev
13edb918bd Use Popen.communicate() to avoid deadlock in skeleton generator tests on Windows
Using output piping mode together with Popen.wait() leads to one as actually stated
in the documentation.

GitOrigin-RevId: bb4bbb438ca54668607a92cd77d9b5255fa3bdc5
2019-11-07 02:40:58 +00:00
Aleksey Rostovskiy
05ad108a16 PY-36307 fix helper tests: use proper file separator
GitOrigin-RevId: 1f9c5725849e8cb099034eb5095f63bcd50f8b7c
2019-10-24 00:07:37 +00:00
Aleksey Rostovskiy
9597fd8b31 update python versions for helper tests
GitOrigin-RevId: f4e4d3f7712977d3f0b74f333445e8b554a9beac
2019-10-23 16:08:49 +00:00
Aleksey Rostovskiy
0955578885 fix typo
GitOrigin-RevId: 8226fdc9c4911889de3c9006b52bcf5c6b111e17
2019-10-23 16:08:49 +00:00
Andrey Vlasovskikh
3f9d13c560 Don't depend on intellij.python.helpers explicitly since it's already a run-time dependency of intellij.python.community.impl
GitOrigin-RevId: d922f3533a6f6b8d36fdfb83e7514463b4c3cb62
2019-10-21 20:03:52 +00:00
Mikhail Golubev
15782e17f4 Remove brittle mode of generator3.py tests when it's run in the same process
GitOrigin-RevId: c21ac992fb9c52221c70bd16c57323a6f52c023c
2019-08-05 20:04:17 +03:00
Mikhail Golubev
3bdc81e100 Extract @python2_only/@python3_only helper test decorators
GitOrigin-RevId: 7974c3d8abd28c5d7b576586ae76175016a9a9a8
2019-08-05 20:04:17 +03:00
Mikhail Golubev
82da26cf88 Enable more verbose diffs in generator tests
GitOrigin-RevId: fd4922447c8aa8ec22b2910beb3ce8d9c021c34b
2019-08-05 20:04:17 +03:00
Mikhail Golubev
89bbbd4838 Indicate test results in runner's script exit code
Otherwise, tox considers any test run to be successful.

GitOrigin-RevId: ed883ef5a5002a052f015e190b1542e0a1ed9e6b
2019-08-05 20:04:17 +03:00
Mikhail Golubev
b70a5f9b9a PY-37241 Handle non-string "__module__" values of top-level module attributes
GitOrigin-RevId: b24cb5033a5706d8a365c206763834dcef6a92a4
2019-08-05 20:04:17 +03:00
Mikhail Golubev
91c41bc40a Don't initialize docstring parser when only copying skeletons from the cache
Parser initialization is moved out of constants.py modules.
generator3.py imports modules_redeclarator.py only when it's needed.

Profiling results show that it takes about 1/4 of the total running time
in scenarios when generator3 only copies existing binary stubs.

GitOrigin-RevId: 8fa303e8449cde0ddd7bcb1241a17bb4ef91ad84
2019-08-05 20:04:17 +03:00
Mikhail Golubev
24dcd3382f PY-36884 Fix non-existing built-in module name in generator3.py tests
GitOrigin-RevId: 3dc0f1fad145d34257a51552881cf7ed9840714f
2019-08-05 20:04:17 +03:00
Mikhail Golubev
fc5945d38a PY-37220 Copy the content of sys.modules before iterating over its keys
I didn't manage to reproduce the original exception with libraries from user's
logs and added extra diagnostic for such cases.

GitOrigin-RevId: f883bde89022a293f8b040376ea54702c389bf80
2019-08-05 20:04:17 +03:00
Mikhail Golubev
88147b8961 PY-36884 Keep path placeholder in headers of pre-generated skeletons
We accidentally restored the actual path to a binary when copying skeletons
from the cache to a specific per-sdk directory on agents. Thus, pre-built
skeletons had local agent's paths instead of the special "(pre-generated)"
placeholder. It led to them being automatically deleted on skeleton clean up
phase where we compare origin paths in skeleton headers with the actual file
system content and remove those for absent binaries.

GitOrigin-RevId: 76ea06539ae3d5813941f0e4971e3dc451fde04a
2019-07-18 17:57:26 +03:00
Mikhail Golubev
1ee85abc04 Exclude directories with helpers' virtualenvs from the corresponding modules
GitOrigin-RevId: dd2d9212220e8f4422aad88fa719a508f5ae52f5
2019-07-18 17:57:26 +03:00
Mikhail Golubev
a1ba269ba8 PY-36504 Correctly set exit code if skeleton generation for a binary is known to fail
Also don't copy skeletons for such binaries from the cache to an sdk
skeletons directory (there just should be none).

GitOrigin-RevId: 8b5393112540922f583d89d101e7c2860e91fb2b
2019-07-08 21:02:18 +03:00
Mikhail Golubev
a66f40b719 Set the flag for the test mode of generator even in test runner process
So that its functions behave identically regardless of how being invoked: either
by importing the module directly or launching generator in a separate process.

GitOrigin-RevId: a4e513a851faece624b8133cba2068a6b0e5ce82
2019-06-16 05:21:34 +03:00
Mikhail Golubev
f1d872eb0f Use first 10 characters of sha256 in cache tests to shorten paths in test data
Otherwise, it affects developers on Windows, especially if they cannot increase
maximum path length limit on older versions of OS.

GitOrigin-RevId: 785363fcbb0d39f41b53211e2cef156cb672e525
2019-06-16 05:21:03 +03:00
Mikhail Golubev
7caed5dd1e Distinguish tests in different interpreters by prepending version to their name
GitOrigin-RevId: e549ee924bf1e43b6144be6cecd5d365bdcf5938
2019-06-16 05:16:55 +03:00
Mikhail Golubev
8fb9d3c4e1 Display lengthy output of generator3.py inside corresponding test blocks
Make sure that all messages including those to a logger go through
the buffered sys.stdout.

GitOrigin-RevId: c785e0b2da1ec2f3c72764c388d275b782a5769d
2019-06-16 05:16:24 +03:00
Mikhail Golubev
367a8a9aa7 Allow to run an arbitrary helpers test with __main__.py
GitOrigin-RevId: b2178dbcf44c141ace011dbf165f48cc819dbd0d
2019-06-16 05:15:53 +03:00
Mikhail Golubev
92ba575df6 Fix metaclass declaration in a Python 3 specific test
GitOrigin-RevId: e73704b5cd261ce617676e5ed5b32f1545265f30
2019-06-16 05:15:22 +03:00
Mikhail Golubev
6c7701e8a7 Move tox.ini to the tests root to be able to run all tests with it
GitOrigin-RevId: 24c79d256dc106cdee1ae65917672e5d2dff95af
2019-06-16 05:14:51 +03:00
Mikhail Golubev
1001f22616 Add an entry point to discover and run helpers tests with teamcity-messages
Utilize it to run tests on TC instead of plain "-m unittest discover".

GitOrigin-RevId: e021c4f5dd01f5a5b9b0d989d6befd795e394499
2019-06-16 05:14:20 +03:00
Aleksey Rostovskiy
31d6688601 PY-36307 Configure running of helpers' pure Python tests on TeamCity: build.gradle for running all tests
GitOrigin-RevId: a8b4f699896a89578b9e857febb3f2f415ce3480
2019-06-16 05:13:49 +03:00
Mikhail Golubev
6b6273a322 Remove an unused script and system-specific .python-version from tests
GitOrigin-RevId: e716c8234cd5dba4992c655efc5b9b773d56b018
2019-06-16 05:13:18 +03:00
Mikhail Golubev
4b7f88426b Make sure that we use Python 2/3 compatible open in tests
GitOrigin-RevId: f0f345d0d6524ee37c779be4b7fff619a361c879
2019-06-16 05:12:47 +03:00
Mikhail Golubev
a1ba8bfbaf Allow to run an arbitrary test in supported Python versions via tox
GitOrigin-RevId: 00f2d24320927db10c8299b80dfe999cb708339e
2019-06-16 05:12:16 +03:00
Mikhail Golubev
0b2a62d2d3 Merge a module skeleton with an existing package __init__.py in cache if any
We've already done it in the opposite direction turning existing
module skeletons into packages' __init__.py while generating skeletons
for submodules. It turned out, it can happen in reverse order as well:
for "pyexpat" builtin skeletons for its submodules are generated earlier
that "pyexpat" itself if processed.

GitOrigin-RevId: 76631e901bb2476c59a0fce61c55cccc4408a9a8
2019-06-16 05:11:45 +03:00
Mikhail Golubev
b6c0786ec8 Remove confusing check on that module should have imports to process its submodules
Modules like built-in "expat" can import nothing.

GitOrigin-RevId: 7d0dfa939e3c8e855c97332b99d090b0e2b772dd
2019-06-16 05:10:43 +03:00
Mikhail Golubev
f9441a2d8d Properly update origin stamp in skeletons copied from the cache
It's necessary to detect their import group for Optimize Imports and
delete them on package removal afterwards.

GitOrigin-RevId: e0d7d6a25978e4fb195a5607c55ea6aeb5b0e082
2019-06-16 05:09:41 +03:00
Mikhail Golubev
2d75a2f723 Test data skeletons contain origin stamps with relative paths
GitOrigin-RevId: 84ceaa719e62245ee59fc1ff3d5720451dca9045
2019-06-16 05:09:10 +03:00
Mikhail Golubev
83e608486b Secure line ending in .py files used for caching tests
Otherwise, automatic line ending conversion might affect SHA 256 hashes
calculated in test data based on its content. It allowed to uniformly
compute it both for binary and text files.

GitOrigin-RevId: b41ff089235c178b182271a81a26146cff54e053
2019-06-16 05:08:39 +03:00
Mikhail Golubev
0d1dd4024a Move tests for helpers in a dedicated module
GitOrigin-RevId: e444b3666720460e9f3675b62af06d0f77adf48f
2019-06-16 05:07:37 +03:00
Eldar Abusalimov
1120c30a56 Merge remote-tracking branch 'origin/master' into eldar/cidr-debugger
# Conflicts:
#	CIDR/clion/src/com/jetbrains/cidr/cpp/toolchains/MSVC.java

GitOrigin-RevId: f3593b526d1870f32b3f1451cab0c6a653e5beb5
2019-06-16 03:01:38 +03:00
Anna Kozlova
91f7445298 constructor reference: don't ignore constructor parameters during method reference inference (IDEA-185578)
GitOrigin-RevId: e836468e05db28157713e9edd3c70382f8ecdebc
2019-06-13 03:15:49 +03:00
Egor Zhdan
39d2d77155 Cleanup: NotNull/Nullable
GitOrigin-RevId: b8e892f32ea84c2115973155dba7127b892cc36e
2019-06-13 03:14:35 +03:00
Mikhail Golubev
513e5d6cda Set the flag for the test mode of generator even in test runner process
So that its functions behave identically regardless of how being invoked: either
by importing the module directly or launching generator in a separate process.

GitOrigin-RevId: a4e513a851faece624b8133cba2068a6b0e5ce82
2019-06-10 22:09:47 +03:00
Mikhail Golubev
defc680bb1 Use first 10 characters of sha256 in cache tests to shorten paths in test data
Otherwise, it affects developers on Windows, especially if they cannot increase
maximum path length limit on older versions of OS.

GitOrigin-RevId: 785363fcbb0d39f41b53211e2cef156cb672e525
2019-06-10 22:09:16 +03:00
Mikhail Golubev
51fe36f4e4 Distinguish tests in different interpreters by prepending version to their name
GitOrigin-RevId: e549ee924bf1e43b6144be6cecd5d365bdcf5938
2019-06-10 20:00:19 +03:00
Mikhail Golubev
e1dcfcbfe0 Display lengthy output of generator3.py inside corresponding test blocks
Make sure that all messages including those to a logger go through
the buffered sys.stdout.

GitOrigin-RevId: c785e0b2da1ec2f3c72764c388d275b782a5769d
2019-06-10 19:59:47 +03:00
Mikhail Golubev
975217fb4f Allow to run an arbitrary helpers test with __main__.py
GitOrigin-RevId: b2178dbcf44c141ace011dbf165f48cc819dbd0d
2019-06-10 19:59:17 +03:00
Mikhail Golubev
882ba4dcdc Fix metaclass declaration in a Python 3 specific test
GitOrigin-RevId: e73704b5cd261ce617676e5ed5b32f1545265f30
2019-06-10 19:58:46 +03:00
Mikhail Golubev
f2cfa9ea75 Move tox.ini to the tests root to be able to run all tests with it
GitOrigin-RevId: 24c79d256dc106cdee1ae65917672e5d2dff95af
2019-06-10 19:58:15 +03:00
Mikhail Golubev
020ff1765a Add an entry point to discover and run helpers tests with teamcity-messages
Utilize it to run tests on TC instead of plain "-m unittest discover".

GitOrigin-RevId: e021c4f5dd01f5a5b9b0d989d6befd795e394499
2019-06-10 19:57:45 +03:00
Aleksey Rostovskiy
d685842863 PY-36307 Configure running of helpers' pure Python tests on TeamCity: build.gradle for running all tests
GitOrigin-RevId: a8b4f699896a89578b9e857febb3f2f415ce3480
2019-06-10 19:57:14 +03:00
Mikhail Golubev
3c43302abc Remove an unused script and system-specific .python-version from tests
GitOrigin-RevId: e716c8234cd5dba4992c655efc5b9b773d56b018
2019-06-10 19:56:44 +03:00
Mikhail Golubev
ae63a3111d Make sure that we use Python 2/3 compatible open in tests
GitOrigin-RevId: f0f345d0d6524ee37c779be4b7fff619a361c879
2019-06-10 19:56:13 +03:00
Mikhail Golubev
6c3718ffd8 Allow to run an arbitrary test in supported Python versions via tox
GitOrigin-RevId: 00f2d24320927db10c8299b80dfe999cb708339e
2019-06-10 19:55:42 +03:00
Mikhail Golubev
17ea40ed9f Merge a module skeleton with an existing package __init__.py in cache if any
We've already done it in the opposite direction turning existing
module skeletons into packages' __init__.py while generating skeletons
for submodules. It turned out, it can happen in reverse order as well:
for "pyexpat" builtin skeletons for its submodules are generated earlier
that "pyexpat" itself if processed.

GitOrigin-RevId: 76631e901bb2476c59a0fce61c55cccc4408a9a8
2019-06-10 19:55:11 +03:00