Skip to content

Commit f017bc8

Browse files
authored
Merge pull request #659 from jleni/test_platforms
Running unit tests in stretch / jessie too
2 parents 3b74d84 + 9491b8e commit f017bc8

File tree

7 files changed

+199
-8
lines changed

7 files changed

+199
-8
lines changed

.travis.yml

+26-7
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,32 @@ jobs:
3535
- sudo pip install -U coverage codacy-coverage
3636
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then python-codacy-coverage -r coverage.xml || echo "failed"; fi
3737

38+
- stage: build+test
39+
os: linux
40+
env:
41+
- D="UNITTESTS"
42+
- TEST='TRUE'
43+
- PLATFORM='stretch'
44+
- CODACY_PROJECT_TOKEN=$CODACY_PROJECT_TOKEN
45+
install:
46+
- python --version
47+
- echo "Skip installing requirements.txt when running integration tests"
48+
script:
49+
- "./travis/build.sh"
50+
51+
- stage: build+test
52+
os: linux
53+
env:
54+
- D="UNITTESTS"
55+
- TEST='TRUE'
56+
- PLATFORM='jessie'
57+
- CODACY_PROJECT_TOKEN=$CODACY_PROJECT_TOKEN
58+
install:
59+
- python --version
60+
- echo "Skip installing requirements.txt when running integration tests"
61+
script:
62+
- "./travis/build.sh"
63+
3864
- stage: build+test
3965
os: linux
4066
env:
@@ -63,13 +89,6 @@ jobs:
6389
- docker-compose --version
6490
- "cd tests_integration; python3 runtest_nodes_1minAfterSync.py"
6591

66-
# - stage: build+test
67-
# os: linux
68-
# env:
69-
# - TEST='TRUE'
70-
# - PLATFORM='trusty'
71-
# script: "./travis/build.sh"
72-
7392
- stage: publish
7493
if: tag =~ ^v
7594
os: linux

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ pyopenssl>=17.3.0
1414
pyqrllib>=0.2.9
1515
six>=1.9
1616
click==6.7
17+
typing

travis/Dockerfile.jessie

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#Download base ubuntu image
2+
FROM debian:jessie
3+
4+
ENV DEBIAN_FRONTEND noninteractive
5+
6+
RUN echo "deb http://ftp.debian.org/debian jessie-backports main" | tee -a /etc/apt/sources.list
7+
8+
RUN apt-get update && \
9+
apt-get -t jessie-backports -y install cmake swig3.0 && \
10+
apt-get -y install software-properties-common && \
11+
apt-get -y install ca-certificates curl && \
12+
apt-get -y install build-essential pkg-config git sudo wget
13+
14+
# Prepare python
15+
RUN apt-get -y install python3 python3-dev python3-pip
16+
17+
RUN pip3 install --upgrade pip virtualenv setuptools PyScaffold==2.5.8
18+
19+
RUN echo "ALL ALL=NOPASSWD: ALL" >> /etc/sudoers
20+
21+
# ENV - Define environment variables
22+
# TODO: define any required environment variables
23+
24+
# COPY - Copy configuration/scripts
25+
COPY travis/stretch/build.sh /build.sh
26+
27+
# VOLUME - link directories to host
28+
29+
# START SCRIPT - The script is started from travis with the appropriate environment variables
30+
31+
# EXPOSE PORTS
32+
# TODO: Map ports to get access from outside

travis/Dockerfile.stretch

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#Download base ubuntu image
2+
FROM debian:stretch
3+
4+
ENV DEBIAN_FRONTEND noninteractive
5+
6+
RUN apt-get update && \
7+
apt-get -y install software-properties-common && \
8+
apt-get -y install ca-certificates curl && \
9+
apt-get -y install build-essential pkg-config git sudo wget
10+
11+
# Prepare python
12+
RUN apt-get -y install swig3.0 python3 python3-dev python3-pip
13+
14+
RUN pip3 install --upgrade pip cmake virtualenv setuptools PyScaffold==2.5.8
15+
16+
RUN echo "ALL ALL=NOPASSWD: ALL" >> /etc/sudoers
17+
18+
# ENV - Define environment variables
19+
# TODO: define any required environment variables
20+
21+
# COPY - Copy configuration/scripts
22+
COPY travis/stretch/build.sh /build.sh
23+
24+
# VOLUME - link directories to host
25+
26+
# START SCRIPT - The script is started from travis with the appropriate environment variables
27+
28+
# EXPOSE PORTS
29+
# TODO: Map ports to get access from outside

