Skip to content

Commit 8a478d2

Browse files
committed
Wget presto rpm before running tests
1 parent 0406ff2 commit 8a478d2

File tree

2 files changed

+6
-25
lines changed

2 files changed

+6
-25
lines changed

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ clean-docs:
7272
lint:
7373
flake8 prestoadmin packaging tests
7474

75+
presto-server-rpm.rpm:
76+
wget 'https://repository.sonatype.org/service/local/artifact/maven/content?r=central-proxy&g=com.facebook.presto&a=presto-server-rpm&e=rpm&v=RELEASE' -O $@
77+
7578
smoke: clean-test docker-images
7679
tox -e py26 -- -a smoketest,'!quarantine'
7780

tests/product/standalone/presto_installer.py

+3-25
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import fnmatch
2020
import os
21-
import urllib
2221

2322
import prestoadmin
2423

@@ -102,27 +101,10 @@ def copy_presto_rpm_to_master(self, cluster=None):
102101
cluster = self.testcase.cluster
103102

104103
rpm_path = os.path.join(self.rpm_dir, self.rpm_name)
105-
try:
106-
cluster.copy_to_host(rpm_path, cluster.master)
107-
self._check_if_corrupted_rpm(self.rpm_name, cluster)
108-
except OSError:
109-
print 'Downloading RPM again'
110-
# try to download the RPM again if it's corrupt (but only once)
111-
StandalonePrestoInstaller._download_rpm()
112-
cluster.copy_to_host(rpm_path, cluster.master)
113-
self._check_if_corrupted_rpm(self.rpm_name, cluster)
104+
cluster.copy_to_host(rpm_path, cluster.master)
105+
self._check_if_corrupted_rpm(self.rpm_name, cluster)
114106
return self.rpm_name
115107

116-
@staticmethod
117-
def _download_rpm():
118-
rpm_filename = 'presto-server-rpm.rpm'
119-
rpm_path = os.path.join(prestoadmin.main_dir,
120-
rpm_filename)
121-
urllib.urlretrieve(
122-
'http://search.maven.org/remotecontent?filepath=com/facebook/presto/'
123-
'presto-server-rpm/0.148/presto-server-rpm-0.148.rpm', rpm_path)
124-
return rpm_filename
125-
126108
@staticmethod
127109
def _detect_presto_rpm():
128110
"""
@@ -136,11 +118,7 @@ def _detect_presto_rpm():
136118
# are multiple RPMs, the last one is probably the latest
137119
rpm_name = sorted(rpm_names)[-1]
138120
else:
139-
try:
140-
rpm_name = StandalonePrestoInstaller._download_rpm()
141-
except:
142-
# retry once
143-
rpm_name = StandalonePrestoInstaller._download_rpm()
121+
raise OSError(1, 'Presto RPM not detected.')
144122

145123
return prestoadmin.main_dir, rpm_name
146124

0 commit comments

Comments
 (0)