32 Commits

Author SHA1 Message Date
Ashesh Vidyut
d312b25f71 [Python] Upgrade black (#39774)
### Description

* Upgrade Black to use the latest version. [Pypi-Black (25.1.0)](https://pypi.org/project/black/)
* Run `black` to reformat files to make the sanity tests pass in CI

**Note - all the file changes are by `black` command** except for the black version bump which is

https://github.com/grpc/grpc/pull/39774/files#diff-0512cc461bc04ba96303b81398cc5926bd16e120cbe48decd0c44ea0a8fb76e6R36

### Testing
CI

Closes #39774

PiperOrigin-RevId: 769640677
2025-06-10 08:24:10 -07:00
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
3a024ea40c Avoid extremely slow kokoro job finalization by moving workspace to a non-synced directory on kokoro workers. (#28259)
* support "move and respawn" for kokoro jobs

* delete_nonartifacts.sh no longer needed

* bazel distribtest dont publish any artifacts

* try the altsrc respawn for selected jobs

* use altsrc for all windows CI jobs

* use altsrc for all macos CI jobs

* only move files under src/github

* fix uploading artifacts on windows
2021-12-03 19:41:14 +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
eada6c6e56 Update Alpine Test Image to Use Python 3.8 (#27415)
* Upgrade Alpine to Python 3.8

* Upgrade docker image to use 3.8
2021-09-20 19:38:36 -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
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
Eric Gribkoff
9e1110cb11 Split logs by test case and run client separately for each test 2020-03-22 23:56:44 -07:00
Esun Kim
7be821ac47 Yapf all target python sources 2020-01-03 09:25:10 -08:00
chentanjun
05b3eeff77 fix-up some spelling mistakes 2019-09-25 23:29:47 +08:00
Jan Tattermusch
f268db6f33 yapf format code 2019-09-11 04:56:10 -04:00
Jan Tattermusch
babb70705d fixup in report_utils.py 2019-09-11 10:05:54 +02:00
Jan Tattermusch
11222b78c2 only use multi_target report for selected languages 2019-09-11 09:27:59 +02:00
Jan Tattermusch
9e0eb19ca4 generate separate sponge target for each test suite 2019-09-11 09:02:54 +02:00
Richard Belleville
35c6e5541b Restore unnecessary 2to3 change 2018-11-05 09:40:59 -08:00
Richard Belleville
666fb1c5ee Make run_tests.py python-version agnostic 2018-11-02 14:18:58 -07:00
Jan Tattermusch
0e0cc1700f display test suite names with dots correctly 2018-05-19 03:52:16 +02:00
ncteisen
05687c3da9 yapf tools/run_tests/python_utils 2017-12-11 16:54:47 -08:00
Yong Ni
5f32c517b1 Added timestamp to the xml report and minor changes to the API per review feedback. 2017-07-05 11:43:29 -07:00
Yong Ni
b7ea4ab4d7 Created test driver to run matrix test against different docker images in GCR and generate a Junit like test result file. 2017-06-30 09:41:31 -07:00
Jan Tattermusch
7897ae9308 auto-fix most of licenses 2017-06-08 11:22:41 +02:00
Matt Kwong
c7676a3d00 Merge pull request #10967 from matt-kwong/upload_results2
Add option to upload Jenkins test result to BQ
2017-05-09 15:38:31 -07:00
Matt Kwong
52ff986f94 Add option to upload Jenkins test result to BQ 2017-05-08 13:52:45 -07:00
Jan Tattermusch
98ae39c121 show error details in internal_ci 2017-05-04 21:50:00 +02:00
Jan Tattermusch
883fe50140 add error and failure count to sponge log 2017-05-04 14:55:16 +02:00
Jan Tattermusch
ac9c9f93b9 reports can create subdirs 2017-04-29 12:19:36 +02:00
Alexander Polcyn
50fdc8ab19 add http2 server test for unary calls that uses small frames and padding 2017-03-22 13:46:51 -07:00
Siddharth Shukla
d194f59939 Make testing scripts python3.x compatible
Update run_tests/*.py to use six based isomorphisms and print function
from __future__ module.
2017-03-12 17:47:53 +01:00
Adele Zhou
429e5607f7 Fix interop HTML report. 2017-02-24 10:49:50 -08:00
Matt Kwong
c830eb5b6b Update interop html template location 2016-12-22 12:10:25 -08:00
Jan Tattermusch
5c79a3199c cleanup tools/run_tests directory 2016-12-22 10:47:52 +01:00