From a26293e50988fdf55943eb37dea5b9afd18b4efe Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 18:37:05 +0530 Subject: [PATCH] changes in jenkins file --- Jenkinsfile | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4d11d6ae..c70a4962 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -130,8 +130,49 @@ pipeline { radon raw --json src/ > raw_report.json radon cc --json src/ > cc_report.json radon mi --json src/ > mi_report.json - //TODO: add conversion and HTML publisher step ''' + + + echo "Test coverage" + sh ''' source activate ${BUILD_TAG} + coverage run src/bitmessagemain.py -t 1 1 2 3 + python -m coverage xml -o reports/coverage.xml + ''' + echo "Style check" + sh ''' source activate ${BUILD_TAG} + pylint PyBitmessage || true + ''' + } + post{ + always{ + step([$class: 'CoberturaPublisher', + autoUpdateHealth: false, + autoUpdateStability: false, + coberturaReportFile: 'reports/coverage.xml', + failNoReports: false, + failUnhealthy: false, + failUnstable: false, + maxNumberOfBuilds: 10, + onlyStable: false, + sourceEncoding: 'ASCII', + zoomCoverageChart: false]) + } + } + } + + stage('Unit tests') { + steps { + sh ''' source activate ${BUILD_TAG} + python -m pytest --verbose --junit-xml reports/unit_tests.xml + ''' + } + post { + always { + // Archive unit tests for the future + junit (allowEmptyResults: true, + testResults: './reports/unit_tests.xml', + fingerprint: true) + } } }