travis/jessie/build.sh

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
echo "Creating/fixing home"
6+
sudo mkdir -p ${HOME}
7+
sudo -E chown -R $(whoami):$(whoami) ${HOME}
8+
sudo -E chmod -R a+rxw ${HOME}
9+
10+
cd /travis
11+
12+
sudo -H pip3 install -r requirements.txt
13+
sudo -H pip3 install -r test-requirements.txt
14+
sudo -H pip3 install setuptools
15+
16+
echo
17+
echo
18+
echo "****************************************************************"
19+
echo "****************************************************************"
20+
python3 --version
21+
cmake --version
22+
pip3 --version
23+
echo "****************************************************************"
24+
echo "****************************************************************"
25+
echo
26+
echo
27+
28+
if [ -n "${STYLECHECK:+1}" ]; then
29+
echo "****************************************************************"
30+
echo "****************************************************************"
31+
echo " STYLE CHECK"
32+
echo "****************************************************************"
33+
echo "****************************************************************"
34+
sudo pip install -U pycodestyle flake8
35+
flake8
36+
pycodestyle
37+
fi
38+
39+
if [ -n "${TEST:+1}" ]; then
40+
echo "****************************************************************"
41+
echo "****************************************************************"
42+
echo " TEST"
43+
echo "****************************************************************"
44+
echo "****************************************************************"
45+
python3 setup.py test
46+
fi
47+
48+
if [ -n "${DEPLOY:+1}" ]; then
49+
echo "****************************************************************"
50+
echo "****************************************************************"
51+
echo " DEPLOY"
52+
echo "****************************************************************"
53+
echo "****************************************************************"
54+
python3 setup.py sdist
55+
fi

travis/stretch/build.sh

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
echo "Creating/fixing home"
6+
sudo mkdir -p ${HOME}
7+
sudo -E chown -R $(whoami):$(whoami) ${HOME}
8+
sudo -E chmod -R a+rxw ${HOME}
9+
10+
cd /travis
11+
12+
sudo -H pip3 install -r requirements.txt
13+
sudo -H pip3 install -r test-requirements.txt
14+
sudo -H pip3 install setuptools
15+
16+
echo
17+
echo
18+
echo "****************************************************************"
19+
echo "****************************************************************"
20+
python3 --version
21+
cmake --version
22+
pip3 --version
23+
echo "****************************************************************"
24+
echo "****************************************************************"
25+
echo
26+
echo
27+
28+
if [ -n "${STYLECHECK:+1}" ]; then
29+
echo "****************************************************************"
30+
echo "****************************************************************"
31+
echo " STYLE CHECK"
32+
echo "****************************************************************"
33+
echo "****************************************************************"
34+
sudo pip install -U pycodestyle flake8
35+
flake8
36+
pycodestyle
37+
fi
38+
39+
if [ -n "${TEST:+1}" ]; then
40+
echo "****************************************************************"
41+
echo "****************************************************************"
42+
echo " TEST"
43+
echo "****************************************************************"
44+
echo "****************************************************************"
45+
python3 setup.py test
46+
fi
47+
48+
if [ -n "${DEPLOY:+1}" ]; then
49+
echo "****************************************************************"
50+
echo "****************************************************************"
51+
echo " DEPLOY"
52+
echo "****************************************************************"
53+
echo "****************************************************************"
54+
python3 setup.py sdist
55+
fi

travis/xenial/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ echo
1717
echo
1818
echo "****************************************************************"
1919
echo "****************************************************************"
20-
python --version
20+
python3 --version
2121
cmake --version
2222
pip --version
2323
pip3 --version

0 commit comments

Comments
 (0)