Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
48 changes: 48 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Python CI
on: [pull_request]
env:
PGPASSWORD: postgres
PGHOST: localhost
Comment thread
jmchilton marked this conversation as resolved.
Outdated
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
python-version: ['3.6']
tox-action:
- lint
- pytest
- integration
services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
Comment thread
jmchilton marked this conversation as resolved.
Outdated
steps:
- uses: actions/checkout@v1
Comment thread
jmchilton marked this conversation as resolved.
Outdated
with:
fetch-depth: 1
submodules: true
Comment thread
jmchilton marked this conversation as resolved.
Outdated
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Test psql
run: |
psql --tuples-only --username postgres -P pager=off --list
Comment thread
jmchilton marked this conversation as resolved.
Outdated
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox coveralls
- name: Test with tox
run: |
TOXENV=$(echo $TOXENV | sed 's/\.//') tox
env:
TOXENV: py${{ matrix.python-version }}-${{ matrix.tox-action }}
13 changes: 0 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ env:
- secure: HwBDtauxcKJQccRk9fYtG90PNdB+KuNcDVY2MK4AVPLHoMCYGABIKJwUj+K9mcqc2wmYhWHfaufLJuMhr3X0FlPknM/aHdh16zUkIckje7WHqvyR2la1AIAMYaMpMikVJiexA6aElOW/aBuVnFolZyz9No+iq3bfF7iVvg2MLWopjMBsWGrHmAIReIVnPXy//Eka73pnwG2WdOjbKnrZfuUQ+nB7xJA4AYBHsZQ4X8eTDoOA6VS4QNL8ibsl7uKF024puYpMDyIG1NwFqcXqA2Zz8n4YB+I6EsrLckQvc6gVJLVxmTf8AH8hISaJ+gFZfz7moBzia3cJa9RrLqNh2pbuQVlV5VHJdD5ZHnvn8VmnGR9qzw9BblTClLP+2sMbSj3Gq/ACKbDy/KJOJJKqTtv5ru10reJRyhx/h6mRlSE9igoVKySohb6z39RKttLBSbd0OtI8afEpoCD64SKpNfnayDn0VuRKF/ozkDRFOA5EYpZaLoYtmlX4D9Yy5ml4qxkqc14P5HqD7yWdQkHUdfCxOyuOi+8ryTc5Cp7XvIvWwI7a8ekAApudZSw1RGShlemxRRCUzRomkAZkxePy1o12tvDHwoda8ehnsT39KoiXvLFxvkvPPqoWkRiUSqDpQrXy2B/Mg/UmgH+cJTskRMK+6PDMJB/oWi5ga+kzdoQ=
matrix:
include:
- python: 2.7
env: TOX_ENV=py27-lint
- python: 3.5
env: TOX_ENV=py35-lint
- python: 2.7
env: TOX_ENV=py27-lint-readme
- python: 3.5
env: TOX_ENV=py35-pytest
install:
Expand All @@ -23,15 +19,6 @@ matrix:
# Only run if CODACY_PROJECT_TOKEN is defined.
# This is not the case for pull requests outside of galaxyproject/ephemeris
- bash -c 'if [[ -v CODACY_PROJECT_TOKEN ]] ; then python-codacy-coverage -r coverage.xml; fi'

- python: 2.7
env: TOX_ENV=py27-pytest
services:
- docker
- python: 2.7
env: TOX_ENV=py27
services:
- docker
- python: 3.5
env: TOX_ENV=py35
services:
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ open-project:

