pipeline { agent none stages { stage('Build') { agent { docker { image 'python:2-alpine' } } steps { sh 'python -m py_compile sources/add2vals.py sources/calc.py' } } stage('Test') { //1 agent { docker { image 'qnib/pytest' //2 } } steps { sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py' //3 } post { always { junit 'test-reports/results.xml' //4 } } } } }