Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to fix xenial #48

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
sudo: required # Needed to install a recent version of OpenJDK as well as Python 3.7
dist: xenial

language: python

env:
- JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64

matrix:
fast_finish: true
include:
- python: 3.6
env:
TOXENV=py36
JDK_SWITCH=openjdk7
- TOXENV=py36
- python: 3.7
# from https://github.com/travis-ci/travis-ci/issues/9815#issuecomment-401756442
dist: xenial
env:
TOXENV=py37
JDK_SWITCH=openjdk8
- TOXENV=py37


install:
- travis_retry pip install tox
- jdk_switcher use "${JDK_SWITCH}"
script:
- java -version
- "$JAVA_HOME/bin/java" -version
- tox -e "$TOXENV"
- if [[ $TOXENV == 'py36' ]] ; then tox -e py36-coveralls; else echo "No coverage to do"; fi
11 changes: 9 additions & 2 deletions pushapkscript/test/integration/test_integration_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
test_data_dir = os.path.join(this_dir, '..', 'data')


def _get_java_path(tool_name):
if os.environ.get('JAVA_HOME'):
return os.path.join(os.environ['JAVA_HOME'], 'bin', tool_name)
return tool_name


class KeystoreManager(object):
def __init__(self, test_data_dir, certificate_alias='nightly', keystore_password='12345678'):
self.keystore_path = os.path.join(test_data_dir, 'keystore')
Expand All @@ -23,7 +29,7 @@ def __init__(self, test_data_dir, certificate_alias='nightly', keystore_password

def add_certificate(self, certificate_path):
subprocess.run([
'keytool', '-import', '-noprompt',
_get_java_path('keytool'), '-import', '-noprompt',
'-keystore', self.keystore_path, '-storepass', self.keystore_password,
'-file', certificate_path, '-alias', self.certificate_alias
])
Expand All @@ -49,6 +55,7 @@ def _generate_json(self):
"schema_file": "{project_data_dir}/pushapk_task_schema.json",
"verbose": true,

"jarsigner_binary": "{binary}",
"jarsigner_key_store": "{keystore_path}",
"jarsigner_certificate_alias": "{certificate_alias}",
"google_play_accounts": {{
Expand All @@ -60,7 +67,7 @@ def _generate_json(self):
"taskcluster_scope_prefix": "project:releng:googleplay:"
}}'''.format(
work_dir=self.work_dir, test_data_dir=self.test_data_dir, project_data_dir=project_data_dir,
keystore_path=self.keystore_manager.keystore_path,
binary=_get_java_path('jarsigner'), keystore_path=self.keystore_manager.keystore_path,
certificate_alias=self.keystore_manager.certificate_alias
))

Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ setenv =

passenv =
HOME
JAVA_HOME
TRAVIS
TRAVIS_JOB_ID
TRAVIS_BRANCH
Expand Down