Skip to content

Commit bb5d133

Browse files
committed
Enable travis to run tests
Product tests will be using online installer. This is possible by setting PA_TEST_ONLINE_INSTALLER environment variable and using it in prestoadmin_installer.py to select installer. Fixes prestodb#151. Pull request: prestodb#154
1 parent 7fa9d1a commit bb5d133

File tree

5 files changed

+40
-4
lines changed

5 files changed

+40
-4
lines changed

.travis.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
language: python
2+
python:
3+
- "2.7"
4+
sudo: required
5+
services:
6+
- docker
7+
env:
8+
global:
9+
- PA_TEST_ONLINE_INSTALLER=true
10+
matrix:
11+
- OTHER_TESTS=true
12+
- PRODUCT_TEST_GROUP=0
13+
- PRODUCT_TEST_GROUP=1
14+
- PRODUCT_TEST_GROUP=2
15+
- PRODUCT_TEST_GROUP=3
16+
- PRODUCT_TEST_GROUP=4
17+
- PRODUCT_TEST_GROUP=5
18+
- PRODUCT_TEST_GROUP=6
19+
- PRODUCT_TEST_GROUP=7
20+
install:
21+
- pip install --upgrade pip==6.1.1
22+
- pip install -r requirements.txt
23+
script:
24+
- |
25+
if [ -v PRODUCT_TEST_GROUP ]; then
26+
PRODUCT_TESTS=$(find tests/product/ -name '*py' | grep -v __init__ | awk "NR % 8 == $PRODUCT_TEST_GROUP" | tr '\n' ' ')
27+
tox -e py26 -- -a '!quarantine,!offline_installer' $PRODUCT_TESTS
28+
fi
29+
- |
30+
if [ -v OTHER_TESTS ]; then
31+
make clean lint docs test test-rpm
32+
fi

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[wheel]
22
universal = 0
33
[nosetests]
4-
verbosity=3
4+
verbosity=3

tests/product/prestoadmin_installer.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@ def _build_dist_if_necessary(self, cluster, unique=False):
7878
self._build_installer_in_docker(cluster, unique=unique)
7979
return cluster.get_dist_dir(unique)
8080

81-
def _build_installer_in_docker(self, cluster, online_installer=False,
81+
def _build_installer_in_docker(self, cluster, online_installer=None,
8282
unique=False):
83+
if online_installer is None:
84+
paTestOnlineInstaller = os.environ.get('PA_TEST_ONLINE_INSTALLER')
85+
online_installer = paTestOnlineInstaller is not None
86+
8387
container_name = 'installer'
8488
installer_container = DockerCluster(
8589
container_name, [], DEFAULT_LOCAL_MOUNT_POINT,

tests/product/standalone/test_installation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_install_from_different_dir(self):
9090
self.cluster.master
9191
)
9292

93-
@attr('smoketest')
93+
@attr('smoketest', 'offline_installer')
9494
@docker_only
9595
def test_install_on_wrong_os_offline_installer(self):
9696
image = 'ubuntu'

tests/product/test_installer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_online_installer(self):
5353
dist_dir=self.centos_container.get_dist_dir(unique=True))
5454
self.run_prestoadmin('--help', raise_error=True)
5555

56-
@attr('smoketest')
56+
@attr('smoketest', 'offline_installer')
5757
def test_offline_installer(self):
5858
self.pa_installer._build_installer_in_docker(
5959
self.centos_container, online_installer=False, unique=True)

0 commit comments

Comments
 (0)