sanitycheck: tests: adapt testsuite to new filter

Make testsuite pass with new changes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2020-07-29 08:24:24 -04:00 committed by Kumar Gala
commit 994bd5b876
3 changed files with 18 additions and 8 deletions

View file

@ -1,6 +1,7 @@
tests: tests:
test_a.check_1: test_a.check_1:
tags: test_a tags: test_a
build_only: True
test_a.check_2: test_a.check_2:
extra_args: CONF_FILE="test.conf" extra_args: CONF_FILE="test.conf"
tags: test_a tags: test_a

View file

@ -43,12 +43,12 @@ def test_check_build_or_run(class_testsuite, monkeypatch, all_testcases_dict, pl
testcase.slow = slow testcase.slow = slow
testinstance = TestInstance(testcase, platform, class_testsuite.outdir) testinstance = TestInstance(testcase, platform, class_testsuite.outdir)
run = testinstance.check_build_or_run(build_only, slow, device_testing, fixture) run = testinstance.check_runnable(slow, device_testing, fixture)
b, r = expected _, r = expected
assert run == r assert run == r
monkeypatch.setattr("os.name", "nt") monkeypatch.setattr("os.name", "nt")
run = testinstance.check_build_or_run() run = testinstance.check_runnable()
assert not run assert not run
TESTDATA_2 = [ TESTDATA_2 = [

View file

@ -221,7 +221,7 @@ def test_apply_filters_part1(class_testsuite, all_testcases_dict, platforms_list
assert all(x in list(discards.values()) for x in [expected_discards]) assert all(x in list(discards.values()) for x in [expected_discards])
TESTDATA_PART2 = [ TESTDATA_PART2 = [
("device_testing", "True", "Not runnable on device"), ("runnable", "True", "Not runnable on device"),
("exclude_tag", ['test_a'], "Command line testcase exclude filter"), ("exclude_tag", ['test_a'], "Command line testcase exclude filter"),
("run_individual_tests", ['scripts/tests/sanitycheck/test_data/testcases/tests/test_a/test_a.check_1'], "Testcase name filter"), ("run_individual_tests", ['scripts/tests/sanitycheck/test_data/testcases/tests/test_a/test_a.check_1'], "Testcase name filter"),
("arch", ['arm_test'], "Command line testcase arch filter"), ("arch", ['arm_test'], "Command line testcase arch filter"),
@ -236,13 +236,22 @@ def test_apply_filters_part2(class_testsuite, all_testcases_dict,
Part 2 : Response of apply_filters function (discard dictionary) have Part 2 : Response of apply_filters function (discard dictionary) have
appropriate values according to the filters appropriate values according to the filters
""" """
class_testsuite.platforms = platforms_list class_testsuite.platforms = platforms_list
class_testsuite.testcases = all_testcases_dict class_testsuite.testcases = all_testcases_dict
kwargs = {extra_filter : extra_filter_value, kwargs = {
"exclude_platform" : ['demo_board_1'], "platform" : ['demo_board_2']} extra_filter : extra_filter_value,
"exclude_platform" : [
'demo_board_1'
],
"platform" : [
'demo_board_2'
]
}
discards = class_testsuite.apply_filters(**kwargs) discards = class_testsuite.apply_filters(**kwargs)
assert type(list(discards.keys())[0]).__name__ == "TestInstance" assert discards
assert list(dict.fromkeys(discards.values())) == [expected_discards] for d in discards.values():
assert d == expected_discards
TESTDATA_PART3 = [ TESTDATA_PART3 = [