From c2143f168162b8e8d336b340cc72b4776d918e19 Mon Sep 17 00:00:00 2001 From: joe Date: Thu, 11 Mar 2021 14:50:27 +0800 Subject: [PATCH] add test stage --- .gitignore | 3 +++ Jenkinsfile | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/.gitignore b/.gitignore index 0bb8ddd..506a864 100644 --- a/.gitignore +++ b/.gitignore @@ -98,3 +98,6 @@ ENV/ # mypy .mypy_cache/ + +.idea/ +test-reports/ \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 6b17112..b9ab81d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,5 +15,20 @@ pipeline { stash(name: 'compiled-results', includes: 'sources/*.py*') } } + stage('Test') { + agent { + docker { + image 'qnib/pytest' + } + } + steps { + sh 'py.test --junit-xml test-reports/results.xml sources/test_calc.py' + } + post { + always { + junit 'test-reports/results.xml' + } + } + } } }