From d9f76257a3bcfe9be74f8420bd339025d440c12d Mon Sep 17 00:00:00 2001 From: Samir Si-Mohammed Date: Sat, 28 Dec 2019 16:29:02 +0100 Subject: [PATCH] Add Test Stage --- Jenkinsfile | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 665eba6..ec1cadf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,14 +1,29 @@ pipeline { - agent none + agent none stages { - stage('Build') { + stage('Build') { agent { docker { - image 'python:2-alpine' + image 'python:2-alpine' } } steps { - sh 'python -m py_compile sources/add2vals.py sources/calc.py' + sh 'python -m py_compile sources/add2vals.py sources/calc.py' + } + } + stage('Test') { + agent { + docker { + image 'qnib/pytest' + } + } + steps { + sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py' + } + post { + always { + junit 'test-reports/results.xml' + } } } }