You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
depot_tools/tests
Raul Tambre 5d284fdf48 gclient_utils: buffer output as bytestrings in Annotated
In Python 3 byestrings and normal strings can't be concatenated.
To fix this we buffer as bytestrings in the Annotated wrapper.
We can't decode to a string because the output might come byte-by-byte, so it doesn't work with Unicode characters like ✔.

Also had to update gclient_test.py, where double-wrapping stdout with Annotated caused made output not work and include_zero=True working caused other unintended side-effects.

Example error from "fetch chromium":
Traceback (most recent call last):
  File "C:\Google\depot_tools\gclient_scm.py", line 1045, in _Clone
    self._Run(clone_cmd, options, cwd=self._root_dir, retry=True,
  File "C:\Google\depot_tools\gclient_scm.py", line 1370, in _Run
    gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
  File "C:\Google\depot_tools\gclient_utils.py", line 583, in CheckCallAndFilter
    show_header_if_necessary(needs_header, attempt)
  File "C:\Google\depot_tools\gclient_utils.py", line 533, in show_header_if_necessary
    stdout_write(header.encode())
  File "C:\Google\depot_tools\gclient_utils.py", line 391, in write
    obj[0] += out
TypeError: can only concatenate str (not "bytes") to str

Bug: 984182
Change-Id: If7037d30e9faf524f2405258281f6e6cd0bcdcae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1778745
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
6 years ago
..
gstools Scripts to download files from google storage based on sha1 sums 12 years ago
OWNERS [ninjalog_uploader] add tests 6 years ago
auth_test.py [auth] cache LUCI_CONTEXT local_auth parameters. 7 years ago
bot_update_coverage_test.py Revert "Reland "depot_tools: Move six to depot_tools' .vpython"" 6 years ago
cipd_bootstrap_test.py [cipd] Add presubmit support for checking *.digests file. 7 years ago
download_from_google_storage_unittest.py Convert print statements to Python 3 style 6 years ago
fix_encoding_test.py Fix invalid Python file encoding "utf8" 6 years ago
gclient_eval_unittest.py Add support for multi argument ands and ors, and the same precedence with 6 years ago
gclient_scm_test.py tests/gclient_scm_test.py: Fix invalid escape sequences in regex strings 6 years ago
gclient_smoketest.py Make gclient.py warn on Python 3 6 years ago
gclient_test.py gclient_utils: buffer output as bytestrings in Annotated 6 years ago
gclient_utils_test.py gclient_utils: buffer output as bytestrings in Annotated 6 years ago
git_cache_test.py depot_tools: Run git_cache_test and git_dates_test on Python 3. 6 years ago
git_cl_creds_check_report.txt git cl creds-check: improve report and give better recommendation. 8 years ago
git_cl_test.py git-cl: Clean-up 6 years ago
git_common_test.py depot_tools: Run git_common_test in Python 3 6 years ago
git_dates_test.py depot_tools: Run git_cache_test and git_dates_test on Python 3. 6 years ago
git_drover_test.py Reland "Use core.quotePath=false when git is listing files" 7 years ago
git_footers_test.py depot_tools: Run git_footers_test on Python 3. 6 years ago
git_hyper_blame_test.py depot_tools: Run git_common_test in Python 3 6 years ago
git_number_test.py Disable tests that break because of git 2.4 10 years ago
git_rebase_update_test.py Revert "Fix semantics of git new-branch --upstream" 6 years ago
gsutil_test.py download_from_google_storage: Fix tests and rename 8 years ago
metrics_test.py depot_tools: Run some tests on Python 3 on the bots. 6 years ago
ninjalog_uploader_test.py [ninjalog] fully anonymize build stats before sending 6 years ago
owners_finder_test.py Skip files owned by reviewers when quering for missing owners. 7 years ago
owners_unittest.py owners: add owners_rooted_at_file() 6 years ago
presubmit_unittest.py Make presubmit bark at FIXED= in CL description 6 years ago
recipes_test.py [recipes] Remove deprecated (ignored) --use-bootstrap flag 6 years ago
roll_dep_test.py roll-dep: Use gclient setdep/getdep. 7 years ago
scm_unittest.py depot_tools: Run some tests on Python 3 on the bots. 6 years ago
subprocess2_test.py depot_tools: Run some tests on Python 3 on the bots. 6 years ago
upload_to_google_storage_unittest.py Convert except statements to be Python 3 compatible 6 years ago
watchlists_unittest.py depot_tools: Make watchlist tests use mock and remove pymox. 6 years ago