mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-11 06:24:04 +00:00
system-test: Allow skipping coverage
Enabling coverage near-doubles the incremental build time and adds overhead to individual tests on the order of **5-10x** or more. It's not essential to have this for quick local system-test runs, so add an option to disable it.
This commit is contained in:
+4
-2
@@ -310,7 +310,9 @@ class BaseTest(object):
|
||||
|
||||
if command[0] == "aptly":
|
||||
aptly_testing_bin = Path(__file__).parent / ".." / "aptly.test"
|
||||
command = [str(aptly_testing_bin), f"-test.coverprofile={Path(self.coverage_dir) / self.__class__.__name__}-{uuid4()}.out", *command[1:]]
|
||||
command = [str(aptly_testing_bin), *command[1:]]
|
||||
if self.coverage_dir is not None:
|
||||
command.insert(1, f"-test.coverprofile={Path(self.coverage_dir) / self.__class__.__name__}-{uuid4()}.out")
|
||||
|
||||
if self.faketime:
|
||||
command = ["faketime", os.environ.get("TEST_FAKETIME", "2025-01-02 03:04:05")] + command
|
||||
@@ -337,7 +339,7 @@ class BaseTest(object):
|
||||
if is_aptly_command:
|
||||
# remove the last two rows as go tests always print PASS/FAIL and coverage in those
|
||||
# two lines. This would otherwise fail the tests as they would not match gold
|
||||
matches = re.findall(r"((.|\n)*)EXIT: (\d)\n.*\ncoverage: .*", raw_output)
|
||||
matches = re.findall(r"((.|\n)*)EXIT: (\d)\n.*(?:\ncoverage: .*|$)", raw_output)
|
||||
if not matches:
|
||||
raise Exception("no matches found in command output '%s'" % raw_output)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user