Skip to content

Commit de85cf8

Browse files
committed
Exclude non-Windows and non-ipy tests automatically
1 parent 98d304c commit de85cf8

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

test/atest/stopping.robot

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ Stop Remote Server
88
Stop Remote Server
99

1010
SIGINT
11-
Skip On Windows
12-
Send Signal To Remote Server SIGINT
11+
[Tags] no-windows
12+
Send Signal To Process SIGINT
1313

1414
SIGHUP
15-
Skip On Windows
16-
Send Signal To Remote Server SIGHUP
15+
[Tags] no-windows
16+
Send Signal To Process SIGHUP
1717

1818
SIGTERM
19-
Skip On Windows
20-
Send Signal To Remote Server SIGTERM
19+
[Tags] no-windows
20+
Send Signal To Process SIGTERM
2121

2222
*** Keywords ***
2323
Start Server
@@ -28,17 +28,7 @@ Server Should Be Started
2828
Run Keyword ${TEST NAME}.Passing
2929

3030
Server Should Be Stopped
31-
Return From Keyword If "skip" in @{TEST TAGS}
3231
Server Should Be Stopped And Correct Messages Logged
3332
Run Keyword And Expect Error Connection to remote server broken: *
3433
... Server Should Be Started
3534
[Teardown] Run Keyword And Ignore Error ${TEST NAME}.Stop Remote Server
36-
37-
Skip On Windows
38-
Run Keyword If "${:}" == ";" Fail Skipped on Windows skip
39-
40-
Send Signal To Remote Server
41-
[Arguments] ${signal}
42-
[Documentation] Send signal to server, not to possible wrapper (e.g. jython) running it.
43-
${pid}= Run Keyword ${TEST NAME}.Get PID
44-
Evaluate os.kill(${pid}, signal.${signal}) os,signal

test/run.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
from __future__ import print_function
2727

2828
from os.path import abspath, dirname, exists, join
29-
from os import mkdir
30-
from shutil import rmtree
29+
import os
30+
import shutil
3131
import shlex
3232
import sys
3333
import subprocess
@@ -46,8 +46,8 @@
4646
arguments = sys.argv[2:]
4747

4848
if exists(results):
49-
rmtree(results)
50-
mkdir(results)
49+
shutil.rmtree(results)
50+
os.mkdir(results)
5151

5252
if not arguments:
5353
print('Running unit tests with "%s".' % interpreter)
@@ -59,11 +59,18 @@
5959
sys.exit(rc)
6060
arguments = [join(curdir, 'atest')]
6161

62-
command = ['python', '-m', 'robot.run',
63-
'--variable', 'INTERPRETER:%s' % interpreter,
64-
'--doc', 'Remote server tests on "%s"' % interpreter,
65-
'--metadata', 'Server_Interpreter:%s' % interpreter,
66-
'--output', output, '--log', 'NONE', '--report', 'NONE'] + arguments
62+
excludes = []
63+
if os.sep == '\\':
64+
excludes.extend(['--exclude', 'no-windows'])
65+
if 'ipy' in interpreter:
66+
excludes.extend(['--exclude', 'no-ipy'])
67+
command = [
68+
'python', '-m', 'robot.run',
69+
'--variable', 'INTERPRETER:%s' % interpreter,
70+
'--doc', 'Remote server tests on "%s"' % interpreter,
71+
'--metadata', 'Server_Interpreter:%s' % interpreter,
72+
'--output', output, '--log', 'NONE', '--report', 'NONE'
73+
] + excludes + arguments
6774
print('Running acceptance tests with command:\n%s' % ' '.join(command))
6875
rc = subprocess.call(command)
6976
print()

0 commit comments

Comments
 (0)