Commit Graph

8 Commits (04afb4b256a1aab562b0fcfaf7cd9ffe4ec42c1b)

Author SHA1 Message Date
Josip Sokcevic c1fd44b01a Set cache-control when uploading to google storage
R=gavinmak@google.com

Bug: 585752
Change-Id: I25ece89abd09ad509807a7db0403bac0f5ebdd4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3171825
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
3 years ago
Edward Lesmes 94d6f48ba1 gsutil: Decode output from subprocess.
Bug: 1007872, 1009819
Change-Id: Icb24badc0429012dc66912d7d35e03a456512787
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1894354
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Raphael Kubo da Costa 1ab0a72d10 Make upload_to_google_storage.py and tests work with Python 3.
Call decode() and encode() appropriately to manipulate bytes and strings.

Bug: 984182, 1009819
Change-Id: I8a73788ab912d6c6682012308954e4ab4df5fa98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1859998
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Raphael Kubo da Costa 0ca844e294 upload_to_google_storage_unittest.py: Make StringIO usage Python 3-compatible
There is no StringIO module in Python 3, it is now in the io module. Add
some code to make it work with both versions.

Bug: 1009819
Change-Id: I7be020735916f6181beaa3a2beb7e1902c38ad31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1859996
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Raphael Kubo da Costa 2b034d469f Make the queue module work with both Python 2 and Python 3.
The module is called "Queue" in Python 2, and "queue" in Python 3. Use the
same try-ImportError check that's already present in some other files in
depot_tools to make both download_from_google_storage and
upload_to_google_storage work.

Bug: 1007872, 1009819
Change-Id: I8177cd251cbaf8313f41708036c4f36aa6d8bfe2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1859994
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Raul Tambre 7c93846385 Convert except statements to be Python 3 compatible
Ran "2to3 -w -n -f except ./".

The scripts still work with Python 2.
There are no intended behaviour changes.

Bug: 942522
Change-Id: Ifa274cb83f74cfa8ce092fffbb88f3ab5309e72c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1607841
Commit-Queue: Raul Tambre <raul@tambre.ee>
Auto-Submit: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
6 years ago
Raphael Kubo da Costa dce9b6295f tests: Use the right clean up method name for some test cases.
In Python land, the method run once a test method runs is called tearDown(),
not cleanUp(). In other words, the existing methods were never called and we
were always leaving lots of "gstools_test*" directories in /tmp.

Change-Id: Ib1de95c7ba92922b98571780f389237de0dcb253
Reviewed-on: https://chromium-review.googlesource.com/753383
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago
Ryan Tseng 83fd81f8a4 download_from_google_storage: Fix tests and rename
the tests haven't been ran by presumbit for a while because of the plural in
the filename.

At some point some post "gsutil cp" file checking happened, which
broke the tests.  This adds a callback to the fake gsutil cp so
that the expect file is copied over.

This also removes "gsutil version" checking from gsutil.py
and just assume that if the file exists, then it's good, which
should shave about 1-2s off of each gsutil.py call.

Bug: 772740,776311
Change-Id: I4fef62cfd46a849afed1f095dd6a96069376d13d
Reviewed-on: https://chromium-review.googlesource.com/707758
Commit-Queue: Ryan Tseng <hinoka@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago