api: payload_unittest.py: Move payload cache directory.
Running the chromite unit tests leaves behind the payload cache dir.
Patch the payload cache directory with a tempdir for the unittests
to avoid the orphaned directory. Add TODO for investigating more
permanent solutions.
BUG=b:223433932
TEST=run_tests does not leave behind .paygen_cache
Change-Id: I0acb8fff9c811f9a836636a7b934ea5126915294
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/3858036
Auto-Submit: Alex Klein <saklein@chromium.org>
Reviewed-by: Sloan Johnson <sloanjohnson@google.com>
Tested-by: Alex Klein <saklein@chromium.org>
Commit-Queue: Sloan Johnson <sloanjohnson@google.com>
Commit-Queue: Alex Klein <saklein@chromium.org>
diff --git a/api/controller/payload.py b/api/controller/payload.py
index dc11e0c..343baa1 100644
--- a/api/controller/payload.py
+++ b/api/controller/payload.py
@@ -29,6 +29,8 @@
('full_update', 'tgt_unsigned_image'),
('full_update', 'tgt_signed_image'))
+# TODO: Remove to use the standard cache directory if possible, otherwise
+# document why it cannot be used and preferably move outside of the repo.
_DEFAULT_PAYGEN_CACHE_DIR = '.paygen_cache'
# We have more fields we might validate however, they're either