dist: clean
$(IN_VENV) python setup.py sdist bdist_egg bdist_wheel
$(IN_VENV) twine check dist/*
ls -l dist

release-test-artifacts: dist
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.. image:: https://api.codacy.com/project/badge/Grade/e12102174b4e452c871cd2bafedaec60
:target: https://www.codacy.com/app/galaxyproject/ephemeris?utm_source=github.com&utm_medium=referral&utm_content=galaxyproject/ephemeris&utm_campaign=Badge_Grade

Ephemeris is a small Python library and set of scripts for managing the
Ephemeris is a small Python 3 library and set of scripts for managing the
bootstrapping of Galaxy_ plugins - tools, index data, and workflows.

* Free software: Academic Free License version 3.0
Expand Down
2 changes: 0 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ sphinx-argparse
sphinx
CommonMark

# Used to check readme.
readme
# Used for code checking.
pyflakes
flake8
Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ six>=1.9.0
PyYAML
bioblend>=0.10.0
Jinja2
galaxy-tool-util>=20.5.0.dev1
galaxy-util>=20.1.0.dev0 # temporarily needed because this is a pre-release and https://github.com/pypa/pip/issues/988
futures ; python_version < '3'
galaxy-tool-util>=20.9.1
galaxy-util>=20.9.0
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ def get_var(var_name):
'Topic :: Software Development :: Code Generators',
'Topic :: Software Development :: Testing',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
"Programming Language :: Python :: 3",
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
test_suite=TEST_DIR,
tests_require=test_requirements
Expand Down
28 changes: 25 additions & 3 deletions src/ephemeris/shed_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
from bioblend.galaxy.client import ConnectionError
from bioblend.galaxy.toolshed import ToolShedClient
from galaxy.tool_util.verify.interactor import (
DictClientTestConfig,
GalaxyInteractorApi,
verify_tool,
)
Expand Down Expand Up @@ -231,6 +232,7 @@ def test_tools(self,
test_user="ephemeris@galaxyproject.org",
parallel_tests=1,
test_all_versions=False,
client_test_config_path=None,
):
"""Run tool tests for all tools in each repository in supplied tool list or ``self.installed_repositories()``.
"""
Expand All @@ -252,6 +254,13 @@ def test_tools(self,

all_test_results = []
galaxy_interactor = self._get_interactor(test_user, test_user_api_key)
if client_test_config_path is not None:
with open(client_test_config_path, "r") as f:
client_test_config_dict = yaml.full_load(f)
client_test_config = DictClientTestConfig(client_test_config_dict.get("tools"))
else:
client_test_config = None

test_history = galaxy_interactor.new_history()

with ThreadPoolExecutor(max_workers=parallel_tests) as executor:
Expand All @@ -265,6 +274,7 @@ def test_tools(self,
tool_test_results=all_test_results,
tests_passed=tests_passed,
test_exceptions=test_exceptions,
client_test_config=client_test_config,
)
finally:
# Always write report, even if test was cancelled.
Expand Down Expand Up @@ -325,25 +335,34 @@ def _test_tool(executor,
test_exceptions,
log,
test_history=None,
client_test_config=None,
):
if test_history is None:
test_history = galaxy_interactor.new_history()
tool_id = tool["id"]
tool_version = tool["version"]
# If given a tool_id with a version suffix, strip it off so we can treat tool_version
# correctly at least in client_test_config.
if tool_version and tool_id.endswith("/" + tool_version):
tool_id = tool_id[:-len("/" + tool_version)]

label_base = tool_id
if tool_version:
label_base += "/" + str(tool_version)
try:
tool_test_dicts = galaxy_interactor.get_tool_tests(tool_id, tool_version=tool_version)
except Exception as e:
if log:
log.warning("Fetching test definition for tool '%s' failed", tool_id, exc_info=True)
test_exceptions.append((tool_id, e))
log.warning("Fetching test definition for tool '%s' failed", label_base, exc_info=True)
test_exceptions.append((label_base, e))
Results = namedtuple("Results", ["tool_test_results", "tests_passed", "test_exceptions"])
return Results(tool_test_results=tool_test_results,
tests_passed=tests_passed,
test_exceptions=test_exceptions)
test_indices = list(range(len(tool_test_dicts)))

for test_index in test_indices:
test_id = tool_id + "-" + str(test_index)
test_id = label_base + "-" + str(test_index)

def run_test(index, test_id):

Expand All @@ -360,6 +379,7 @@ def register(job_data):
verify_tool(
tool_id, galaxy_interactor, test_index=index, tool_version=tool_version,
register_job_data=register, quiet=True, test_history=test_history,
client_test_config=client_test_config,
)
tests_passed.append(test_id)
if log:
Expand Down Expand Up @@ -606,6 +626,7 @@ def main():
test_user=args.test_user,
parallel_tests=args.parallel_tests,
test_all_versions=args.test_all_versions,
client_test_config_path=args.client_test_config,
)
else:
raise NotImplementedError("This point in the code should not be reached. Please contact the developers.")
Expand All @@ -623,6 +644,7 @@ def main():
test_user_api_key=args.test_user_api_key,
test_user=args.test_user,
parallel_tests=args.parallel_tests,
client_test_config_path=args.client_test_config
)


Expand Down
7 changes: 7 additions & 0 deletions src/ephemeris/shed_tools_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def parser():
test_json="tool_test_output.json",
test_existing=False,
parallel_tests=1,
client_test_config=None,
)

# SUBPARSERS
Expand Down Expand Up @@ -240,5 +241,11 @@ def parser():
"apply for tools where revisions have not been provided through "
"the --revisions arg, --tool_file or --tool_yaml."
)
test_command_parser.add_argument(
"--client_test_config",
dest="client_test_config",
help="Annotate expectations about tools in client testing YAML "
"configuration file."
)

return shed_parser
Loading