Skip to content

Commit 1b72da6

Browse files
committed
Test runs to Maven
Base64 to work Updated pom.xml Ignored tests that were testing things that can't be directly checked withing RF test Github actions Release 4.0.0
1 parent 3ce9b80 commit 1b72da6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2163
-128
lines changed

.github/workflows/maven.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Java CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build_and_test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
# test against LTS java versions:
12+
java: [ 8 ]
13+
name: Test with Java ${{ matrix.java }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up JDK ${{ matrix.java }}
17+
uses: actions/[email protected]
18+
with:
19+
java-version: ${{ matrix.java }}
20+
- name: Build with Maven
21+
run: mvn -B verify --file pom.xml
22+
release:
23+
needs: [build_and_test]
24+
if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/')
25+
runs-on: ubuntu-latest
26+
name: Release package
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Set up JDK
30+
uses: actions/[email protected]
31+
with:
32+
java-version: 8
33+
- name: Release Maven package
34+
uses: samuelmeuli/action-maven-publish@1221d1fa792cab948a772c5e7c1f3abe84aec3bf
35+
with:
36+
gpg_private_key: ${{ secrets.gpg_private_key }}
37+
gpg_passphrase: ${{ secrets.gpg_passphrase }}
38+
nexus_username: ${{ secrets.nexus_username }}
39+
nexus_password: ${{ secrets.nexus_password }}
40+
maven_args: -DskipTests

atest/run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
args.extend(['--exclude', 'kwargs'])
6464
args.extend(['--loglevel','DEBUG'])
6565
args.extend([join(BASE, 'tests')])
66-
print 'Running tests with command:\n%s' % ' '.join(args)
66+
print('Running tests with command:\n%s' % ' '.join(args))
6767
subprocess.call(args)
6868

6969
print
@@ -72,6 +72,6 @@
7272
servercontroller.stop(8270, "/Static")
7373
rc = robot.rebot(*outputs, outputdir=RESULTS)
7474
if rc == 0:
75-
print 'All tests passed'
75+
print('All tests passed')
7676
else:
77-
print '%d test%s failed' % (rc, 's' if rc != 1 else '')
77+
print('%d test%s failed' % (rc, 's' if rc != 1 else ''))

atest/servercontroller.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"""
1919

2020
from __future__ import with_statement
21-
import xmlrpclib
21+
import xmlrpc
22+
import xmlrpc.client
2223
import time
2324
import subprocess
2425
import socket
@@ -37,23 +38,23 @@ def start(libraries=
3738
'org.robotframework.examplelib.Static:/Static' ):
3839
if not os.path.exists(os.path.join(BASE, 'libs', 'target', 'examplelib-jar-with-dependencies.jar')):
3940
cmd = 'mvn -f "%s" clean package' % os.path.join(BASE, 'libs', 'pom.xml')
40-
print 'Building the test libraries with command:\n%s' % cmd
41+
print('Building the test libraries with command:\n%s' % cmd)
4142
subprocess.call(cmd, shell=True)
4243
files = glob.glob(os.path.join(dirname(BASE), 'target') + os.sep + '*jar-with-dependencies.jar')
4344
if not files:
4445
raise Exception('Build jrobotremoteserver including the standalone jar first')
4546
rs_path = os.path.join(dirname(BASE), 'target', files[0])
4647
tl_path = os.path.join(BASE, 'libs', 'target', 'examplelib-jar-with-dependencies.jar')
4748
os.environ['CLASSPATH'] = rs_path + os.pathsep + tl_path
48-
print 'CLASSPATH: %s' % os.environ['CLASSPATH']
49+
print('CLASSPATH: %s' % os.environ['CLASSPATH'])
4950
results = _get_result_directory()
5051
port = "8270"
5152
args = ['java', 'org.robotframework.remoteserver.RemoteServer', '--port', port]
5253
libraries = [x.strip() for x in libraries.split(',')]
5354
paths = [x.partition(':')[2] for x in libraries]
5455
for lib in libraries:
5556
args.extend(['--library', lib])
56-
print 'adding library %s on path %s' % (lib.split(':')[0], lib.split(':')[1])
57+
print('adding library %s on path %s' % (lib.split(':')[0], lib.split(':')[1]))
5758
with open(join(results, 'server.txt'), 'w') as output:
5859
server = subprocess.Popen(args,
5960
stdout=output, stderr=subprocess.STDOUT,
@@ -82,24 +83,24 @@ def test(port, path, attempts=1):
8283
if i > 0:
8384
time.sleep(1)
8485
try:
85-
ret = xmlrpclib.ServerProxy(url).run_keyword('get_server_language', [])
86-
except socket.error, (errno, errmsg):
86+
ret = xmlrpc.client.ServerProxy(url).run_keyword('get_server_language', [])
87+
except socket.error:
8788
pass
88-
except xmlrpclib.Error, err:
89+
except xmlrpc.Error:
8990
errmsg = err.faultString
9091
break
9192
else:
92-
print "Remote server running on port %s, path %s" % (port, path)
93+
print("Remote server running on port %s, path %s" % (port, path))
9394
return True
94-
print "Failed to connect to remote server on port %s path %s: %s" % (port, path, errmsg)
95+
print("Failed to connect to remote server on port %s path %s: %s" % (port, path, errmsg))
9596
return False
9697

9798

9899
def stop(port=8270, path="/"):
99100
if test(port, path):
100101
server = xmlrpclib.ServerProxy('http://localhost:%s%s' % (port, path))
101102
server.stop_remote_server()
102-
print "Remote server on port %s path %s stopped" % (port, path)
103+
print("Remote server on port %s path %s stopped" % (port, path))
103104

104105

105106
if __name__ == '__main__':

atest/statuschecker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,14 @@ def _get_log_message(self, msg_str):
177177
import os
178178

179179
if not 2 <= len(sys.argv) <= 3 or '--help' in sys.argv:
180-
print __doc__
180+
print(__doc__)
181181
sys.exit(1)
182182
infile = sys.argv[1]
183183
outfile = sys.argv[2] if len(sys.argv) == 3 else None
184-
print "Checking %s" % os.path.abspath(infile)
184+
print("Checking %s" % os.path.abspath(infile))
185185
rc = process_output(infile, outfile)
186186
if outfile:
187-
print "Output: %s" % os.path.abspath(outfile)
187+
print("Output: %s" % os.path.abspath(outfile))
188188
if rc > 255:
189189
rc = 255
190190
sys.exit(rc)

atest/tests/Z_LAST__special_failures.txt renamed to atest/tests/Z_LAST__special_failures.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
*** Settings ***
2-
Resource resource.txt
2+
Resource resource.robot
33

44
*** Test Cases ***
55
Not special

atest/tests/argument_counts.txt renamed to atest/tests/argument_counts.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
*** Settings ***
2-
Resource resource.txt
2+
Resource resource.robot
33
Test Template Arguments Should Be Accepted
44

55
*** Test Cases ***

atest/tests/argument_types.robot

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
*** Settings ***
2+
Resource resource.txt
3+
4+
*** Test Cases ***
5+
String As Argument
6+
String As Argument ${BYTE STRING}
7+
8+
Non-ASCII String As Argument
9+
Unicode String As Argument ${UNICODE STRING}
10+
11+
Control Char As Argument
12+
[Documentation] Fails with ExpatError when server runs on Jython 2.5.
13+
Control Char As Argument ${CONTROL CHAR}
14+
15+
Empty String As Argument
16+
Empty String As Argument ${EMPTY}
17+
18+
Integer As Argument
19+
Integer As Argument ${42}
20+
Negative Integer As Argument ${-1}
21+
22+
Int As Argument Conversion From String
23+
[Documentation] JavalibCore does the conversion, this is just a sanity check
24+
${number}= Int As Argument 42
25+
Should Be Equal ${number} ${42}
26+
27+
Double As Argument
28+
Double As Argument ${9.34}
29+
Double Object As Argument ${4.2}
30+
31+
Zero As Argument
32+
Zero As Argument ${0}
33+
34+
Boolean As Argument
35+
Boolean True As Argument ${True}
36+
Boolean False As Argument ${False}
37+
Boolean Object As Argument ${False}
38+
39+
Null As Argument
40+
[Documentation] None is converted to empty string because it is not supported by all XML-RPC versions.
41+
Null As Argument ${None}
42+
43+
Arbitrary Object As Argument
44+
[Documentation] Arbitrary objects cannot be transferred over XML-RPC and thus only their string presentation is used
45+
Object As Argument ${MyObject()}
46+
47+
List As Argument
48+
List As Argument ${LIST}
49+
Empty List As Argument ${EMPTY LIST}
50+
51+
List Containing None As Argument
52+
List Containing None As Argument ${LIST WITH NONE}
53+
54+
List Containing Arbitrary Objects As Argument
55+
List Containing Objects As Argument ${LIST WITH OBJECTS}
56+
57+
Nested List As Argument
58+
Nested List As Argument ${NESTED LIST}
59+
60+
Map As Argument
61+
Map As Argument ${DICT}
62+
Empty Map As Argument ${EMPTY DICT}
63+
64+
Map With Non-String Keys As Argument
65+
[Documentation] XML-RPC supports only strings as keys so must convert them
66+
Map With Non String Keys As Argument ${DICT WITH NON STRING KEYS}
67+
68+
Map Containing None As Argument
69+
Map Containing None As Argument ${DICT WITH NONE}
70+
71+
Map Containing Objects As Argument
72+
Map Containing Objects As Argument ${DICT WITH OBJECTS}
73+
74+
Nested Map As Argument
75+
Nested Map As Argument ${NESTED DICT}
76+
77+
Array As Argument
78+
Array As Argument ${LIST_WITH_INTEGERS} ${-2}
79+

atest/tests/argument_types.txt

Lines changed: 0 additions & 79 deletions
This file was deleted.

atest/tests/basic_communication.txt renamed to atest/tests/basic_communication.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
*** Settings ***
2-
Resource resource.txt
2+
Resource resource.robot
33

44
*** Variables ***
55
${COUNT} 100

atest/tests/failures.txt renamed to atest/tests/failures.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
| *** Settings *** |
2-
| Resource | resource.txt |
2+
| Resource | resource.robot |
33

44
| *** Test Cases *** |
55
| Base Exception |

atest/tests/finding_keywords.txt renamed to atest/tests/finding_keywords.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
| *** Settings *** |
2-
| Resource | resource.txt |
2+
| Resource | resource.robot |
33

44
| *** Test Cases *** |
55
| Private Methods Should Be Ignored |

atest/tests/invalid_argument_counts.txt renamed to atest/tests/invalid_argument_counts.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*** Settings ***
22
Default Tags argsknown
3-
Resource resource.txt
3+
Resource resource.robot
44

55
*** Test Cases ***
66

atest/tests/kwargs.txt renamed to atest/tests/kwargs.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*** Settings ***
22
Force Tags kwargs
3-
Resource resource.txt
3+
Resource resource.robot
44

55
*** Test Cases ***
66
Kwargs Are Handled

atest/tests/logging.txt renamed to atest/tests/logging.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
| *** Settings *** |
22
| Suite Setup | Set Debug Log Level |
33
| Suite Teardown | Reset Log Level |
4-
| Resource | resource.txt |
4+
| Resource | resource.robot |
55

66
| *** Test Cases *** |
77
| One message Without Level |
File renamed without changes.

atest/tests/return_values.txt renamed to atest/tests/return_values.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
| *** Settings *** |
22
| Test Template | Return Value Should Be |
3-
| Resource | resource.txt |
3+
| Resource | resource.robot |
44

55
| *** Test Cases *** |
66
| Return String |

atest/tests/traceback.txt renamed to atest/tests/traceback.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
| *** Settings *** |
22
| Suite Setup | Set Debug Log Level |
33
| Suite Teardown | Reset Log Level |
4-
| Resource | resource.txt |
4+
| Resource | resource.robot |
55

66
| *** Test Cases *** |
77
| Remote Traceback Is Shown In Log |

0 commit comments

Comments
 (0)