Max has submitted this change and it was merged.

Change subject: Expand CI tests
......................................................................


Expand CI tests

* make sure jenkins.sh fails on any errors similar to other jenkins jobs
* always explicitly use python2 instead of generic python
* add basic module import tests for python 2 and 3
* add comments

Change-Id: I0f4639537d227c513859d4552533ce1e41df9deb
---
M contrib/jenkins.sh
A tests/test_py2.py
A tests/test_py3.py
3 files changed, 24 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 802ba2d..4e51dd1 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -1,4 +1,13 @@
 #!/bin/sh
-python2 ./setup.py install || python ./setup.py install
+
+set -ex
+
+# FIXME: remove once python 2 support is deprecated
+python2 ./setup.py install
+python2 tests/test_py2.py
+
 rm -rf ./build
 python3 ./setup.py install
+python3 tests/test_py3.py
+
+# TODO: add more tests
diff --git a/tests/test_py2.py b/tests/test_py2.py
new file mode 100644
index 0000000..cac5261
--- /dev/null
+++ b/tests/test_py2.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python2
+
+# just import a smoke test for osmopy
+
+import osmopy
+
+print '[Python2] Smoke test PASSED.'
diff --git a/tests/test_py3.py b/tests/test_py3.py
new file mode 100644
index 0000000..cac2f93
--- /dev/null
+++ b/tests/test_py3.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python3
+
+# just import a smoke test for osmopy
+
+import osmopy
+
+print('[Python3] Smoke test PASSED.')

-- 
To view, visit https://gerrit.osmocom.org/5277
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0f4639537d227c513859d4552533ce1e41df9deb
Gerrit-PatchSet: 8
Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-Owner: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pes...@sysmocom.de>

Reply via email to