*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 2ffca36c authored by Moser, Maximilian's avatar Moser, Maximilian
Browse files

Update the package's test infrastructure

* based on what we already have at Invenio-Theme-TUW
parent d2be388a
Branches
Tags hub-2.3.0
1 merge request!60Update the package's test & CI/CD infrastructure
...@@ -107,10 +107,10 @@ html_theme = "alabaster" ...@@ -107,10 +107,10 @@ html_theme = "alabaster"
html_theme_options = { html_theme_options = {
"description": "Invenio module containing some customizations and configuration for TU Wien.", "description": "Invenio module containing some customizations and configuration for TU Wien.",
"gitlab_user": "fairdata", # NOTE: gitlab variables are not supported
"gitlab_repo": "invenio-config-tuw", # "gitlab_repo": "invenio-config-tuw",
"gitlab_button": False, # "gitlab_button": False,
"gitlab_banner": True, # "gitlab_banner": True,
"show_powered_by": False, "show_powered_by": False,
"extra_nav_links": { "extra_nav_links": {
"invenio-config-tuw@GitLab": "https://gitlab.tuwien.ac.at/fairdata/invenio-config-tuw", "invenio-config-tuw@GitLab": "https://gitlab.tuwien.ac.at/fairdata/invenio-config-tuw",
......
#!/usr/bin/env sh #!/usr/bin/env bash
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2020-2022 TU Wien. # Copyright (C) 2020-2024 TU Wien.
# #
# Invenio-Config-TUW is free software; you can redistribute it and/or modify # Invenio-Theme-TUW is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details. # it under the terms of the MIT License; see LICENSE file for more details.
pydocstyle invenio_config_tuw tests docs && \ # Quit on errors
isort -rc -c -df && \ set -o errexit
check-manifest --ignore ".travis-*" && \
sphinx-build -qnNW docs docs/_build/html && \ # Quit on unbound symbols
python setup.py test set -o nounset
# Define function for bringing down services
cleanup() {
eval "$(docker-services-cli down --env)"
}
# Check for arguments
# Note: "-k" would clash with "pytest"
keep_services=0
pytest_args=()
for arg in $@; do
# from the CLI args, filter out some known values and forward the rest to "pytest"
# note: we don't use "getopts" here b/c of some limitations (e.g. long options),
# which means that we can't combine short options (e.g. "./run-tests -Kk pattern")
case ${arg} in
-K|--keep-services)
keep_services=1
;;
*)
pytest_args+=( "${arg}" )
;;
esac
done
if [[ ${keep_services} -eq 0 ]]; then
trap cleanup EXIT
fi
export LC_TIME=en_US.UTF-8
python -m check_manifest
python -m sphinx.cmd.build -qnNW docs docs/_build/html
eval "$(docker-services-cli up --db "${DB:-postgresql}" --search "${SEARCH:-opensearch}" --mq "${MQ:-rabbitmq}" --cache "${CACHE:-redis}" --env)"
# Note: expansion of pytest_args looks like below to not cause an unbound
# variable error when 1) "nounset" and 2) the array is empty.
python -m pytest ${pytest_args[@]+"${pytest_args[@]}"}
tests_exit_code=$?
exit "$tests_exit_code"
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2020-2022 TU Wien. # Copyright (C) 2020-2024 TU Wien.
# #
# Invenio-Config-TUW is free software; you can redistribute it and/or modify # Invenio-Config-TUW is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details. # it under the terms of the MIT License; see LICENSE file for more details.
...@@ -40,14 +40,8 @@ install_requires = ...@@ -40,14 +40,8 @@ install_requires =
[options.extras_require] [options.extras_require]
tests = tests =
pytest-black>=0.3.0,<0.3.10 pytest-black>=0.3.0
check-manifest>=0.25 pytest-invenio>=1.4.0
coverage>=4.0
isort>=4.3.3
pydocstyle>=2.0.0
pytest-cov>=2.5.1
pytest-pep8>=1.0.6
pytest-invenio>=1.2.1
sphinx>=4.5 sphinx>=4.5
elasticsearch7 = elasticsearch7 =
invenio-search[elasticsearch7]>=2.1.0,<3.0.0 invenio-search[elasticsearch7]>=2.1.0,<3.0.0
...@@ -127,5 +121,5 @@ ignore = ...@@ -127,5 +121,5 @@ ignore =
[tool:pytest] [tool:pytest]
pep8ignore = docs/conf.py ALL pep8ignore = docs/conf.py ALL
addopts = --black --pep8 --doctest-glob="*.rst" --doctest-modules --cov=invenio_config_tuw --cov-report=term-missing addopts = --black --isort --pydocstyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_config_tuw --cov-report=term-missing
testpaths = docs tests invenio_config_tuw testpaths = docs tests invenio_config_tuw
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment