Commit Graph

3 Commits

Author SHA1 Message Date
Anthony Latsis
04b1ff9991 update-checkout: Do not update repository if not listed in the given branch-scheme
Consider two branch-schemes, where the second is a subset of the first.
Suppose repositories have been cloned using the first branch scheme. Previously,
a successive update using the second branch-scheme would cause update-checkout
to fail in an attempt to query the branch-scheme about the target branch for a
repository it does not map, even though the update, given no further errors, can
be considered successful.
2022-09-24 06:06:08 +03:00
tbkka
6a255ec829 [Python3] Adjust relative import statements to use relative syntax so they work with Py2 and Py3 (#32937)
* Rework a couple of benchmarks to work with both Python2 and Python3

* Adjust relative import statements to use relative syntax

Importing files from "the same directory as this file" was
implicitly supported in Python2.7 but not Python3.  The
syntax here works for both.
2020-07-17 09:06:16 -07:00
Michael Gottesman
a9d384dac3 [update-checkout] Add a simple mock update-checkout test that makes sure that we can clone.
This commit is not meant to completely test update-checkout, but rather create
some scaffolding for testing update-checkout so we can create starter bugs to
fill out the rest of the functionality. Once we have enough testing in place, we
can start refactoring/simplifying update-checkout.

Design
------

This is just a standard python unittest test suite except that the tests expect
an environment variable (UPDATECHECKOUT_TEST_WORKSPACE_DIR) to be set that
specifies the directory that the unittests have for creating mock git repos
during setup/teardown. lit invokes the test by calling the unittests with the
environment variable set to the appropriate temporary directory.

In this temporary directory, each test creates a pristine set of "fake" remote
repos and a test-config.json file that can be passed to update-checkout to work
with these "fake" remote repos. This allows each test that we write to test
various update-checkout functionalities against a pristime set of git repos. I
choose the git clone test, just b/c it was really simple.

NOTE: One can also run the tests locally using the script
test_update_checkout.sh that uses /tmp/workspace as the workspace directory.
2019-06-21 18:25:08 -07:00