From 0124d938848301f8768d715b20dc1c4af486dd33 Mon Sep 17 00:00:00 2001 From: duerpei Date: Wed, 8 Mar 2023 13:48:03 +0800 Subject: agl-test-framework: solve bugs in the test framework Fixed problems: 1.When all the executed test suites are skipped, no new summary- report is generated. 2.When there is test suite successfully executed, the generated summary-report will contain the test suites which have logs in the "/tmp-log" directory, rather than just the test suites which has just executed. Correction method: 1.Move the function in "conftest.py" to "agl_test_report.py" and call it in the "agl-test" script to ensure that the function will be executed. 2.Set the timestamp to record the information of each executed test suite or skipped test suite to the file of "test_list_timestamp". And generate a summar-report according to the above file. Bug-AGL: SPEC-4345 Signed-off-by: duerpei Change-Id: I47bfd09706e37ce6bdc13f3f9f266bc62f74f777 --- tests/LTP/agl_test_ltp_base.py | 6 ++++++ tests/LTP/posix_conformance_tests/run_tests.py | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'tests/LTP') diff --git a/tests/LTP/agl_test_ltp_base.py b/tests/LTP/agl_test_ltp_base.py index 44d5325..982e60d 100644 --- a/tests/LTP/agl_test_ltp_base.py +++ b/tests/LTP/agl_test_ltp_base.py @@ -109,6 +109,10 @@ class LTPBase(AGLBaseTest): test_file = pathlib.Path(self.LTPTEST + self.test_name) check_test_file = test_file.is_file() + if((check_common and check_runltp_script and check_test_file) == False): + #write test suite info to file + self.write_skip_info() + return check_common and check_runltp_script and check_test_file def log_process(self): @@ -146,4 +150,6 @@ class LTPBase(AGLBaseTest): def run_ltp_test(self, case_name): if(self.precheck() == True): self.run_test_fun(case_name) + #write test suite info to file + self.write_run_info() self.log_process() diff --git a/tests/LTP/posix_conformance_tests/run_tests.py b/tests/LTP/posix_conformance_tests/run_tests.py index 5806fca..9d8405d 100644 --- a/tests/LTP/posix_conformance_tests/run_tests.py +++ b/tests/LTP/posix_conformance_tests/run_tests.py @@ -88,6 +88,8 @@ def testbase(): instance = Conformance_Base() # run all cases instance.run_all_tests() + #write test suite info to file + instance.write_run_info() # do log process instance.log_process() yield instance @@ -96,7 +98,11 @@ def testbase(): def local_precheck(): checker = Conformance_Base() - return checker.precheck() + output = checker.precheck() + if(output == False): + #write test suite info to file + instance.write_skip_info() + return output skip_msg = "The current environment does not match the test requirements." pytestmark = pytest.mark.skipif(local_precheck() == False, reason = skip_msg) -- cgit 1.2.3-korg