Commit Graph

2 Commits

Author SHA1 Message Date
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