Commit Graph

50 Commits

Author SHA1 Message Date
Sergii Tkachenko
de6ed9ba9f [Python] Migrate from yapf to black (#33138)
- Switched  from yapf to black
- Reconfigure isort for black
- Resolve black/pylint idiosyncrasies 

Note: I used `--experimental-string-processing` because black was
producing "implicit string concatenation", similar to what described
here: https://github.com/psf/black/issues/1837. While currently this
feature is experimental, it will be enabled by default:
https://github.com/psf/black/issues/2188. After running black with the
new string processing so that the generated code merges these `"hello" "
world"` strings concatenations, then I removed
`--experimental-string-processing` for stability, and regenerated the
code again.

To the reviewer: don't even try to open "Files Changed" tab 😄 It's
better to review commit-by-commit, and ignore `run black and isort`.
2023-06-09 15:08:55 -07:00
Jan Tattermusch
82abb46ed3 improve tty output of run_tests.py and other scripts (#28308) 2021-12-09 07:23:02 +01:00
Richard Belleville
59693b7e72 Migrate Infrastructure Scripts to Python 3 (#27135)
* Run 2to3 on tools directory

* Delete github_stats_tracking

* Re-run 2to3

* Remove unused script

* Remove unused script

* Remove unused line count utility

* Yapf. Isort

* Remove accidentally included file

* Migrate tools/distrib directory to python 3

* Remove unnecessary shebang

* Restore line_count directory

* Immediately convert subprocess.check_output output to string

* Take care of Python 2 shebangs

* Invoke scripts using a Python 3 interpreter

* Yapf. Isort

* Try installing Python 3 first

* See if we have any Python 3 versions installed

* Add Python 3.7 to Windows path

* Try adding a symlink

* Try to symlink differently

* Install six for Python 3

* Run run_interop_tests with python 3

* Try installing six in python3.7 explicitly

* Revert "Try installing six in python3.7 explicitly"

This reverts commit 2cf60d72f388a95d642b2c99a775d88a6248f788.

* And debug some more

* Fix issue with jobset.py

* Add debug for CI failure

* Revert microbenchmark changes
2021-11-08 08:55:25 -08:00
Richard Belleville
2c889a9921 Fix stdout handling in jobset.py (#27493)
* Fix stdout handling in jobset.py

* Apparently ascii was a bad assumption

* Or how about this

* Just ignore non-utf8 characters
2021-10-04 16:00:40 -07:00
Jan Tattermusch
c1bf4e1a2a Revert "Enable Alpine portability test to run under Python 3. (#27464)" (#27485)
This reverts commit 54d4e8f68b.
2021-09-27 10:53:34 -07:00
Richard Belleville
54d4e8f68b Enable Alpine portability test to run under Python 3. (#27464)
* Enable Alpine portability test to run under Python 3.

* Fix other scripts
2021-09-24 10:12:19 -07:00
Richard Belleville
b6cc72f129 Revert "Run 2to3 on tools directory (#26002)" (#27183)
This reverts commit a388361c3d.
2021-08-30 12:29:20 -07:00
Richard Belleville
a388361c3d Run 2to3 on tools directory (#26002)
* Run 2to3 on tools directory

* Delete github_stats_tracking

* Re-run 2to3

* Remove unused script

* Remove unused script

* Remove unused line count utility

* Yapf. Isort

* Remove accidentally included file

* Restore line_count directory
2021-08-30 09:25:21 -07:00
yifeizhuang
48b194f737 release v1.40.0: build gcr images for release, fix python2.7 (#27045) 2021-08-18 08:22:11 -07:00
Lidi Zheng
2231c2ba77 Introduce Python import sorting to our sanity test suite (#26768)
* Add isort_code.sh to sanity tests

* Run tools/distrib/isort_code.sh

* Fine tune the import order for relative imports

* Make pylint and project generation happy

* Fix a few corner cases

* Use --check instead of --diff

* The import order impacts test result somehow

* Make isort print diff and check output at the same time

* Let tools/run_tests/python_utils be firstparty library

* Run isort against latest HEAD
2021-07-26 12:31:21 -07:00
Lidi Zheng
39cc797025 [xDS Proto] Modernize buildgen scripts (#25512)
* [xDS Proto] Modernize buildgen scripts

* This PR only covers some buildgen scripts that will be used by xDS
proto
* This PR also improves the debuggability of some scripts
* Merge with master

* Adopt reviewer's advices
2021-03-02 11:25:01 -08:00
Jan Tattermusch
d446ec036f Merge pull request #24861 from dapeng-mi/master
Bug fix: decode bytes object to string for subprocess.check_output ou…
2021-01-15 17:09:10 +01:00
Sergii Tkachenko
8db79e2e71 Python style: reformat code using updated yapf 0.30.0 2021-01-13 14:00:12 -05:00
dapeng-mi
965aa55c9e Bug fix: add __lt__ method for JobSpec class.
Another exception is found when running "./tools/run_tests/run_tests.py
 -l c++ -c dbg" test in python3 environment. The exception complains
the "<" method is not supported when calling sorted() function to sort
the JobSpec class.

Here is the exception.

./tools/run_tests/run_tests.py -l c++ -c dbg
PASSED: make [time=1.6sec, retries=0:0]

Omitting EPOLLEXCLUSIVE tests

2020-12-01 10:49:42,122 detected port server running version 21
2020-12-01 10:49:42,182 my port server is version 21
Traceback (most recent call last):
  File "./tools/run_tests/run_tests.py", line 1919, in <module>
    build_only=args.build_only)
  File "./tools/run_tests/run_tests.py", line 1800, in _build_and_run
    one_run = set(spec for language in languages
  File "./tools/run_tests/run_tests.py", line 1801, in <genexpr>
    for spec in language.test_specs()
  File "./tools/run_tests/run_tests.py", line 425, in test_specs
    return sorted(out)
TypeError: '<' not supported between instances of 'JobSpec' and 'JobSpec'

Signed-off-by: dapeng-mi <clark_mdp@163.com>
2020-12-04 09:57:57 +08:00
Esun Kim
7be821ac47 Yapf all target python sources 2020-01-03 09:25:10 -08:00
Richard Belleville
666fb1c5ee Make run_tests.py python-version agnostic 2018-11-02 14:18:58 -07:00
Jan Tattermusch
d8056c5906 rename _tempfile -> _logfile 2018-09-26 00:11:51 +02:00
Jan Tattermusch
2488dff74b address comments 2018-09-25 23:36:19 +02:00
Jan Tattermusch
87592fe9d9 support custom logfile name in jobset.py 2018-09-25 23:10:54 +02:00
Jan Tattermusch
62861977f2 run_tests: keep longer logs from individual test cases 2018-05-10 11:30:11 +02:00
Mehrdad Afshari
87cd994b04 Upgrade yapf to 0.20.0
Upgrade yapf version to 0.20.0 and reformat Python files.
2018-01-02 14:40:00 -08:00
ncteisen
0cd6cfefa0 yapf tools/run_tests/sanity 2017-12-11 16:56:44 -08:00
ncteisen
05687c3da9 yapf tools/run_tests/python_utils 2017-12-11 16:54:47 -08:00
Jan Tattermusch
3d1b6c1035 explain retries and jobset.max_time setting 2017-10-16 16:01:12 +02:00
Craig Tiller
a69912cb2c Fixes 2017-10-06 10:27:11 -07:00
Jan Tattermusch
8dbc2364b3 report elapsed time for jobs that time out 2017-10-05 17:15:27 +02:00
Alexander Polcyn
dbfcd45af8 Limit max jobs cpu agnostic way, to avoid overloading the test
environment
2017-10-02 10:05:05 -07:00
Matt Kwong
8e53799f45 Merge pull request #12515 from matt-kwong/fix-perf2
Revert "Revert "Merge pull request #12513 from grpc/revert-12289-sig_hand""
2017-09-15 15:44:37 -07:00
Craig Tiller
2be06b43e7 Make unmeasured CPU costs be 1, not 0
Allows capturing 0 as a CPU cost, which we'll be able to leverage to
increase concurrency (once data has caught up in a few days)
2017-09-12 15:24:49 -07:00
Matt Kwong
69ce380ccc Revert "Merge pull request #12513 from grpc/revert-12289-sig_hand"
This reverts commit 81ad19d4be, reversing
changes made to ed63aac195.
2017-09-12 13:30:51 -07:00
Craig Tiller
0852acd8b3 Revert "Let alarms trigger at end of jobset.py instead of clearing them" 2017-09-12 13:15:03 -07:00
Matt Kwong
738b1bb424 Get rid of have_alarm var in jobset.py 2017-08-29 12:45:53 -07:00
Matt Kwong
3da8c5defb Let alarms at end of jobset.py trigger isntead of clearing 2017-08-24 12:35:04 -07:00
Matt Kwong
5920abc535 Revert "Don't clear alarm in jobset when running performance tests"
This reverts commit c15d32bbe8.
2017-08-24 12:26:05 -07:00
Matt Kwong
c15d32bbe8 Don't clear alarm in jobset when running performance tests 2017-07-10 17:10:27 -07:00
Matt Kwong
60a672b87f Clear alarms in jobset.py when finished running jobs 2017-06-16 14:28:06 -07:00
Jan Tattermusch
7897ae9308 auto-fix most of licenses 2017-06-08 11:22:41 +02:00
Matt Kwong
4e55bf1293 Merge pull request #11348 from matt-kwong/upload_windows
Enable uploading more test results to BQ
2017-05-31 15:16:31 -07:00
Matt Kwong
d8543c4e0f Fix --measure_cpu_costs flag in run_tests.py on Windows 2017-05-31 10:40:07 -07:00
Craig Tiller
46356b72a0 Make jobset more eintr resilient 2017-05-26 15:22:08 +00:00
Craig Tiller
f09957bd04 Recover from more EINTRs 2017-05-15 08:39:17 -07:00
Craig Tiller
9d5d803bbf Small fixes 2017-05-15 07:54:54 -07:00
Matt Kwong
d1f40bd3b3 Make --measure_cpu_costs flag Mac-friendly 2017-05-11 10:29:49 -07:00
Matt Kwong
52ff986f94 Add option to upload Jenkins test result to BQ 2017-05-08 13:52:45 -07:00
Yong Ni
35ee7e7967 Added verbose option to run_interop_test to ease tracing the commands invoked 2017-04-26 17:46:32 -07:00
Craig Tiller
a1ac2a1317 Allow specifying a maximum run time to run_tests 2017-04-21 07:20:38 -07:00
Jan Tattermusch
d159af31fc return tuple from jobset.run when skipping tests 2017-03-10 10:08:53 +01:00
David Garcia Quintas
e6e7b017dd PR comments 2017-02-22 17:13:53 -08:00
David Garcia Quintas
c30b84e6f3 Timestamp test logs 2017-02-21 15:20:09 -08:00
Jan Tattermusch
5c79a3199c cleanup tools/run_tests directory 2016-12-22 10:47:52 +01:00