Merge pull request #396 from codeflash-ai/e2e-test-discovery-fixes

Fix broken test discovery in end to end test CF-203
This commit is contained in:
ihitamandal 2024-03-11 18:03:22 -04:00 committed by GitHub
commit abd9375262
2 changed files with 11 additions and 1 deletions

View file

@ -91,7 +91,7 @@ def parse_args() -> Namespace:
type=str,
help="Path to the test directory of the project, where all the tests are located.",
)
parser.add_argument("--test-framework", choices=["pytest", "unittest"])
parser.add_argument("--test-framework", choices=["pytest", "unittest"], default="pytest")
parser.add_argument(
"--config-file",
type=str,

View file

@ -15,6 +15,8 @@ def main():
"bubble_sort.py",
"--function",
"sorter",
"--test-framework",
"pytest",
"--tests-root",
str(test_root),
"--module-root",
@ -52,6 +54,14 @@ def main():
improvement_x > 300
), f"Performance improvement rate was {improvement_x}x, which was not above 300x"
# Check for the line indicating the number of discovered existing unit tests
unit_test_search = re.search(
r"Discovered (\d+) existing unit tests",
stdout,
)
num_unit_tests = int(unit_test_search.group(1))
assert num_unit_tests > 0, f"Could not find existing unit tests"
if __name__ == "__main__":
main()