-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_Vim.py
50 lines (42 loc) · 2.42 KB
/
_Vim.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from fabric import Connection
# Analytics modules
from Container import Container
class Vim(Container):
""" Vim class """
def __init__(self, _image, _user, _pwd, _repeats):
Container.__init__(self, _image, _user, _pwd, _repeats)
# set variables
if self.offline:
self.path = self.omnirun("realpath 'repos/vim'").stdout.strip()
else:
self.path = '/home/vim'
self.source_path = '/home/vim/src'
# set timeout (in seconds) for the test suite to run
self.timeout = 1500 # for revisions before 8.0.0000 400 suffices, later revs have more tests
self.tsuite_path = ('src/testdir',)
self.ignore_coverage_from = ('/usr/include/*','*testdir*')
def compile(self):
""" compile Vim """
with self.conn.cd(self.path):
# Run tests excluding gui tests (was default behaviour pre-8.0)
result = self.conn.run("su regular -c \"CFLAGS='-fprofile-abs-path --coverage' LDFLAGS='--coverage' ./configure --without-x --disable-gtktest --with-features=normal --disable-gui\" && " +
"su regular -c \"make -j`grep -c '^processor' /proc/cpuinfo`\"", warn=True)
# make with as many jobs as there are cores
if result.failed:
self.compileError = True
def make_test(self):
""" run the test suite """
super(Vim, self).make_test()
# if compile failed, skip this step
if not self.compileError:
print(f"Repeats: {self.repeats}")
with self.conn.cd(self.path):
# Disable tests that fail locally but pass on Travis on latest revision (05a627c3d, Apr 2023)
# Unclear if container missing some dependency or container issue (like mounting)
# Coverage and related metrics should be unaffected
for i in range(self.repeats):
result = self.conn.run(f"timeout -s SIGKILL {self.timeout} su regular -c 'export TEST_MAY_FAIL=Test_strftime,Test_opt_set_keycode,Test_set_completion,Test_disassemble_closure_in_loop && make test'", warn=True)
# SIGKILL due to subprocesses (su regular -c ...) not being killed by SIGTERM (a vim-only mem error, rev f4c5fcb)
if result.failed:
self.maketestError = result.return_code
self.exit_status_list.append(result.return_code)