From ef49698692520dd9f0cf4364487af62579b37a80 Mon Sep 17 00:00:00 2001
From: Stephan Seitz <stephan.seitz@fau.de>
Date: Wed, 21 Aug 2019 17:48:48 +0200
Subject: [PATCH] Add pyhtml to tests and artifacts

---
 .gitlab-ci.yml |  6 ++++--
 setup.py       | 11 ++++++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b0bf291f7..b76595e72 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,7 +17,7 @@ tests-and-coverage:
     - mkdir -p ~/.config/matplotlib
     - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
     - mkdir public
-    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. -m "not longrun"
+    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. -m "not longrun" --html test-report/index.html
   tags:
     - docker
     - cuda
@@ -26,6 +26,7 @@ tests-and-coverage:
     when: always
     paths:
       - coverage_report
+      - test-report
 
 # Nightly test  - runs "long run" jobs only
 test-longrun:
@@ -38,7 +39,7 @@ test-longrun:
     - export NUM_CORES=$(nproc --all)
     - mkdir -p ~/.config/matplotlib
     - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
-    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=.
+    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. --html test-report/index.html
   tags:
     - docker
     - cuda
@@ -46,6 +47,7 @@ test-longrun:
   artifacts:
     paths:
       - coverage_report
+      - test-report
 
 # Minimal tests in windows environment
 minimal-windows:
diff --git a/setup.py b/setup.py
index 9fa7d47d8..83a76f870 100644
--- a/setup.py
+++ b/setup.py
@@ -117,7 +117,16 @@ setup(name='pystencils',
           'doc': ['sphinx', 'sphinx_rtd_theme', 'nbsphinx',
                   'sphinxcontrib-bibtex', 'sphinx_autodoc_typehints', 'pandoc'],
       },
-      tests_require=['pytest', 'pytest-cov', 'pytest-xdist', 'flake8', 'nbformat', 'nbconvert', 'ipython'],
+      tests_require=['pytest',
+                     'pytest-cov',
+                     'pytest-html',
+                     'ansi2html',
+                     'pytest-xdist',
+                     'flake8',
+                     'nbformat',
+                     'nbconvert',
+                     'ipython'],
+
       python_requires=">=3.6",
       cmdclass={
           'quicktest': SimpleTestRunner
-- 
GitLab