Skip to content

Commit

Permalink
Add test for max_runtime in LTP implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
acerv committed Aug 17, 2023
1 parent fe29e7d commit 0992f72
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions libkirk/tests/test_ltp.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def prepare_tmpdir(self, tmpdir):
tests = {}
for i in range(self.TESTS_NUM, self.TESTS_NUM * 2):
name = f"slow_test0{i}"
tests[name] = {}
tests[name] = {"max_runtime": "10"}

metadata_d = {"tests": tests}
metadata = tmpdir.mkdir("metadata") / "ltp.json"
Expand Down Expand Up @@ -123,11 +123,21 @@ async def test_find_suite(self, framework, sut, tmpdir):
str(tmpdir),
"testcases",
"bin")
assert test.parallelizable
assert not test.parallelizable
assert "LTPROOT" in test.env
assert "TMPDIR" in test.env
assert "LTP_COLORIZE_OUTPUT" in test.env

async def test_find_suite_max_runtime(self, sut, tmpdir):
"""
Test find_suite method when max_runtime is defined.
"""
framework = LTPFramework()
framework.setup(root=str(tmpdir), max_runtime=5)

suite = await framework.find_suite(sut, "slow_suite")
assert len(suite.tests) == 0

async def test_read_result_passed(self, framework):
"""
Test read_result method when test passes.
Expand Down

0 comments on commit 0992f72

Please sign in to comment.