devserver: make artifact names globs by default
What this means is that, by default, we'll be using a glob expression
(i.e. a path that may contain shell-style wildcards) instead of a regex
to identify artifacts. We are still allowing artifacts to be defined by
a regex, as this is useful for some purposes such as disallowing certain
file name patterns; this semantics, however, needs to be specifically
selected via a flag.
Some additional changes included:
* Eliminate enforcing a single file in gsutil_util.GetGSNamesWithWait();
this is already done in the caller function and there's no need to
complicate the otherwise generic logic in this module.
* Have DeltaPayloadsArtifact override various name filtering parameters
internally; letting the user define these may cause inconsistencies
(especially given the glob vs regex semantics), makes it less robust
and is not needed in practice.
* Fixes passing of dictionary args (as opposed to list args) to artifact
objects via artifact factory.
* Fixes a great many gpylint errors/warnings.
BUG=chromium:280220
TEST=Unit tests
TEST=gpylint
Change-Id: I9ea59b7f8962a71f7b387b99b0577932e753c2eb
Reviewed-on: https://chromium-review.googlesource.com/167434
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/build_artifact_unittest.py b/build_artifact_unittest.py
index fddfccb..82011d0 100755
--- a/build_artifact_unittest.py
+++ b/build_artifact_unittest.py
@@ -103,7 +103,7 @@
def testDeltaPayloadsArtifact(self):
"""Downloads delta paylaods from test bucket."""
artifact = build_artifact.DeltaPayloadsArtifact(
- self.work_dir, _TEST_GOLO_FOR_DELTAS, '.*_delta_.*', _DELTA_VERSION)
+ self.work_dir, _TEST_GOLO_FOR_DELTAS, 'DONTCARE', _DELTA_VERSION)
artifact.Process(False)
nton_dir = os.path.join(self.work_dir, 'au', '%s_nton' % _DELTA_VERSION)
mton_dir = os.path.join(self.work_dir, 'au', '%s_mton' % _DELTA_VERSION)
@@ -114,7 +114,7 @@
"""Downloads and stages a zip file and extracts a test image."""
artifact = build_artifact.ZipfileBuildArtifact(
self.work_dir, _TEST_GOLO_ARCHIVE, build_artifact.IMAGE_FILE,
- _VERSION, ['chromiumos_test_image.bin'])
+ _VERSION, files_to_extract=['chromiumos_test_image.bin'])
artifact.Process(False)
self.assertTrue(os.path.exists(os.path.join(
self.work_dir, 'chromiumos_test_image.bin')))
@@ -123,7 +123,7 @@
"""Downloads and stages a zip file while excluding all large files."""
artifact = build_artifact.ZipfileBuildArtifact(
self.work_dir, _TEST_GOLO_ARCHIVE, build_artifact.IMAGE_FILE,
- _VERSION, None, ['*.bin'])
+ _VERSION, exclude=['*.bin'])
artifact.Process(False)
self.assertFalse(os.path.exists(os.path.join(
self.work_dir, 'chromiumos_test_image.bin')))