Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ri/tech-hub/platform/esd/dedal
1 result
Show changes
Commits on Source (9)
stages:
- test
- build
- coverage_report
variables:
BUILD_ENV_DOCKER_IMAGE: docker-registry.ebrains.eu/esd/tmp:latest
default:
before_script:
- chmod +x dedal/utils/bootstrap.sh
- ./dedal/utils/bootstrap.sh
- pip install -e .[test]
build-wheel:
stage: build
......@@ -21,23 +27,59 @@ build-wheel:
- dist/*.tar.gz
expire_in: 1 week
unit_tests:
stage: test
tags:
- docker-runner
image: ubuntu:22.04
script:
- coverage run -m pytest -s --tb=short --junitxml=test-results.xml ./dedal/tests/unit_tests
- mv .coverage .coverage.unit # Rename to avoid overwriting
artifacts:
when: always
reports:
junit: test-results.xml
paths:
- test-results.xml
- .coverage.unit
expire_in: 1 week
testing-pytest-coverage:
integration_tests:
stage: test
tags:
- docker-runner
image: ubuntu:22.04
script:
- chmod +x dedal/utils/bootstrap.sh
- ./dedal/utils/bootstrap.sh
- pip install -e .[test]
- coverage run -m pytest -s --tb=short --junitxml=test-results.xml ./dedal/tests/ && coverage html -i -d htmlcov
- coverage run -m pytest -s --tb=short --junitxml=test-results.xml ./dedal/tests/integration_tests
- mv .coverage .coverage.integration # Rename to avoid overwriting
needs: ["unit_tests"]
artifacts:
when: always
reports:
junit: test-results.xml
paths:
- test-results.xml
- .dedal.log
- .coverage.integration
expire_in: 1 week
merge_coverage:
stage: coverage_report
tags:
- docker-runner
image: ubuntu:22.04
script:
- coverage combine .coverage.unit .coverage.integration
- coverage report
- coverage xml -o coverage.xml
- coverage html -d coverage_html
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
paths:
- coverage.xml
- coverage_html
expire_in: 1 week
coverage: '/TOTAL.*?(\d+\%)$/'
......@@ -51,3 +51,5 @@ The lowest ```spack version``` compatible with this library is ```v0.23.0```.
For both concretization and binary caches, the cache version can be changed via the attributes ```cache_version_concretize``` and ```cache_version_build```.
The default values are ```v1```.
![Coverage Badge](https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/yashchiki/badges/koutakia/coverage.svg)
......@@ -104,7 +104,7 @@ def test_run_command_success(mocker):
mock_logger = MagicMock()
result = run_command('bash', '-c', 'echo hello', logger=mock_logger, info_msg="Running echo")
mock_logger.info.assert_called_with("Running echo: args: ('bash', '-c', 'echo hello')")
mock_subprocess.assert_called_once_with(('bash', '-c', 'echo hello'))
mock_subprocess.assert_called_once_with(('bash', '-c', 'echo hello'), timeout=600)
assert result.returncode == 0
......
......@@ -30,7 +30,7 @@ def run_command(*args, logger=logging.getLogger(__name__), info_msg: str = '', e
exception=None, **kwargs):
try:
logger.info(f'{info_msg}: args: {args}')
return subprocess.run(args, **kwargs)
return subprocess.run(args, **kwargs, timeout=10 * 60)
except subprocess.CalledProcessError as e:
if exception_msg is not None:
logger.error(f"{exception_msg}: {e}")
......