Skip to content

Commit 547b32d

Browse files
rtakacsrobertsipka
authored andcommitted
Add support to enable skipped tests. (#228)
JSRemoteTest-DCO-1.0-Signed-off-by: Roland Takacs [email protected]
1 parent bad9db0 commit 547b32d

File tree

5 files changed

+94
-69
lines changed

5 files changed

+94
-69
lines changed

jstest/testrunner/skiplist/iotjs-skiplist.json

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"rpi2": {
3+
"skip": {
4+
"testsets": [],
5+
"testfiles": []
6+
},
7+
"enable": []
8+
},
9+
"stm32f4dis": {
10+
"skip": {
11+
"testsets": [],
12+
"testfiles": []
13+
},
14+
"enable": []
15+
},
16+
"artik053": {
17+
"skip": {
18+
"testsets": [],
19+
"testfiles": [
20+
{ "name": "test_tls.js", "reason": "Error: SSL setup failed (no enough memory for the test)" }
21+
]
22+
},
23+
"enable": []
24+
},
25+
"artik530": {
26+
"skip": {
27+
"testsets": [],
28+
"testfiles": []
29+
},
30+
"enable": []
31+
}
32+
}

jstest/testrunner/skiplist/jerryscript-skiplist.json

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"rpi2": {
3+
"skip": {
4+
"testsets": [
5+
{ "name": "es5.1", "reason": "es5.1 profile is not enabled." }
6+
],
7+
"testfiles": [
8+
{ "name": "N.compact-profile-error.js", "reason": "Compact profile is not enabled." }
9+
]
10+
},
11+
"enable": []
12+
},
13+
"stm32f4dis": {
14+
"skip": {
15+
"testsets": [
16+
{ "name": "es5.1", "reason": "es5.1 profile is not enabled." }
17+
],
18+
"testfiles": [
19+
{ "name": "parser-oom.js", "reason": "Requires exactly 512KB memory." },
20+
{ "name": "N.compact-profile-error.js", "reason": "Compact profile is not enabled." },
21+
{ "name": "regression-test-issue-1555.js", "reason": "There's not enough memory to run." },
22+
{ "name": "regression-test-issue-1997.js", "reason": "There's not enough memory to run." },
23+
{ "name": "regression-test-issue-2451.js", "reason": "There's not enough memory to run." },
24+
{ "name": "regression-test-issue-2452.js", "reason": "There's not enough memory to run." },
25+
{ "name": "regression-test-issue-2453.js", "reason": "There's not enough memory to run." }
26+
]
27+
},
28+
"enable": []
29+
},
30+
"artik053": {
31+
"skip": {
32+
"testsets": [
33+
{ "name": "es5.1", "reason": "es5.1 profile is not enabled." }
34+
],
35+
"testfiles": [
36+
{ "name": "parser-oom.js", "reason": "Requires exactly 512KB memory." },
37+
{ "name": "N.compact-profile-error.js", "reason": "Compact profile is not enabled." },
38+
{ "name": "regression-test-issue-1555.js", "reason": "There's not enough memory to run." },
39+
{ "name": "regression-test-issue-1997.js", "reason": "There's not enough memory to run." },
40+
{ "name": "regression-test-issue-2451.js", "reason": "There's not enough memory to run." },
41+
{ "name": "regression-test-issue-2452.js", "reason": "There's not enough memory to run." },
42+
{ "name": "regression-test-issue-2453.js", "reason": "There's not enough memory to run." }
43+
]
44+
},
45+
"enable": []
46+
}
47+
}

jstest/testrunner/skiplist/skiplist.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ def __init__(self, env, device):
3030
self.builtin_features = buildinfo[1]
3131
self.stability = buildinfo[2]
3232

33-
# Read the local skiplist.
34-
self.skiplist = self._read_skiplist()
33+
# Read the test_descriptor file that defines which tests
34+
# should be enabled or skipped.
35+
self.test_descriptor = self._read_test_descriptor()
3536

3637
def contains(self, testset, test):
3738
'''
@@ -76,29 +77,32 @@ def _skip_iotjs_test(self, test):
7677

7778
return False
7879

79-
def _read_skiplist(self):
80+
def _read_test_descriptor(self):
8081
'''
8182
Read the local skiplists.
8283
'''
83-
skiplists = {
84-
'iotjs': 'iotjs-skiplist.json',
85-
'jerryscript': 'jerryscript-skiplist.json'
84+
descriptors = {
85+
'iotjs': 'iotjs-test-descriptor.json',
86+
'jerryscript': 'jerryscript-test-descriptor.json'
8687
}
8788

88-
skipfile = utils.join(paths.SKIPLIST_PATH, skiplists[self.app])
89-
skiplist = utils.read_json_file(skipfile)
89+
descriptor_file = utils.join(paths.SKIPLIST_PATH, descriptors[self.app])
90+
descriptor_info = utils.read_json_file(descriptor_file)
9091

91-
return skiplist[self.device_type]
92+
return descriptor_info[self.device_type]
9293

9394
def _find_in_skiplist(self, testset, test):
9495
'''
9596
Find element in the skiplist.
9697
'''
97-
for obj in self.skiplist['testsets']:
98+
if test['name'] in self.test_descriptor['enable']:
99+
return None
100+
101+
for obj in self.test_descriptor['skip']['testsets']:
98102
if obj['name'] == testset:
99103
return obj
100104

101-
for obj in self.skiplist['testfiles']:
105+
for obj in self.test_descriptor['skip']['testfiles']:
102106
if obj['name'] == test['name']:
103107
return obj
104108

0 commit comments

Comments
 (0)