Skip to content
Snippets Groups Projects
Commit c574d728 authored by lukas leufen's avatar lukas leufen
Browse files

report test results as html for easy inspection, bugfix in tests

parent e80be319
Branches
Tags
2 merge requests!9new version v0.2.0,!8data generator
Pipeline #25665 passed
......@@ -47,6 +47,7 @@ tests:
when: always
paths:
- badges/
- test/
coverage:
tags:
......@@ -88,6 +89,9 @@ pages:
- mkdir -p public/coverage
- cp -af coverage/. public/coverage
- ls public/coverage
- mkdir -p public/test
- cp -af test/. public/test
- ls public/test
- ls public
when: always
artifacts:
......@@ -97,8 +101,10 @@ pages:
- public
- badges/
- coverage/
- test/
cache:
key: old-pages
paths:
- public/badges/
- public/coverage/
- public/test/
#!/bin/bash
# run pytest for all modules
python3 -m pytest test/ | tee test_results.out
python3 -m pytest --html=report.html --self-contained-html test/ | tee test_results.out
IS_FAILED=$?
# move html test report
mkdir test/
BRANCH_NAME=$( echo -e "${CI_COMMIT_REF_NAME////_}")
mkdir test/${BRANCH_NAME}
mkdir test/recent
cp report.html test/${BRANCH_NAME}/.
cp report.html test/recent/.
if [[ "${CI_COMMIT_REF_NAME}" = "master" ]]; then
cp -r report.html test/.
fi
# exit 0 if no tests implemented
RUN_NO_TESTS="$(grep -c 'no tests ran' test_results.out)"
if [[ ${RUN_NO_TESTS} > 0 ]]; then
......
......@@ -7,4 +7,5 @@ requests==2.22.0
pytest==5.2.1
pytest-lazy-fixture==0.6.1
pytest-cov
pytest-html
pydot
......@@ -43,9 +43,9 @@ class TestDataGenerator:
assert len(gen) == 3
def test_iter(self, gen):
assert hasattr(gen, 'iterator') is False
assert hasattr(gen, '_iterator') is False
iter(gen)
assert hasattr(gen, 'iterator')
assert hasattr(gen, '_iterator')
assert gen._iterator == 0
def test_next(self, gen):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment