From bb9c334add0b33e80ac31cd7909e61cf35c9a46a Mon Sep 17 00:00:00 2001 From: cis-kuldeep Date: Wed, 3 Jul 2019 19:15:01 +0530 Subject: [PATCH 01/85] jenkins file --- Jenkinsfile | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..0591afe0 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,54 @@ +pipeline { + agent admin + + triggers { + pollSCM('*/5 * * * *') + } + options { + skipDefaultCheckout(true) + // Keep the 10 most recent builds + buildDiscarder(logRotator(numToKeepStr: '10')) + timestamps() + } + environment { + PATH="/var/lib/jenkins/miniconda3/bin:$PATH" + } + + stages { + + stage ("Code pull"){ + steps{ + checkout scm + } + } + stage('Build environment') { + steps { + sh '''export WORKSPACE=`pwd` + source /home/cis/Desktop/ENV/pybitenv/bin/activate + pip install -r /home/cis/Desktop/Python/PyBitmessage/requirements.txt + ''' + } + } + stage('Test environment') { + steps { + sh '''export WORKSPACE=`pwd` + source /home/cis/Desktop/ENV/pybitenv/bin/activate + cd /home/cis/Desktop/Python/PyBitmessage + sudo python setup.py install + sudo /home/cis/.local/bin/nosetests --with-xunit tests + ''' + } + } + stage('Test Run') { + steps { + sh '''python /home/cis/Desktop/Python/PyBitmessage/src/bitmessagemain.py -t + ''' + } + } + } + post { + failure { + echo "Send e-mail, when failed" + } + } +} From 2f9f18be53004dc02aa65a581d0f17ce382fe844 Mon Sep 17 00:00:00 2001 From: cis-kuldeep Date: Wed, 3 Jul 2019 19:18:42 +0530 Subject: [PATCH 02/85] changes --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0591afe0..b452594c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { timestamps() } environment { - PATH="/var/lib/jenkins/miniconda3/bin:$PATH" + PATH="/home/cis/Desktop/ENV/pybitenv/bin:$PATH" } stages { From a526740e2fc4f1c6385fc93aa79a7ccd65b6a262 Mon Sep 17 00:00:00 2001 From: cis-kuldeep Date: Wed, 3 Jul 2019 19:22:03 +0530 Subject: [PATCH 03/85] change in jenkins file --- Jenkinsfile | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b452594c..742d3051 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,26 +1,12 @@ pipeline { - agent admin + agent any triggers { pollSCM('*/5 * * * *') } - options { - skipDefaultCheckout(true) - // Keep the 10 most recent builds - buildDiscarder(logRotator(numToKeepStr: '10')) - timestamps() - } - environment { - PATH="/home/cis/Desktop/ENV/pybitenv/bin:$PATH" - } + stages { - - stage ("Code pull"){ - steps{ - checkout scm - } - } stage('Build environment') { steps { sh '''export WORKSPACE=`pwd` From 7ef2acc2d007bda10d049b1d43b6d1f1e8f8c17b Mon Sep 17 00:00:00 2001 From: cis-kuldeep Date: Wed, 3 Jul 2019 19:30:16 +0530 Subject: [PATCH 04/85] chnages in jenkins --- Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 742d3051..b42de37e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,16 +9,14 @@ pipeline { stages { stage('Build environment') { steps { - sh '''export WORKSPACE=`pwd` - source /home/cis/Desktop/ENV/pybitenv/bin/activate + sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate pip install -r /home/cis/Desktop/Python/PyBitmessage/requirements.txt ''' } } stage('Test environment') { steps { - sh '''export WORKSPACE=`pwd` - source /home/cis/Desktop/ENV/pybitenv/bin/activate + sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate cd /home/cis/Desktop/Python/PyBitmessage sudo python setup.py install sudo /home/cis/.local/bin/nosetests --with-xunit tests From 6e061e198c6bd83317530872288ee1352edb6dd8 Mon Sep 17 00:00:00 2001 From: cis-kuldeep Date: Wed, 3 Jul 2019 19:37:22 +0530 Subject: [PATCH 05/85] changes in script --- Jenkinsfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b42de37e..345231f6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,9 +9,8 @@ pipeline { stages { stage('Build environment') { steps { - sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate - pip install -r /home/cis/Desktop/Python/PyBitmessage/requirements.txt - ''' + sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate''' + sh '''pip install -r /home/cis/Desktop/Python/PyBitmessage/requirements.txt''' } } stage('Test environment') { From d67d646913ad53db11921a4312c4653a50be57a9 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 4 Jul 2019 19:28:24 +0530 Subject: [PATCH 06/85] addition of dev req --- dev-requirements.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 dev-requirements.txt diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 00000000..2593ebd5 --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,10 @@ +check-manifest +coverage +flake8 +nose +pdoc +pylint +pytest +setuptools>=35 +testtools +unittest2 \ No newline at end of file From 5dd842f2385eb3c062768aa5564fdec1bb72e7d4 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 4 Jul 2019 19:40:30 +0530 Subject: [PATCH 07/85] change the jenkins file --- Jenkinsfile | 165 +++++++++++++++++++++++++++++++++++++++++++++------ Jenkinsfile1 | 37 ++++++++++++ 2 files changed, 184 insertions(+), 18 deletions(-) create mode 100644 Jenkinsfile1 diff --git a/Jenkinsfile b/Jenkinsfile index 345231f6..dd7a6580 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,37 +1,166 @@ +#!/usr/bin/env groovy + +/** + * Jenkinsfile + */ pipeline { agent any - - triggers { - pollSCM('*/5 * * * *') + options { + buildDiscarder( + // Only keep the 10 most recent builds + logRotator(numToKeepStr:'10')) + } + environment { + projectName = 'BitMessage' + emailTo = 'kuldeep.m@cisinlabs.com' + emailFrom = 'kuldeep.m@cisinlabs.com' + VIRTUAL_ENV = "${env.WORKSPACE}/venv" } - stages { - stage('Build environment') { + + /* + stage ('Checkout') { steps { - sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate''' - sh '''pip install -r /home/cis/Desktop/Python/PyBitmessage/requirements.txt''' + checkout scm } } - stage('Test environment') { + */ + + stage ('Install_Requirements') { steps { - sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate - cd /home/cis/Desktop/Python/PyBitmessage - sudo python setup.py install - sudo /home/cis/.local/bin/nosetests --with-xunit tests - ''' + sh """ + echo ${SHELL} + [ -d venv ] && rm -rf venv + #virtualenv --python=python2.7 venv + virtualenv venv + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + pip install --upgrade pip + pip install -r requirements.txt -r dev-requirements.txt + make clean + """ } } - stage('Test Run') { + + stage ('Check_style') { steps { - sh '''python /home/cis/Desktop/Python/PyBitmessage/src/bitmessagemain.py -t - ''' + sh """ + #. venv/bin/activate + [ -d report ] || mkdir report + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make check || true + """ + sh """ + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make flake8 | tee report/flake8.log || true + """ + sh """ + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make pylint | tee report/pylint.log || true + """ + step([$class: 'WarningsPublisher', + parserConfigurations: [[ + parserName: 'Pep8', + pattern: 'report/flake8.log' + ], + [ + parserName: 'pylint', + pattern: 'report/pylint.log' + ]], + unstableTotalAll: '0', + usePreviousBuildAsReference: true + ]) + } + } + + stage ('Unit Tests') { + steps { + sh """ + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make unittest || true + """ + } + + post { + always { + junit keepLongStdio: true, testResults: 'report/nosetests.xml' + publishHTML target: [ + reportDir: 'report/coverage', + reportFiles: 'index.html', + reportName: 'Coverage Report - Unit Test' + ] + } + } + } + + stage ('System Tests') { + steps { + sh """ + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + // Write file containing test node connection information if needed. + // writeFile file: "test/fixtures/nodes.yaml", text: "---\n- node: \n" + make systest || true + """ + } + + post { + always { + junit keepLongStdio: true, testResults: 'report/nosetests.xml' + publishHTML target: [ + reportDir: 'report/coverage', + reportFiles: 'index.html', + reportName: 'Coverage Report - System Test' + ] + } + } + } + + stage ('Docs') { + steps { + sh """ + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + PYTHONPATH=. pdoc --html --html-dir docs --overwrite env.projectName + """ + } + + post { + always { + publishHTML target: [ + reportDir: 'docs/*', + reportFiles: 'index.html', + reportName: 'Module Documentation' + ] + } + } + } + + stage ('Cleanup') { + steps { + sh 'rm -rf venv' } } } + post { failure { - echo "Send e-mail, when failed" + mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + + "is here: ${env.BUILD_URL}\nStarted by ${env.BUILD_CAUSE}" , + from: env.emailFrom, + //replyTo: env.emailFrom, + subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build failed", + to: env.emailTo + } + success { + mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build successful\n" + + "Started by ${env.BUILD_CAUSE}", + from: env.emailFrom, + //replyTo: env.emailFrom, + subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build successful", + to: env.emailTo } } -} +} \ No newline at end of file diff --git a/Jenkinsfile1 b/Jenkinsfile1 new file mode 100644 index 00000000..345231f6 --- /dev/null +++ b/Jenkinsfile1 @@ -0,0 +1,37 @@ +pipeline { + agent any + + triggers { + pollSCM('*/5 * * * *') + } + + + stages { + stage('Build environment') { + steps { + sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate''' + sh '''pip install -r /home/cis/Desktop/Python/PyBitmessage/requirements.txt''' + } + } + stage('Test environment') { + steps { + sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate + cd /home/cis/Desktop/Python/PyBitmessage + sudo python setup.py install + sudo /home/cis/.local/bin/nosetests --with-xunit tests + ''' + } + } + stage('Test Run') { + steps { + sh '''python /home/cis/Desktop/Python/PyBitmessage/src/bitmessagemain.py -t + ''' + } + } + } + post { + failure { + echo "Send e-mail, when failed" + } + } +} From 49cb0a69e0b3583e2acd0e94659024e21d8f7c34 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 4 Jul 2019 19:57:07 +0530 Subject: [PATCH 08/85] change in jenkins file --- Jenkinsfile | 2 +- requirements.txt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index dd7a6580..f36bce55 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,7 @@ pipeline { export PATH=${VIRTUAL_ENV}/bin:${PATH} pip install --upgrade pip pip install -r requirements.txt -r dev-requirements.txt - make clean + make -f Makefile clean """ } } diff --git a/requirements.txt b/requirements.txt index c55e5cf1..a17430c7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,9 @@ python_prctl psutil pycrypto +python +openssl +libssl-dev +git +python-msgpack +python-qt4 From 546f168d086b31c628197297928dd9210ec2d3e4 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 4 Jul 2019 20:09:36 +0530 Subject: [PATCH 09/85] change in requirement --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index a17430c7..b060b240 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,8 +2,8 @@ python_prctl psutil pycrypto python -openssl -libssl-dev +libssl-dev +libffi-dev git python-msgpack python-qt4 From 1b4009812fbc12d94787e586ddb25814bdf896c1 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 4 Jul 2019 20:56:56 +0530 Subject: [PATCH 10/85] change in req --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index b060b240..929c0b58 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,8 +2,8 @@ python_prctl psutil pycrypto python -libssl-dev -libffi-dev +libssl-dev git python-msgpack python-qt4 +pyOpenSSL From 391fe5446a7d0150e66456f0f64f2ac54b621612 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 4 Jul 2019 20:59:47 +0530 Subject: [PATCH 11/85] req change --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 929c0b58..d0e2ff5b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,6 @@ python_prctl psutil pycrypto python -libssl-dev git python-msgpack python-qt4 From 9585362d368fb151ae1f0e32ed5b843848894ac6 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 4 Jul 2019 21:04:54 +0530 Subject: [PATCH 12/85] depndencies change --- requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index d0e2ff5b..a4a587fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,7 @@ python_prctl psutil pycrypto -python -git +python-git python-msgpack python-qt4 pyOpenSSL From 934c6ce978d6264a24295c84dc045e61b2339ffc Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 4 Jul 2019 21:07:51 +0530 Subject: [PATCH 13/85] change --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index a4a587fb..275e7911 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ python_prctl psutil pycrypto python-git +pathlib python-msgpack python-qt4 pyOpenSSL From 44d849263dc3ceaf44b664541479e04bd3cacdcb Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 4 Jul 2019 21:18:43 +0530 Subject: [PATCH 14/85] change in pathlib --- Jenkinsfile | 1 - requirements.txt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f36bce55..4123a8d5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,7 +36,6 @@ pipeline { virtualenv venv #. venv/bin/activate export PATH=${VIRTUAL_ENV}/bin:${PATH} - pip install --upgrade pip pip install -r requirements.txt -r dev-requirements.txt make -f Makefile clean """ diff --git a/requirements.txt b/requirements.txt index 275e7911..12e26695 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ python_prctl psutil pycrypto python-git -pathlib +pathlib2 python-msgpack python-qt4 pyOpenSSL From 2b009700709b66ead34e5b22bae0c3576282c351 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 4 Jul 2019 21:21:38 +0530 Subject: [PATCH 15/85] change in req.txt --- requirements.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 12e26695..2e9da23f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,4 @@ python_prctl psutil pycrypto -python-git -pathlib2 -python-msgpack -python-qt4 -pyOpenSSL +nose From b6b43a3b93d72f61f02c40d9df766e1a3dc6834f Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 4 Jul 2019 21:23:25 +0530 Subject: [PATCH 16/85] change in jenkins file --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4123a8d5..dd7a6580 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,8 +36,9 @@ pipeline { virtualenv venv #. venv/bin/activate export PATH=${VIRTUAL_ENV}/bin:${PATH} + pip install --upgrade pip pip install -r requirements.txt -r dev-requirements.txt - make -f Makefile clean + make clean """ } } From e3b3ffcd7a2d05f39562e26d99d388fecffa3930 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 4 Jul 2019 21:24:43 +0530 Subject: [PATCH 17/85] change in jenkins file --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index dd7a6580..0f3f3630 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,6 @@ pipeline { export PATH=${VIRTUAL_ENV}/bin:${PATH} pip install --upgrade pip pip install -r requirements.txt -r dev-requirements.txt - make clean """ } } From 890f8e2475048309c30b2ce0be3487b0e1f819ce Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 4 Jul 2019 21:38:25 +0530 Subject: [PATCH 18/85] changes in makefile --- Makefile | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..f6baf160 --- /dev/null +++ b/Makefile @@ -0,0 +1,99 @@ +#!/usr/bin/make +# WARN: gmake syntax +######################################################## +# Makefile for $(NAME) +# +# useful targets: +# make check -- manifest checks +# make clean -- clean distutils +# make coverage_report -- code coverage report +# make flake8 -- flake8 checks +# make pylint -- source code checks +# make rpm -- build RPM package +# make sdist -- build python source distribution +# make systest -- runs the system tests +# make tests -- run all of the tests +# make unittest -- runs the unit tests +# +# Notes: +# 1) flake8 is a wrapper around pep8, pyflakes, and McCabe. +######################################################## +# variable section + +NAME = "python_jenkinsfile_testing" + +PYTHON=python +COVERAGE=coverage +NOSE_OPTS = --with-coverage --cover-package=$(NAME) +SITELIB = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()") + +VERSION := $(shell awk '/__version__/{print $$NF}' $(NAME)/__init__.py | sed "s/'//g") + +RPMSPECDIR = . +RPMSPEC = $(RPMSPECDIR)/$(NAME).spec +RPMRELEASE = 1 +RPMNVR = "$(NAME)-$(VERSION)-$(RPMRELEASE)" + +FLAKE8_IGNORE = E302,E203,E261 + +######################################################## + +all: clean check flake8 pylint tests + +flake8: + flake8 --ignore=$(FLAKE8_IGNORE) $(NAME)/ + flake8 --ignore=$(FLAKE8_IGNORE),E402 tests/ + +pylint: + find ./$(NAME) ./tests -name \*.py | xargs pylint --rcfile .pylintrc + +check: + @echo "Check-manifest disabled pending https://github.com/mgedmin/check-manifest/issues/68" + #check-manifest + +clean: + @echo "Cleaning up distutils stuff" + rm -rf build + rm -rf dist + rm -rf MANIFEST + rm -rf *.egg-info + @echo "Cleaning up byte compiled python stuff" + find . -type f -regex ".*\.py[co]$$" -delete + @echo "Cleaning up doc builds" + rm -rf docs/_build + rm -rf docs/api_modules + rm -rf docs/client_modules + @echo "Cleaning up test reports" + rm -rf report/* + +rpmcommon: sdist + @mkdir -p rpmbuild + @cp dist/*.gz rpmbuild/ + @cp -R conf/* rpmbuild/ + @sed -e 's#^Version:.*#Version: $(VERSION)#' -e 's#^Release:.*#Release: $(RPMRELEASE)#' $(RPMSPEC) >rpmbuild/$(NAME).spec + +rpm: rpmcommon + @rpmbuild --define "_topdir %(pwd)/rpmbuild" \ + --define "_builddir %{_topdir}" \ + --define "_rpmdir %{_topdir}" \ + --define "_srcrpmdir %{_topdir}" \ + --define "_specdir $(RPMSPECDIR)" \ + --define "_sourcedir %{_topdir}" \ + --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \ + --define "__python /usr/bin/python" \ + -ba rpmbuild/$(NAME).spec + @rm -f rpmbuild/$(NAME).spec + +sdist: clean + $(PYTHON) setup.py sdist + +tests: unittest systest coverage_report + +unittest: clean + nosetests $(NOSE_OPTS) tests/unit/* + +systest: clean + nosetests $(NOSE_OPTS) tests/system/* + +coverage_report: + $(COVERAGE) report --rcfile=".coveragerc" From a8d870bf7fd3d656325b0581ab304dee07f071b0 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 13:34:45 +0530 Subject: [PATCH 19/85] change in makefile --- Jenkinsfile | 1 + Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0f3f3630..dd7a6580 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,6 +38,7 @@ pipeline { export PATH=${VIRTUAL_ENV}/bin:${PATH} pip install --upgrade pip pip install -r requirements.txt -r dev-requirements.txt + make clean """ } } diff --git a/Makefile b/Makefile index f6baf160..065831d6 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ ######################################################## # variable section -NAME = "python_jenkinsfile_testing" +NAME = "PyBitmessage" PYTHON=python COVERAGE=coverage From 906bd0ff1020aa4ff2b172ca5623ceba2f40e42b Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 13:41:22 +0530 Subject: [PATCH 20/85] add init file --- __init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 __init__.py diff --git a/__init__.py b/__init__.py new file mode 100644 index 00000000..27244bf0 --- /dev/null +++ b/__init__.py @@ -0,0 +1,10 @@ + +""" +File: __init__.py +Author: Steve Francia +Email: 0 +Github: 0 +Description: <`0`> +""" +__version__ = '0.1.develop' +__author__ = '{Peter Sudhra+}' \ No newline at end of file From 31e40e7a9acf8a36ac33a281b926b5ce43369dc0 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 16:02:05 +0530 Subject: [PATCH 21/85] change in jenkins file --- Jenkinsfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dd7a6580..9292ce96 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,7 +30,7 @@ pipeline { stage ('Install_Requirements') { steps { sh """ - echo ${SHELL} + echo ${SHELL} [ -d venv ] && rm -rf venv #virtualenv --python=python2.7 venv virtualenv venv @@ -45,12 +45,12 @@ pipeline { stage ('Check_style') { steps { - sh """ - #. venv/bin/activate - [ -d report ] || mkdir report - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make check || true - """ + // sh """ + // #. venv/bin/activate + // [ -d report ] || mkdir report + // export PATH=${VIRTUAL_ENV}/bin:${PATH} + // make check || true + // """ sh """ export PATH=${VIRTUAL_ENV}/bin:${PATH} make flake8 | tee report/flake8.log || true From b372c64a51974854e81e3fe87460854876555466 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 16:25:37 +0530 Subject: [PATCH 22/85] change in manifest --- Jenkinsfile | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9292ce96..8e925de6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,36 +43,36 @@ pipeline { } } - stage ('Check_style') { - steps { - // sh """ - // #. venv/bin/activate - // [ -d report ] || mkdir report - // export PATH=${VIRTUAL_ENV}/bin:${PATH} - // make check || true - // """ - sh """ - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make flake8 | tee report/flake8.log || true - """ - sh """ - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make pylint | tee report/pylint.log || true - """ - step([$class: 'WarningsPublisher', - parserConfigurations: [[ - parserName: 'Pep8', - pattern: 'report/flake8.log' - ], - [ - parserName: 'pylint', - pattern: 'report/pylint.log' - ]], - unstableTotalAll: '0', - usePreviousBuildAsReference: true - ]) - } - } + // stage ('Check_style') { + // steps { + // sh """ + // #. venv/bin/activate + // [ -d report ] || mkdir report + // export PATH=${VIRTUAL_ENV}/bin:${PATH} + // make check || true + // """ + // sh """ + // export PATH=${VIRTUAL_ENV}/bin:${PATH} + // make flake8 | tee report/flake8.log || true + // """ + // sh """ + // export PATH=${VIRTUAL_ENV}/bin:${PATH} + // make pylint | tee report/pylint.log || true + // """ + // step([$class: 'WarningsPublisher', + // parserConfigurations: [[ + // parserName: 'Pep8', + // pattern: 'report/flake8.log' + // ], + // [ + // parserName: 'pylint', + // pattern: 'report/pylint.log' + // ]], + // unstableTotalAll: '0', + // usePreviousBuildAsReference: true + // ]) + // } + // } stage ('Unit Tests') { steps { From 315642359767e83dd854d8ab42054395108daae7 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 19:14:24 +0530 Subject: [PATCH 23/85] changes in jenkins file --- Jenkinsfile | 149 +++++++++++++--------------------------------------- 1 file changed, 37 insertions(+), 112 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8e925de6..f135aa79 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,31 +1,13 @@ -#!/usr/bin/env groovy - -/** - * Jenkinsfile - */ pipeline { agent any - options { - buildDiscarder( - // Only keep the 10 most recent builds - logRotator(numToKeepStr:'10')) - } - environment { - projectName = 'BitMessage' - emailTo = 'kuldeep.m@cisinlabs.com' - emailFrom = 'kuldeep.m@cisinlabs.com' - VIRTUAL_ENV = "${env.WORKSPACE}/venv" + + triggers { + pollSCM('*/5 * * * *') } + stages { - /* - stage ('Checkout') { - steps { - checkout scm - } - } - */ stage ('Install_Requirements') { steps { @@ -43,108 +25,51 @@ pipeline { } } - // stage ('Check_style') { - // steps { - // sh """ - // #. venv/bin/activate - // [ -d report ] || mkdir report - // export PATH=${VIRTUAL_ENV}/bin:${PATH} - // make check || true - // """ - // sh """ - // export PATH=${VIRTUAL_ENV}/bin:${PATH} - // make flake8 | tee report/flake8.log || true - // """ - // sh """ - // export PATH=${VIRTUAL_ENV}/bin:${PATH} - // make pylint | tee report/pylint.log || true - // """ - // step([$class: 'WarningsPublisher', - // parserConfigurations: [[ - // parserName: 'Pep8', - // pattern: 'report/flake8.log' - // ], - // [ - // parserName: 'pylint', - // pattern: 'report/pylint.log' - // ]], - // unstableTotalAll: '0', - // usePreviousBuildAsReference: true - // ]) - // } - // } - - stage ('Unit Tests') { + stage ('Check_style') { steps { sh """ - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make unittest || true - """ - } + if [ ! -d venv ] ; then - post { - always { - junit keepLongStdio: true, testResults: 'report/nosetests.xml' - publishHTML target: [ - reportDir: 'report/coverage', - reportFiles: 'index.html', - reportName: 'Coverage Report - Unit Test' - ] - } + virtualenv --python=python2.7 venv + fi + source venv/bin/activate + export PYTHONPATH="$PWD:$PYTHONPATH" + + pip install pylint + + cd repo + ### Need this because some strange control sequences when using default TERM=xterm + export TERM="linux" + + ## || exit 0 because pylint only exits with 0 if everything is correct + pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) MYMODULE/ > pylint.log || exit 0 + """ + step([$class: 'WarningsPublisher', + parserConfigurations: [ + [ + parserName: 'pylint', + pattern: 'report/pylint.log' + ]], + unstableTotalAll: '0', + usePreviousBuildAsReference: true + ]) } } - stage ('System Tests') { + stage('Test environment') { steps { - sh """ - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - // Write file containing test node connection information if needed. - // writeFile file: "test/fixtures/nodes.yaml", text: "---\n- node: \n" - make systest || true - """ - } - - post { - always { - junit keepLongStdio: true, testResults: 'report/nosetests.xml' - publishHTML target: [ - reportDir: 'report/coverage', - reportFiles: 'index.html', - reportName: 'Coverage Report - System Test' - ] - } + sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate + sh '''cd /home/cis/Desktop/Python/PyBitmessage''' + sh '''sudo python setup.py install''' + sh '''sudo /home/cis/.local/bin/nosetests --with-xunit tests''' } } - - stage ('Docs') { + stage('Test Run') { steps { - sh """ - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - PYTHONPATH=. pdoc --html --html-dir docs --overwrite env.projectName - """ - } - - post { - always { - publishHTML target: [ - reportDir: 'docs/*', - reportFiles: 'index.html', - reportName: 'Module Documentation' - ] - } - } - } - - stage ('Cleanup') { - steps { - sh 'rm -rf venv' + sh '''python /home/cis/Desktop/Python/PyBitmessage/src/bitmessagemain.py -t''' } } } - post { failure { mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + @@ -163,4 +88,4 @@ pipeline { to: env.emailTo } } -} \ No newline at end of file +} From 18fbe9629a283ca04a157eb1850ee25516703b1f Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 19:26:52 +0530 Subject: [PATCH 24/85] change in jenkins --- Jenkinsfile | 60 +++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f135aa79..e278e263 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,51 +25,57 @@ pipeline { } } - stage ('Check_style') { - steps { - sh """ - if [ ! -d venv ] ; then + // stage ('Check_style') { + // steps { + // sh """ + // if [ ! -d venv ] ; then - virtualenv --python=python2.7 venv - fi - source venv/bin/activate - export PYTHONPATH="$PWD:$PYTHONPATH" + // virtualenv --python=python2.7 venv + // fi + // source venv/bin/activate + // export PYTHONPATH="$PWD:$PYTHONPATH" - pip install pylint + // pip install pylint - cd repo - ### Need this because some strange control sequences when using default TERM=xterm - export TERM="linux" + // cd repo + // ### Need this because some strange control sequences when using default TERM=xterm + // export TERM="linux" - ## || exit 0 because pylint only exits with 0 if everything is correct - pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) MYMODULE/ > pylint.log || exit 0 - """ - step([$class: 'WarningsPublisher', - parserConfigurations: [ - [ - parserName: 'pylint', - pattern: 'report/pylint.log' - ]], - unstableTotalAll: '0', - usePreviousBuildAsReference: true - ]) - } - } + // ## || exit 0 because pylint only exits with 0 if everything is correct + // pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) MYMODULE/ > pylint.log || exit 0 + // """ + // step([$class: 'WarningsPublisher', + // parserConfigurations: [ + // [ + // parserName: 'pylint', + // pattern: 'report/pylint.log' + // ]], + // unstableTotalAll: '0', + // usePreviousBuildAsReference: true + // ]) + // } + // } stage('Test environment') { steps { - sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate + sh ''' + + source /home/cis/Desktop/ENV/pybitenv/bin/activate sh '''cd /home/cis/Desktop/Python/PyBitmessage''' sh '''sudo python setup.py install''' sh '''sudo /home/cis/.local/bin/nosetests --with-xunit tests''' } } + + stage('Test Run') { steps { sh '''python /home/cis/Desktop/Python/PyBitmessage/src/bitmessagemain.py -t''' } } } + + post { failure { mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + From a90eedefe7dc4d179b401175b3a71cbea5b2eb04 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 19:35:55 +0530 Subject: [PATCH 25/85] changes --- Jenkinsfile | 14 +- Jenkinsfile2 | 166 ++++++++++++++++ pylint.cfg | 542 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 718 insertions(+), 4 deletions(-) create mode 100644 Jenkinsfile2 create mode 100644 pylint.cfg diff --git a/Jenkinsfile b/Jenkinsfile index e278e263..c9faa090 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -60,10 +60,16 @@ pipeline { steps { sh ''' - source /home/cis/Desktop/ENV/pybitenv/bin/activate - sh '''cd /home/cis/Desktop/Python/PyBitmessage''' - sh '''sudo python setup.py install''' - sh '''sudo /home/cis/.local/bin/nosetests --with-xunit tests''' + echo ${SHELL} + [ -d venv ] && rm -rf venv + #virtualenv --python=python2.7 venv + virtualenv venv + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + sudo python setup.py install + sudo admin:///var/lib/jenkins/.local/bin/nosetests --with-xunit tests + + ''' } } diff --git a/Jenkinsfile2 b/Jenkinsfile2 new file mode 100644 index 00000000..d99b3f09 --- /dev/null +++ b/Jenkinsfile2 @@ -0,0 +1,166 @@ +#!/usr/bin/env groovy + +/** + * Jenkinsfile + */ +pipeline { + agent any + options { + buildDiscarder( + // Only keep the 10 most recent builds + logRotator(numToKeepStr:'10')) + } + environment { + projectName = 'BitMessage' + emailTo = 'kuldeep.m@cisinlabs.com' + emailFrom = 'kuldeep.m@cisinlabs.com' + VIRTUAL_ENV = "${env.WORKSPACE}/venv" + } + + stages { + + /* + stage ('Checkout') { + steps { + checkout scm + } + } + */ + + stage ('Install_Requirements') { + steps { + sh """ + echo ${SHELL} + [ -d venv ] && rm -rf venv + #virtualenv --python=python2.7 venv + virtualenv venv + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + pip install --upgrade pip + pip install -r requirements.txt -r dev-requirements.txt + make clean + """ + } + } + + stage ('Check_style') { + steps { + sh """ + #. venv/bin/activate + [ -d report ] || mkdir report + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make check || true + """ + sh """ + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make flake8 | tee report/flake8.log || true + """ + sh """ + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make pylint | tee report/pylint.log || true + """ + step([$class: 'WarningsPublisher', + parserConfigurations: [[ + parserName: 'Pep8', + pattern: 'report/flake8.log' + ], + [ + parserName: 'pylint', + pattern: 'report/pylint.log' + ]], + unstableTotalAll: '0', + usePreviousBuildAsReference: true + ]) + } + } + + stage ('Unit Tests') { + steps { + sh """ + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make unittest || true + """ + } + + post { + always { + junit keepLongStdio: true, testResults: 'report/nosetests.xml' + publishHTML target: [ + reportDir: 'report/coverage', + reportFiles: 'index.html', + reportName: 'Coverage Report - Unit Test' + ] + } + } + } + + stage ('System Tests') { + steps { + sh """ + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + // Write file containing test node connection information if needed. + // writeFile file: "test/fixtures/nodes.yaml", text: "---\n- node: \n" + make systest || true + """ + } + + post { + always { + junit keepLongStdio: true, testResults: 'report/nosetests.xml' + publishHTML target: [ + reportDir: 'report/coverage', + reportFiles: 'index.html', + reportName: 'Coverage Report - System Test' + ] + } + } + } + + stage ('Docs') { + steps { + sh """ + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + PYTHONPATH=. pdoc --html --html-dir docs --overwrite env.projectName + """ + } + + post { + always { + publishHTML target: [ + reportDir: 'docs/*', + reportFiles: 'index.html', + reportName: 'Module Documentation' + ] + } + } + } + + stage ('Cleanup') { + steps { + sh 'rm -rf venv' + } + } + } + + post { + failure { + mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + + "is here: ${env.BUILD_URL}\nStarted by ${env.BUILD_CAUSE}" , + from: env.emailFrom, + //replyTo: env.emailFrom, + subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build failed", + to: env.emailTo + } + success { + mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build successful\n" + + "Started by ${env.BUILD_CAUSE}", + from: env.emailFrom, + //replyTo: env.emailFrom, + subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build successful", + to: env.emailTo + } + } +} \ No newline at end of file diff --git a/pylint.cfg b/pylint.cfg new file mode 100644 index 00000000..4b4a617b --- /dev/null +++ b/pylint.cfg @@ -0,0 +1,542 @@ +[MASTER] + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code +extension-pkg-whitelist= + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the blacklist. The +# regex matches against base names, not paths. +ignore-patterns= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. +jobs=1 + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Specify a configuration file. +#rcfile= + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED +confidence= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +disable=print-statement, + parameter-unpacking, + unpacking-in-except, + old-raise-syntax, + backtick, + long-suffix, + old-ne-operator, + old-octal-literal, + import-star-module-level, + non-ascii-bytes-literal, + raw-checker-failed, + bad-inline-option, + locally-disabled, + locally-enabled, + file-ignored, + suppressed-message, + useless-suppression, + deprecated-pragma, + apply-builtin, + basestring-builtin, + buffer-builtin, + cmp-builtin, + coerce-builtin, + execfile-builtin, + file-builtin, + long-builtin, + raw_input-builtin, + reduce-builtin, + standarderror-builtin, + unicode-builtin, + xrange-builtin, + coerce-method, + delslice-method, + getslice-method, + setslice-method, + no-absolute-import, + old-division, + dict-iter-method, + dict-view-method, + next-method-called, + metaclass-assignment, + indexing-exception, + raising-string, + reload-builtin, + oct-method, + hex-method, + nonzero-method, + cmp-method, + input-builtin, + round-builtin, + intern-builtin, + unichr-builtin, + map-builtin-not-iterating, + zip-builtin-not-iterating, + range-builtin-not-iterating, + filter-builtin-not-iterating, + using-cmp-argument, + eq-without-hash, + div-method, + idiv-method, + rdiv-method, + exception-message-attribute, + invalid-str-codec, + sys-max-int, + bad-python3-import, + deprecated-string-function, + deprecated-str-translate-call, + deprecated-itertools-function, + deprecated-types-field, + next-method-defined, + dict-items-not-iterating, + dict-keys-not-iterating, + dict-values-not-iterating + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable=c-extension-no-member + + +[REPORTS] + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio).You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Tells whether to display a full report or only the messages +reports=no + +# Activate the evaluation score. +score=yes + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=optparse.Values,sys.exit + + +[LOGGING] + +# Logging modules to check that the string format arguments are in logging +# function parameter format +logging-modules=logging + + +[SPELLING] + +# Limits count of emitted suggestions for spelling mistakes +max-spelling-suggestions=4 + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb + +# A regular expression matching the name of dummy variables (i.e. expectedly +# not used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis. It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + + +[SIMILARITIES] + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[BASIC] + +# Naming style matching correct argument names +argument-naming-style=snake_case + +# Regular expression matching correct argument names. Overrides argument- +# naming-style +#argument-rgx= + +# Naming style matching correct attribute names +attr-naming-style=snake_case + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style +#attr-rgx= + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo, + bar, + baz, + toto, + tutu, + tata + +# Naming style matching correct class attribute names +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style +#class-attribute-rgx= + +# Naming style matching correct class names +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming-style +#class-rgx= + +# Naming style matching correct constant names +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style +#const-rgx= + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style +#function-rgx= + +# Good variable names which should always be accepted, separated by a comma +good-names=i, + j, + k, + ex, + Run, + _ + +# Include a hint for the correct naming format with invalid-name +include-naming-hint=no + +# Naming style matching correct inline iteration names +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style +#inlinevar-rgx= + +# Naming style matching correct method names +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style +#method-rgx= + +# Naming style matching correct module names +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style +#module-rgx= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +property-classes=abc.abstractproperty + +# Naming style matching correct variable names +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style +#variable-rgx= + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=100 + +# Maximum number of lines in a module +max-module-lines=1000 + +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. +no-space-check=trailing-comma, + dict-separator + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[IMPORTS] + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=regsub, + TERMIOS, + Bastion, + rexec + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict, + _fields, + _replace, + _source, + _make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in a if statement +max-bool-expr=5 + +# Maximum number of branch for function / method body +max-branches=12 + +# Maximum number of locals for function / method body +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of statements in function / method body +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception From 34e77e980d7df4e83630cff45715caeb55ec47a5 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 20:02:05 +0530 Subject: [PATCH 26/85] change in nosetest --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c9faa090..c10ae4ef 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,7 +67,7 @@ pipeline { #. venv/bin/activate export PATH=${VIRTUAL_ENV}/bin:${PATH} sudo python setup.py install - sudo admin:///var/lib/jenkins/.local/bin/nosetests --with-xunit tests + sudo var/lib/jenkins/.local/bin/nosetests --with-xunit tests ''' } From 048a7239a59e3f09847937a0998b55e440f10ebd Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 20:05:31 +0530 Subject: [PATCH 27/85] changes in file --- Jenkinsfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c10ae4ef..cf3389c0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,19 @@ pipeline { triggers { pollSCM('*/5 * * * *') } + + + options { + buildDiscarder( + // Only keep the 10 most recent builds + logRotator(numToKeepStr:'10')) + } + environment { + projectName = 'BitMessage' + emailTo = 'kuldeep.m@cisinlabs.com' + emailFrom = 'kuldeep.m@cisinlabs.com' + VIRTUAL_ENV = "${env.WORKSPACE}/venv" + } stages { @@ -66,7 +79,6 @@ pipeline { virtualenv venv #. venv/bin/activate export PATH=${VIRTUAL_ENV}/bin:${PATH} - sudo python setup.py install sudo var/lib/jenkins/.local/bin/nosetests --with-xunit tests ''' From 5be7fd1840aa1c3d5cde3fecb7c6366f16a76cf7 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 20:15:26 +0530 Subject: [PATCH 28/85] change in jenkin --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index cf3389c0..6630a0c3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -79,7 +79,8 @@ pipeline { virtualenv venv #. venv/bin/activate export PATH=${VIRTUAL_ENV}/bin:${PATH} - sudo var/lib/jenkins/.local/bin/nosetests --with-xunit tests + sudo python setup.py install + sudo /home/cis/.local/bin/nosetests --with-xunit tests ''' } From 7749268e621471a5b116e2d0dba491e5aacdb500 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 20:20:35 +0530 Subject: [PATCH 29/85] changes in file --- Jenkinsfile | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6630a0c3..c94727dd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -95,22 +95,22 @@ pipeline { } - post { - failure { - mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + - "is here: ${env.BUILD_URL}\nStarted by ${env.BUILD_CAUSE}" , - from: env.emailFrom, - //replyTo: env.emailFrom, - subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build failed", - to: env.emailTo - } - success { - mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build successful\n" + - "Started by ${env.BUILD_CAUSE}", - from: env.emailFrom, - //replyTo: env.emailFrom, - subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build successful", - to: env.emailTo - } - } + // post { + // failure { + // mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + + // "is here: ${env.BUILD_URL}\nStarted by ${env.BUILD_CAUSE}" , + // from: env.emailFrom, + // //replyTo: env.emailFrom, + // subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build failed", + // to: env.emailTo + // } + // success { + // mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build successful\n" + + // "Started by ${env.BUILD_CAUSE}", + // from: env.emailFrom, + // //replyTo: env.emailFrom, + // subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build successful", + // to: env.emailTo + // } + // } } From 68b3c7edb2c3ed044282b2c061e6e19dde87d51a Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 20:21:38 +0530 Subject: [PATCH 30/85] changes in file --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c94727dd..45172543 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -112,5 +112,5 @@ pipeline { // subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build successful", // to: env.emailTo // } - // } + } } From 95b6ef42f1be8ada42537af8a4f3a5140d82d858 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 20:24:52 +0530 Subject: [PATCH 31/85] changes in file --- Jenkinsfile | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 45172543..0c70c617 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -95,22 +95,9 @@ pipeline { } - // post { - // failure { - // mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + - // "is here: ${env.BUILD_URL}\nStarted by ${env.BUILD_CAUSE}" , - // from: env.emailFrom, - // //replyTo: env.emailFrom, - // subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build failed", - // to: env.emailTo - // } - // success { - // mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build successful\n" + - // "Started by ${env.BUILD_CAUSE}", - // from: env.emailFrom, - // //replyTo: env.emailFrom, - // subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build successful", - // to: env.emailTo - // } + post { + failure { + echo "Send e-mail, when failed" + } } } From c5872c4ea10e48613f78f8a95e1f56f986af022f Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 21:03:39 +0530 Subject: [PATCH 32/85] changes in file13 --- Jenkinsfile | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0c70c617..8690b6ad 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,5 @@ pipeline { agent any - - triggers { - pollSCM('*/5 * * * *') - } - - options { buildDiscarder( // Only keep the 10 most recent builds @@ -17,10 +11,16 @@ pipeline { emailFrom = 'kuldeep.m@cisinlabs.com' VIRTUAL_ENV = "${env.WORKSPACE}/venv" } - stages { + /* + stage ('Checkout') { + steps { + checkout scm + } + } + */ stage ('Install_Requirements') { steps { @@ -38,6 +38,7 @@ pipeline { } } + // stage ('Check_style') { // steps { // sh """ @@ -72,16 +73,14 @@ pipeline { stage('Test environment') { steps { sh ''' - echo ${SHELL} [ -d venv ] && rm -rf venv #virtualenv --python=python2.7 venv virtualenv venv #. venv/bin/activate export PATH=${VIRTUAL_ENV}/bin:${PATH} - sudo python setup.py install + python setup.py install sudo /home/cis/.local/bin/nosetests --with-xunit tests - ''' } } @@ -89,7 +88,13 @@ pipeline { stage('Test Run') { steps { - sh '''python /home/cis/Desktop/Python/PyBitmessage/src/bitmessagemain.py -t''' + sh '''python src/bitmessagemain.py -t''' + } + } + + stage ('Cleanup') { + steps { + sh 'rm -rf venv' } } } @@ -97,7 +102,22 @@ pipeline { post { failure { - echo "Send e-mail, when failed" + mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + + "is here: ${env.BUILD_URL}\nStarted by ${env.BUILD_CAUSE}" , + from: env.emailFrom, + //replyTo: env.emailFrom, + subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build failed", + to: env.emailTo + } + success { + mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build successful\n" + + "Started by ${env.BUILD_CAUSE}", + from: env.emailFrom, + //replyTo: env.emailFrom, + subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build successful", + to: env.emailTo } } + + } From 5045f95fc223b5463c0aaf3a857b68afcd75f647 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 21:14:04 +0530 Subject: [PATCH 33/85] changes in file13 --- Jenkinsfile | 143 ++++++++++++++++++++++++++++---------------- Jenkinsfile2 | 166 --------------------------------------------------- 2 files changed, 93 insertions(+), 216 deletions(-) delete mode 100644 Jenkinsfile2 diff --git a/Jenkinsfile b/Jenkinsfile index 8690b6ad..d99b3f09 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,8 @@ +#!/usr/bin/env groovy + +/** + * Jenkinsfile + */ pipeline { agent any options { @@ -38,57 +43,98 @@ pipeline { } } - - // stage ('Check_style') { - // steps { - // sh """ - // if [ ! -d venv ] ; then - - // virtualenv --python=python2.7 venv - // fi - // source venv/bin/activate - // export PYTHONPATH="$PWD:$PYTHONPATH" - - // pip install pylint - - // cd repo - // ### Need this because some strange control sequences when using default TERM=xterm - // export TERM="linux" - - // ## || exit 0 because pylint only exits with 0 if everything is correct - // pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) MYMODULE/ > pylint.log || exit 0 - // """ - // step([$class: 'WarningsPublisher', - // parserConfigurations: [ - // [ - // parserName: 'pylint', - // pattern: 'report/pylint.log' - // ]], - // unstableTotalAll: '0', - // usePreviousBuildAsReference: true - // ]) - // } - // } - - stage('Test environment') { + stage ('Check_style') { steps { - sh ''' - echo ${SHELL} - [ -d venv ] && rm -rf venv - #virtualenv --python=python2.7 venv - virtualenv venv - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - python setup.py install - sudo /home/cis/.local/bin/nosetests --with-xunit tests - ''' + sh """ + #. venv/bin/activate + [ -d report ] || mkdir report + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make check || true + """ + sh """ + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make flake8 | tee report/flake8.log || true + """ + sh """ + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make pylint | tee report/pylint.log || true + """ + step([$class: 'WarningsPublisher', + parserConfigurations: [[ + parserName: 'Pep8', + pattern: 'report/flake8.log' + ], + [ + parserName: 'pylint', + pattern: 'report/pylint.log' + ]], + unstableTotalAll: '0', + usePreviousBuildAsReference: true + ]) } } - - stage('Test Run') { + stage ('Unit Tests') { steps { - sh '''python src/bitmessagemain.py -t''' + sh """ + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make unittest || true + """ + } + + post { + always { + junit keepLongStdio: true, testResults: 'report/nosetests.xml' + publishHTML target: [ + reportDir: 'report/coverage', + reportFiles: 'index.html', + reportName: 'Coverage Report - Unit Test' + ] + } + } + } + + stage ('System Tests') { + steps { + sh """ + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + // Write file containing test node connection information if needed. + // writeFile file: "test/fixtures/nodes.yaml", text: "---\n- node: \n" + make systest || true + """ + } + + post { + always { + junit keepLongStdio: true, testResults: 'report/nosetests.xml' + publishHTML target: [ + reportDir: 'report/coverage', + reportFiles: 'index.html', + reportName: 'Coverage Report - System Test' + ] + } + } + } + + stage ('Docs') { + steps { + sh """ + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + PYTHONPATH=. pdoc --html --html-dir docs --overwrite env.projectName + """ + } + + post { + always { + publishHTML target: [ + reportDir: 'docs/*', + reportFiles: 'index.html', + reportName: 'Module Documentation' + ] + } } } @@ -99,7 +145,6 @@ pipeline { } } - post { failure { mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + @@ -118,6 +163,4 @@ pipeline { to: env.emailTo } } - - -} +} \ No newline at end of file diff --git a/Jenkinsfile2 b/Jenkinsfile2 deleted file mode 100644 index d99b3f09..00000000 --- a/Jenkinsfile2 +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/env groovy - -/** - * Jenkinsfile - */ -pipeline { - agent any - options { - buildDiscarder( - // Only keep the 10 most recent builds - logRotator(numToKeepStr:'10')) - } - environment { - projectName = 'BitMessage' - emailTo = 'kuldeep.m@cisinlabs.com' - emailFrom = 'kuldeep.m@cisinlabs.com' - VIRTUAL_ENV = "${env.WORKSPACE}/venv" - } - - stages { - - /* - stage ('Checkout') { - steps { - checkout scm - } - } - */ - - stage ('Install_Requirements') { - steps { - sh """ - echo ${SHELL} - [ -d venv ] && rm -rf venv - #virtualenv --python=python2.7 venv - virtualenv venv - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - pip install --upgrade pip - pip install -r requirements.txt -r dev-requirements.txt - make clean - """ - } - } - - stage ('Check_style') { - steps { - sh """ - #. venv/bin/activate - [ -d report ] || mkdir report - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make check || true - """ - sh """ - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make flake8 | tee report/flake8.log || true - """ - sh """ - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make pylint | tee report/pylint.log || true - """ - step([$class: 'WarningsPublisher', - parserConfigurations: [[ - parserName: 'Pep8', - pattern: 'report/flake8.log' - ], - [ - parserName: 'pylint', - pattern: 'report/pylint.log' - ]], - unstableTotalAll: '0', - usePreviousBuildAsReference: true - ]) - } - } - - stage ('Unit Tests') { - steps { - sh """ - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make unittest || true - """ - } - - post { - always { - junit keepLongStdio: true, testResults: 'report/nosetests.xml' - publishHTML target: [ - reportDir: 'report/coverage', - reportFiles: 'index.html', - reportName: 'Coverage Report - Unit Test' - ] - } - } - } - - stage ('System Tests') { - steps { - sh """ - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - // Write file containing test node connection information if needed. - // writeFile file: "test/fixtures/nodes.yaml", text: "---\n- node: \n" - make systest || true - """ - } - - post { - always { - junit keepLongStdio: true, testResults: 'report/nosetests.xml' - publishHTML target: [ - reportDir: 'report/coverage', - reportFiles: 'index.html', - reportName: 'Coverage Report - System Test' - ] - } - } - } - - stage ('Docs') { - steps { - sh """ - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - PYTHONPATH=. pdoc --html --html-dir docs --overwrite env.projectName - """ - } - - post { - always { - publishHTML target: [ - reportDir: 'docs/*', - reportFiles: 'index.html', - reportName: 'Module Documentation' - ] - } - } - } - - stage ('Cleanup') { - steps { - sh 'rm -rf venv' - } - } - } - - post { - failure { - mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + - "is here: ${env.BUILD_URL}\nStarted by ${env.BUILD_CAUSE}" , - from: env.emailFrom, - //replyTo: env.emailFrom, - subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build failed", - to: env.emailTo - } - success { - mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build successful\n" + - "Started by ${env.BUILD_CAUSE}", - from: env.emailFrom, - //replyTo: env.emailFrom, - subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build successful", - to: env.emailTo - } - } -} \ No newline at end of file From f4f46da249fe1c2bc9640ff244150d36b4cdb6a3 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 5 Jul 2019 21:30:57 +0530 Subject: [PATCH 34/85] changes in file14 --- Jenkinsfile | 143 ++++++++++++++++++--------------------------------- Jenkinsfile1 | 3 ++ 2 files changed, 53 insertions(+), 93 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d99b3f09..8690b6ad 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,3 @@ -#!/usr/bin/env groovy - -/** - * Jenkinsfile - */ pipeline { agent any options { @@ -43,98 +38,57 @@ pipeline { } } - stage ('Check_style') { + + // stage ('Check_style') { + // steps { + // sh """ + // if [ ! -d venv ] ; then + + // virtualenv --python=python2.7 venv + // fi + // source venv/bin/activate + // export PYTHONPATH="$PWD:$PYTHONPATH" + + // pip install pylint + + // cd repo + // ### Need this because some strange control sequences when using default TERM=xterm + // export TERM="linux" + + // ## || exit 0 because pylint only exits with 0 if everything is correct + // pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) MYMODULE/ > pylint.log || exit 0 + // """ + // step([$class: 'WarningsPublisher', + // parserConfigurations: [ + // [ + // parserName: 'pylint', + // pattern: 'report/pylint.log' + // ]], + // unstableTotalAll: '0', + // usePreviousBuildAsReference: true + // ]) + // } + // } + + stage('Test environment') { steps { - sh """ - #. venv/bin/activate - [ -d report ] || mkdir report - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make check || true - """ - sh """ - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make flake8 | tee report/flake8.log || true - """ - sh """ - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make pylint | tee report/pylint.log || true - """ - step([$class: 'WarningsPublisher', - parserConfigurations: [[ - parserName: 'Pep8', - pattern: 'report/flake8.log' - ], - [ - parserName: 'pylint', - pattern: 'report/pylint.log' - ]], - unstableTotalAll: '0', - usePreviousBuildAsReference: true - ]) + sh ''' + echo ${SHELL} + [ -d venv ] && rm -rf venv + #virtualenv --python=python2.7 venv + virtualenv venv + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + python setup.py install + sudo /home/cis/.local/bin/nosetests --with-xunit tests + ''' } } - stage ('Unit Tests') { + + stage('Test Run') { steps { - sh """ - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make unittest || true - """ - } - - post { - always { - junit keepLongStdio: true, testResults: 'report/nosetests.xml' - publishHTML target: [ - reportDir: 'report/coverage', - reportFiles: 'index.html', - reportName: 'Coverage Report - Unit Test' - ] - } - } - } - - stage ('System Tests') { - steps { - sh """ - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - // Write file containing test node connection information if needed. - // writeFile file: "test/fixtures/nodes.yaml", text: "---\n- node: \n" - make systest || true - """ - } - - post { - always { - junit keepLongStdio: true, testResults: 'report/nosetests.xml' - publishHTML target: [ - reportDir: 'report/coverage', - reportFiles: 'index.html', - reportName: 'Coverage Report - System Test' - ] - } - } - } - - stage ('Docs') { - steps { - sh """ - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - PYTHONPATH=. pdoc --html --html-dir docs --overwrite env.projectName - """ - } - - post { - always { - publishHTML target: [ - reportDir: 'docs/*', - reportFiles: 'index.html', - reportName: 'Module Documentation' - ] - } + sh '''python src/bitmessagemain.py -t''' } } @@ -145,6 +99,7 @@ pipeline { } } + post { failure { mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + @@ -163,4 +118,6 @@ pipeline { to: env.emailTo } } -} \ No newline at end of file + + +} diff --git a/Jenkinsfile1 b/Jenkinsfile1 index 345231f6..c4012809 100644 --- a/Jenkinsfile1 +++ b/Jenkinsfile1 @@ -7,6 +7,7 @@ pipeline { stages { + stage('Build environment') { steps { sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate''' @@ -18,6 +19,7 @@ pipeline { sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate cd /home/cis/Desktop/Python/PyBitmessage sudo python setup.py install + sudo su sudo /home/cis/.local/bin/nosetests --with-xunit tests ''' } @@ -29,6 +31,7 @@ pipeline { } } } + post { failure { echo "Send e-mail, when failed" From d16ac68fadf299f53710d20131f6f4d67926723d Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Sat, 6 Jul 2019 18:11:35 +0530 Subject: [PATCH 35/85] add of pylint check --- Jenkinsfile | 24 +++++++- Jenkinsfile2 | 166 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 189 insertions(+), 1 deletion(-) create mode 100644 Jenkinsfile2 diff --git a/Jenkinsfile b/Jenkinsfile index 8690b6ad..91e4e7b6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,7 @@ pipeline { environment { projectName = 'BitMessage' emailTo = 'kuldeep.m@cisinlabs.com' - emailFrom = 'kuldeep.m@cisinlabs.com' + emailFrom = 'cis.dev393@gmail.com' VIRTUAL_ENV = "${env.WORKSPACE}/venv" } @@ -85,6 +85,28 @@ pipeline { } } + stage('Pylint Checker') { + steps { + sh ''' + echo ${SHELL} + [ -d venv ] && rm -rf venv + #virtualenv --python=python2.7 venv + virtualenv venv + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + + pip install pylint + + cd repo + ### Need this because some strange control sequences when using default TERM=xterm + export TERM="linux" + + ## || exit 0 because pylint only exits with 0 if everything is correct + pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) Pybitmessage/ > pylint.log || exit 0 + ''' + } + } + stage('Test Run') { steps { diff --git a/Jenkinsfile2 b/Jenkinsfile2 new file mode 100644 index 00000000..d99b3f09 --- /dev/null +++ b/Jenkinsfile2 @@ -0,0 +1,166 @@ +#!/usr/bin/env groovy + +/** + * Jenkinsfile + */ +pipeline { + agent any + options { + buildDiscarder( + // Only keep the 10 most recent builds + logRotator(numToKeepStr:'10')) + } + environment { + projectName = 'BitMessage' + emailTo = 'kuldeep.m@cisinlabs.com' + emailFrom = 'kuldeep.m@cisinlabs.com' + VIRTUAL_ENV = "${env.WORKSPACE}/venv" + } + + stages { + + /* + stage ('Checkout') { + steps { + checkout scm + } + } + */ + + stage ('Install_Requirements') { + steps { + sh """ + echo ${SHELL} + [ -d venv ] && rm -rf venv + #virtualenv --python=python2.7 venv + virtualenv venv + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + pip install --upgrade pip + pip install -r requirements.txt -r dev-requirements.txt + make clean + """ + } + } + + stage ('Check_style') { + steps { + sh """ + #. venv/bin/activate + [ -d report ] || mkdir report + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make check || true + """ + sh """ + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make flake8 | tee report/flake8.log || true + """ + sh """ + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make pylint | tee report/pylint.log || true + """ + step([$class: 'WarningsPublisher', + parserConfigurations: [[ + parserName: 'Pep8', + pattern: 'report/flake8.log' + ], + [ + parserName: 'pylint', + pattern: 'report/pylint.log' + ]], + unstableTotalAll: '0', + usePreviousBuildAsReference: true + ]) + } + } + + stage ('Unit Tests') { + steps { + sh """ + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make unittest || true + """ + } + + post { + always { + junit keepLongStdio: true, testResults: 'report/nosetests.xml' + publishHTML target: [ + reportDir: 'report/coverage', + reportFiles: 'index.html', + reportName: 'Coverage Report - Unit Test' + ] + } + } + } + + stage ('System Tests') { + steps { + sh """ + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + // Write file containing test node connection information if needed. + // writeFile file: "test/fixtures/nodes.yaml", text: "---\n- node: \n" + make systest || true + """ + } + + post { + always { + junit keepLongStdio: true, testResults: 'report/nosetests.xml' + publishHTML target: [ + reportDir: 'report/coverage', + reportFiles: 'index.html', + reportName: 'Coverage Report - System Test' + ] + } + } + } + + stage ('Docs') { + steps { + sh """ + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + PYTHONPATH=. pdoc --html --html-dir docs --overwrite env.projectName + """ + } + + post { + always { + publishHTML target: [ + reportDir: 'docs/*', + reportFiles: 'index.html', + reportName: 'Module Documentation' + ] + } + } + } + + stage ('Cleanup') { + steps { + sh 'rm -rf venv' + } + } + } + + post { + failure { + mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + + "is here: ${env.BUILD_URL}\nStarted by ${env.BUILD_CAUSE}" , + from: env.emailFrom, + //replyTo: env.emailFrom, + subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build failed", + to: env.emailTo + } + success { + mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build successful\n" + + "Started by ${env.BUILD_CAUSE}", + from: env.emailFrom, + //replyTo: env.emailFrom, + subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build successful", + to: env.emailTo + } + } +} \ No newline at end of file From ccb4775991ce1c90d1def2aa19048a6ccbfcfa6c Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Sat, 6 Jul 2019 18:23:40 +0530 Subject: [PATCH 36/85] add of pylint check1 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 91e4e7b6..3722d16a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -97,7 +97,7 @@ pipeline { pip install pylint - cd repo + echo ${pwd} ### Need this because some strange control sequences when using default TERM=xterm export TERM="linux" From 8f6cad8b12df753c457a35d9028baaaeb2913202 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Sat, 6 Jul 2019 18:27:36 +0530 Subject: [PATCH 37/85] add of pylint check2 --- Jenkinsfile | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3722d16a..d502ed73 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ pipeline { [ -d venv ] && rm -rf venv #virtualenv --python=python2.7 venv virtualenv venv - #. venv/bin/activate + source venv/bin/activate export PATH=${VIRTUAL_ENV}/bin:${PATH} pip install --upgrade pip pip install -r requirements.txt -r dev-requirements.txt @@ -77,7 +77,7 @@ pipeline { [ -d venv ] && rm -rf venv #virtualenv --python=python2.7 venv virtualenv venv - #. venv/bin/activate + source venv/bin/activate export PATH=${VIRTUAL_ENV}/bin:${PATH} python setup.py install sudo /home/cis/.local/bin/nosetests --with-xunit tests @@ -85,27 +85,27 @@ pipeline { } } - stage('Pylint Checker') { - steps { - sh ''' - echo ${SHELL} - [ -d venv ] && rm -rf venv - #virtualenv --python=python2.7 venv - virtualenv venv - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} + // stage('Pylint Checker') { + // steps { + // sh ''' + // echo ${SHELL} + // [ -d venv ] && rm -rf venv + // #virtualenv --python=python2.7 venv + // virtualenv venv + // source venv/bin/activate + // export PATH=${VIRTUAL_ENV}/bin:${PATH} - pip install pylint + // pip install pylint - echo ${pwd} - ### Need this because some strange control sequences when using default TERM=xterm - export TERM="linux" + // echo ${pwd} + // ### Need this because some strange control sequences when using default TERM=xterm + // export TERM="linux" - ## || exit 0 because pylint only exits with 0 if everything is correct - pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) Pybitmessage/ > pylint.log || exit 0 - ''' - } - } + // ## || exit 0 because pylint only exits with 0 if everything is correct + // pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) Pybitmessage/ > pylint.log || exit 0 + // ''' + // } + // } stage('Test Run') { From 43e42bbe6cbfdb841dbb1707a9af6ce2dc555222 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Sat, 6 Jul 2019 19:15:06 +0530 Subject: [PATCH 38/85] add of pylint check3 --- Jenkinsfile | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d502ed73..5cb1a9b6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ pipeline { [ -d venv ] && rm -rf venv #virtualenv --python=python2.7 venv virtualenv venv - source venv/bin/activate + #. venv/bin/activate export PATH=${VIRTUAL_ENV}/bin:${PATH} pip install --upgrade pip pip install -r requirements.txt -r dev-requirements.txt @@ -77,7 +77,7 @@ pipeline { [ -d venv ] && rm -rf venv #virtualenv --python=python2.7 venv virtualenv venv - source venv/bin/activate + #. venv/bin/activate export PATH=${VIRTUAL_ENV}/bin:${PATH} python setup.py install sudo /home/cis/.local/bin/nosetests --with-xunit tests @@ -85,27 +85,26 @@ pipeline { } } - // stage('Pylint Checker') { - // steps { - // sh ''' - // echo ${SHELL} - // [ -d venv ] && rm -rf venv - // #virtualenv --python=python2.7 venv - // virtualenv venv - // source venv/bin/activate - // export PATH=${VIRTUAL_ENV}/bin:${PATH} + stage('Pylint Checker') { + steps { + sh ''' + echo ${SHELL} + [ -d venv ] && rm -rf venv + #virtualenv --python=python2.7 venv + virtualenv venv + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} - // pip install pylint + pip install pylint - // echo ${pwd} - // ### Need this because some strange control sequences when using default TERM=xterm - // export TERM="linux" + + export TERM="linux" - // ## || exit 0 because pylint only exits with 0 if everything is correct - // pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) Pybitmessage/ > pylint.log || exit 0 - // ''' - // } - // } + ## || exit 0 because pylint only exits with 0 if everything is correct + pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) Pybitmessage/ > pylint.log || exit 0 + ''' + } + } stage('Test Run') { From 14679122993bc40effd59ea4c931b1f2408cc4d4 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Tue, 30 Jul 2019 14:47:16 +0530 Subject: [PATCH 39/85] checkout scm file --- Jenkinsfile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5cb1a9b6..bca202e4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,9 +1,13 @@ pipeline { agent any + triggers { + pollSCM('*/5 * * * 1-5') + } options { - buildDiscarder( - // Only keep the 10 most recent builds - logRotator(numToKeepStr:'10')) + skipDefaultCheckout(true) + // Keep the 10 most recent builds + buildDiscarder(logRotator(numToKeepStr: '10')) + timestamps() } environment { projectName = 'BitMessage' @@ -14,13 +18,13 @@ pipeline { stages { - /* + stage ('Checkout') { steps { checkout scm } } - */ + stage ('Install_Requirements') { steps { From cc9fdaf28f71805faa52b1b480c068c16d5b95f3 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Tue, 30 Jul 2019 15:15:13 +0530 Subject: [PATCH 40/85] checkout scm file again --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bca202e4..3701408e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,11 +19,11 @@ pipeline { stages { - stage ('Checkout') { - steps { - checkout scm - } - } + // stage ('Checkout') { + // steps { + // checkout scm + // } + // } stage ('Install_Requirements') { From ff36d380a5fa3e532a6c488731b2b46c115b4a6d Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Tue, 30 Jul 2019 15:54:43 +0530 Subject: [PATCH 41/85] checkout scm file 3 --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3701408e..bca202e4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,11 +19,11 @@ pipeline { stages { - // stage ('Checkout') { - // steps { - // checkout scm - // } - // } + stage ('Checkout') { + steps { + checkout scm + } + } stage ('Install_Requirements') { From 6d505f5a742e822fee32781f7bf506cdefdabc99 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Mon, 12 Aug 2019 21:21:03 +0530 Subject: [PATCH 42/85] changes in jenkins file --- Jenkinsfile | 66 ++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bca202e4..7eb2ff75 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,10 +4,10 @@ pipeline { pollSCM('*/5 * * * 1-5') } options { - skipDefaultCheckout(true) + // skipDefaultCheckout(true) // Keep the 10 most recent builds buildDiscarder(logRotator(numToKeepStr: '10')) - timestamps() + // timestamps() } environment { projectName = 'BitMessage' @@ -19,11 +19,11 @@ pipeline { stages { - stage ('Checkout') { - steps { - checkout scm - } - } + // stage ('Checkout') { + // steps { + // checkout scm + // } + // } stage ('Install_Requirements') { @@ -43,36 +43,36 @@ pipeline { } - // stage ('Check_style') { - // steps { - // sh """ - // if [ ! -d venv ] ; then + stage ('Check_style') { + steps { + sh """ + if [ ! -d venv ] ; then - // virtualenv --python=python2.7 venv - // fi - // source venv/bin/activate - // export PYTHONPATH="$PWD:$PYTHONPATH" + virtualenv --python=python2.7 venv + fi + source venv/bin/activate + export PYTHONPATH="$PWD:$PYTHONPATH" - // pip install pylint + pip install pylint - // cd repo - // ### Need this because some strange control sequences when using default TERM=xterm - // export TERM="linux" + cd repo + ### Need this because some strange control sequences when using default TERM=xterm + export TERM="linux" - // ## || exit 0 because pylint only exits with 0 if everything is correct - // pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) MYMODULE/ > pylint.log || exit 0 - // """ - // step([$class: 'WarningsPublisher', - // parserConfigurations: [ - // [ - // parserName: 'pylint', - // pattern: 'report/pylint.log' - // ]], - // unstableTotalAll: '0', - // usePreviousBuildAsReference: true - // ]) - // } - // } + ## || exit 0 because pylint only exits with 0 if everything is correct + pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) MYMODULE/ > pylint.log || exit 0 + """ + step([$class: 'WarningsPublisher', + parserConfigurations: [ + [ + parserName: 'pylint', + pattern: 'report/pylint.log' + ]], + unstableTotalAll: '0', + usePreviousBuildAsReference: true + ]) + } + } stage('Test environment') { steps { From afa4f515d36ce30b6437e78b7035812cd2e333fa Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Tue, 13 Aug 2019 15:58:05 +0530 Subject: [PATCH 43/85] changes in file --- Jenkinsfile | 84 ++++++++++++++++++++++++++--------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7eb2ff75..2a5793e6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,36 +43,36 @@ pipeline { } - stage ('Check_style') { - steps { - sh """ - if [ ! -d venv ] ; then + // stage ('Check_style') { + // steps { + // sh """ + // if [ ! -d venv ] ; then - virtualenv --python=python2.7 venv - fi - source venv/bin/activate - export PYTHONPATH="$PWD:$PYTHONPATH" + // virtualenv --python=python2.7 venv + // fi + // source venv/bin/activate + // export PYTHONPATH="$PWD:$PYTHONPATH" - pip install pylint + // pip install pylint - cd repo - ### Need this because some strange control sequences when using default TERM=xterm - export TERM="linux" + // cd repo + // ### Need this because some strange control sequences when using default TERM=xterm + // export TERM="linux" - ## || exit 0 because pylint only exits with 0 if everything is correct - pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) MYMODULE/ > pylint.log || exit 0 - """ - step([$class: 'WarningsPublisher', - parserConfigurations: [ - [ - parserName: 'pylint', - pattern: 'report/pylint.log' - ]], - unstableTotalAll: '0', - usePreviousBuildAsReference: true - ]) - } - } + // ## || exit 0 because pylint only exits with 0 if everything is correct + // pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) MYMODULE/ > pylint.log || exit 0 + // """ + // step([$class: 'WarningsPublisher', + // parserConfigurations: [ + // [ + // parserName: 'pylint', + // pattern: 'report/pylint.log' + // ]], + // unstableTotalAll: '0', + // usePreviousBuildAsReference: true + // ]) + // } + // } stage('Test environment') { steps { @@ -89,26 +89,26 @@ pipeline { } } - stage('Pylint Checker') { - steps { - sh ''' - echo ${SHELL} - [ -d venv ] && rm -rf venv - #virtualenv --python=python2.7 venv - virtualenv venv - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} + // stage('Pylint Checker') { + // steps { + // sh ''' + // echo ${SHELL} + // [ -d venv ] && rm -rf venv + // #virtualenv --python=python2.7 venv + // virtualenv venv + // #. venv/bin/activate + // export PATH=${VIRTUAL_ENV}/bin:${PATH} - pip install pylint + // pip install pylint - export TERM="linux" + // export TERM="linux" - ## || exit 0 because pylint only exits with 0 if everything is correct - pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) Pybitmessage/ > pylint.log || exit 0 - ''' - } - } + // ## || exit 0 because pylint only exits with 0 if everything is correct + // pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) Pybitmessage/ > pylint.log || exit 0 + // ''' + // } + // } stage('Test Run') { From 0f89e0db053a29b5087760aeeb6ca73966d13504 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Sat, 17 Aug 2019 12:23:58 +0530 Subject: [PATCH 44/85] changes in the jenkins file --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2a5793e6..2b729489 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -84,8 +84,8 @@ pipeline { #. venv/bin/activate export PATH=${VIRTUAL_ENV}/bin:${PATH} python setup.py install - sudo /home/cis/.local/bin/nosetests --with-xunit tests ''' + // sudo /home/cis/.local/bin/nosetests --with-xunit tests } } From baafcfe739c79b2e8062644a301dacfa3aefe4cf Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Sat, 17 Aug 2019 19:19:43 +0530 Subject: [PATCH 45/85] adding pylint in jenkins file --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 2b729489..4bc8c734 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -89,6 +89,16 @@ pipeline { } } + + + stage('Pylint Checker'){ + steps{ + sh ''' + pylint --disable=W0622,W0611,F0401,R0914,W0221,W0222,W0142,F0010,W0703,R0911 -f parseable heroku + ''' + } + } + // stage('Pylint Checker') { // steps { // sh ''' From b26405251d79c23604d2947ddabe46dbc03339fd Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Sat, 17 Aug 2019 20:18:37 +0530 Subject: [PATCH 46/85] changes in jenkinsfile for pylint check --- Jenkinsfile | 5 +- pylint.cfg | 543 +--------------------------------------------------- 2 files changed, 5 insertions(+), 543 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4bc8c734..ec606283 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -84,6 +84,7 @@ pipeline { #. venv/bin/activate export PATH=${VIRTUAL_ENV}/bin:${PATH} python setup.py install + pip install pylint ''' // sudo /home/cis/.local/bin/nosetests --with-xunit tests } @@ -94,7 +95,9 @@ pipeline { stage('Pylint Checker'){ steps{ sh ''' - pylint --disable=W0622,W0611,F0401,R0914,W0221,W0222,W0142,F0010,W0703,R0911 -f parseable heroku + cd repo + export TERM="linux" + pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) PyBitmessage/ > pylint.log || exit 0 ''' } } diff --git a/pylint.cfg b/pylint.cfg index 4b4a617b..317ee220 100644 --- a/pylint.cfg +++ b/pylint.cfg @@ -1,542 +1 @@ -[MASTER] - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code -extension-pkg-whitelist= - -# Add files or directories to the blacklist. They should be base names, not -# paths. -ignore=CVS - -# Add files or directories matching the regex patterns to the blacklist. The -# regex matches against base names, not paths. -ignore-patterns= - -# Python code to execute, usually for sys.path manipulation such as -# pygtk.require(). -#init-hook= - -# Use multiple processes to speed up Pylint. -jobs=1 - -# List of plugins (as comma separated values of python modules names) to load, -# usually to register additional checkers. -load-plugins= - -# Pickle collected data for later comparisons. -persistent=yes - -# Specify a configuration file. -#rcfile= - -# When enabled, pylint would attempt to guess common misconfiguration and emit -# user-friendly hints instead of false-positive error messages -suggestion-mode=yes - -# Allow loading of arbitrary C extensions. Extensions are imported into the -# active Python interpreter and may run arbitrary code. -unsafe-load-any-extension=no - - -[MESSAGES CONTROL] - -# Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED -confidence= - -# Disable the message, report, category or checker with the given id(s). You -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once).You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use"--disable=all --enable=classes -# --disable=W" -disable=print-statement, - parameter-unpacking, - unpacking-in-except, - old-raise-syntax, - backtick, - long-suffix, - old-ne-operator, - old-octal-literal, - import-star-module-level, - non-ascii-bytes-literal, - raw-checker-failed, - bad-inline-option, - locally-disabled, - locally-enabled, - file-ignored, - suppressed-message, - useless-suppression, - deprecated-pragma, - apply-builtin, - basestring-builtin, - buffer-builtin, - cmp-builtin, - coerce-builtin, - execfile-builtin, - file-builtin, - long-builtin, - raw_input-builtin, - reduce-builtin, - standarderror-builtin, - unicode-builtin, - xrange-builtin, - coerce-method, - delslice-method, - getslice-method, - setslice-method, - no-absolute-import, - old-division, - dict-iter-method, - dict-view-method, - next-method-called, - metaclass-assignment, - indexing-exception, - raising-string, - reload-builtin, - oct-method, - hex-method, - nonzero-method, - cmp-method, - input-builtin, - round-builtin, - intern-builtin, - unichr-builtin, - map-builtin-not-iterating, - zip-builtin-not-iterating, - range-builtin-not-iterating, - filter-builtin-not-iterating, - using-cmp-argument, - eq-without-hash, - div-method, - idiv-method, - rdiv-method, - exception-message-attribute, - invalid-str-codec, - sys-max-int, - bad-python3-import, - deprecated-string-function, - deprecated-str-translate-call, - deprecated-itertools-function, - deprecated-types-field, - next-method-defined, - dict-items-not-iterating, - dict-keys-not-iterating, - dict-values-not-iterating - -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where -# it should appear only once). See also the "--disable" option for examples. -enable=c-extension-no-member - - -[REPORTS] - -# Python expression which should return a note less than 10 (10 is the highest -# note). You have access to the variables errors warning, statement which -# respectively contain the number of errors / warnings messages and the total -# number of statements analyzed. This is used by the global evaluation report -# (RP0004). -evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) - -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details -#msg-template= - -# Set the output format. Available formats are text, parseable, colorized, json -# and msvs (visual studio).You can also give a reporter class, eg -# mypackage.mymodule.MyReporterClass. -output-format=text - -# Tells whether to display a full report or only the messages -reports=no - -# Activate the evaluation score. -score=yes - - -[REFACTORING] - -# Maximum number of nested blocks for function / method body -max-nested-blocks=5 - -# Complete name of functions that never returns. When checking for -# inconsistent-return-statements if a never returning function is called then -# it will be considered as an explicit return statement and no message will be -# printed. -never-returning-functions=optparse.Values,sys.exit - - -[LOGGING] - -# Logging modules to check that the string format arguments are in logging -# function parameter format -logging-modules=logging - - -[SPELLING] - -# Limits count of emitted suggestions for spelling mistakes -max-spelling-suggestions=4 - -# Spelling dictionary name. Available dictionaries: none. To make it working -# install python-enchant package. -spelling-dict= - -# List of comma separated words that should not be checked. -spelling-ignore-words= - -# A path to a file that contains private dictionary; one word per line. -spelling-private-dict-file= - -# Tells whether to store unknown words to indicated private dictionary in -# --spelling-private-dict-file option instead of raising a message. -spelling-store-unknown-words=no - - -[MISCELLANEOUS] - -# List of note tags to take in consideration, separated by a comma. -notes=FIXME, - XXX, - TODO - - -[VARIABLES] - -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid to define new builtins when possible. -additional-builtins= - -# Tells whether unused global variables should be treated as a violation. -allow-global-unused-variables=yes - -# List of strings which can identify a callback function by name. A callback -# name must start or end with one of those strings. -callbacks=cb_, - _cb - -# A regular expression matching the name of dummy variables (i.e. expectedly -# not used). -dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ - -# Argument names that match this expression will be ignored. Default to name -# with leading underscore -ignored-argument-names=_.*|^ignored_|^unused_ - -# Tells whether we should check for unused import in __init__ files. -init-import=no - -# List of qualified module names which can have objects that can redefine -# builtins. -redefining-builtins-modules=six.moves,past.builtins,future.builtins - - -[TYPECHECK] - -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators=contextlib.contextmanager - -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members= - -# Tells whether missing members accessed in mixin class should be ignored. A -# mixin class is detected if its name ends with "mixin" (case insensitive). -ignore-mixin-members=yes - -# This flag controls whether pylint should warn about no-member and similar -# checks whenever an opaque object is returned when inferring. The inference -# can return multiple potential results while evaluating a Python object, but -# some branches might not be evaluated, which results in partial inference. In -# that case, it might be useful to still emit no-member and other checks for -# the rest of the inferred objects. -ignore-on-opaque-inference=yes - -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes=optparse.Values,thread._local,_thread._local - -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis. It -# supports qualified module names, as well as Unix pattern matching. -ignored-modules= - -# Show a hint with possible names when a member name was not found. The aspect -# of finding the hint is based on edit distance. -missing-member-hint=yes - -# The minimum edit distance a name should have in order to be considered a -# similar match for a missing member name. -missing-member-hint-distance=1 - -# The total number of similar names that should be taken in consideration when -# showing a hint for a missing member. -missing-member-max-choices=1 - - -[SIMILARITIES] - -# Ignore comments when computing similarities. -ignore-comments=yes - -# Ignore docstrings when computing similarities. -ignore-docstrings=yes - -# Ignore imports when computing similarities. -ignore-imports=no - -# Minimum lines number of a similarity. -min-similarity-lines=4 - - -[BASIC] - -# Naming style matching correct argument names -argument-naming-style=snake_case - -# Regular expression matching correct argument names. Overrides argument- -# naming-style -#argument-rgx= - -# Naming style matching correct attribute names -attr-naming-style=snake_case - -# Regular expression matching correct attribute names. Overrides attr-naming- -# style -#attr-rgx= - -# Bad variable names which should always be refused, separated by a comma -bad-names=foo, - bar, - baz, - toto, - tutu, - tata - -# Naming style matching correct class attribute names -class-attribute-naming-style=any - -# Regular expression matching correct class attribute names. Overrides class- -# attribute-naming-style -#class-attribute-rgx= - -# Naming style matching correct class names -class-naming-style=PascalCase - -# Regular expression matching correct class names. Overrides class-naming-style -#class-rgx= - -# Naming style matching correct constant names -const-naming-style=UPPER_CASE - -# Regular expression matching correct constant names. Overrides const-naming- -# style -#const-rgx= - -# Minimum line length for functions/classes that require docstrings, shorter -# ones are exempt. -docstring-min-length=-1 - -# Naming style matching correct function names -function-naming-style=snake_case - -# Regular expression matching correct function names. Overrides function- -# naming-style -#function-rgx= - -# Good variable names which should always be accepted, separated by a comma -good-names=i, - j, - k, - ex, - Run, - _ - -# Include a hint for the correct naming format with invalid-name -include-naming-hint=no - -# Naming style matching correct inline iteration names -inlinevar-naming-style=any - -# Regular expression matching correct inline iteration names. Overrides -# inlinevar-naming-style -#inlinevar-rgx= - -# Naming style matching correct method names -method-naming-style=snake_case - -# Regular expression matching correct method names. Overrides method-naming- -# style -#method-rgx= - -# Naming style matching correct module names -module-naming-style=snake_case - -# Regular expression matching correct module names. Overrides module-naming- -# style -#module-rgx= - -# Colon-delimited sets of names that determine each other's naming style when -# the name regexes allow several styles. -name-group= - -# Regular expression which should only match function or class names that do -# not require a docstring. -no-docstring-rgx=^_ - -# List of decorators that produce properties, such as abc.abstractproperty. Add -# to this list to register other decorators that produce valid properties. -property-classes=abc.abstractproperty - -# Naming style matching correct variable names -variable-naming-style=snake_case - -# Regular expression matching correct variable names. Overrides variable- -# naming-style -#variable-rgx= - - -[FORMAT] - -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -expected-line-ending-format= - -# Regexp for a line that is allowed to be longer than the limit. -ignore-long-lines=^\s*(# )??$ - -# Number of spaces of indent required inside a hanging or continued line. -indent-after-paren=4 - -# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 -# tab). -indent-string=' ' - -# Maximum number of characters on a single line. -max-line-length=100 - -# Maximum number of lines in a module -max-module-lines=1000 - -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma, - dict-separator - -# Allow the body of a class to be on the same line as the declaration if body -# contains single statement. -single-line-class-stmt=no - -# Allow the body of an if to be on the same line as the test if there is no -# else. -single-line-if-stmt=no - - -[IMPORTS] - -# Allow wildcard imports from modules that define __all__. -allow-wildcard-with-all=no - -# Analyse import fallback blocks. This can be used to support both Python 2 and -# 3 compatible code, which means that the block might have code that exists -# only in one or another interpreter, leading to false positives when analysed. -analyse-fallback-blocks=no - -# Deprecated modules which should not be used, separated by a comma -deprecated-modules=regsub, - TERMIOS, - Bastion, - rexec - -# Create a graph of external dependencies in the given file (report RP0402 must -# not be disabled) -ext-import-graph= - -# Create a graph of every (i.e. internal and external) dependencies in the -# given file (report RP0402 must not be disabled) -import-graph= - -# Create a graph of internal dependencies in the given file (report RP0402 must -# not be disabled) -int-import-graph= - -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= - -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant - - -[CLASSES] - -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__, - __new__, - setUp - -# List of member names, which should be excluded from the protected access -# warning. -exclude-protected=_asdict, - _fields, - _replace, - _source, - _make - -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg=cls - -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg=mcs - - -[DESIGN] - -# Maximum number of arguments for function / method -max-args=5 - -# Maximum number of attributes for a class (see R0902). -max-attributes=7 - -# Maximum number of boolean expressions in a if statement -max-bool-expr=5 - -# Maximum number of branch for function / method body -max-branches=12 - -# Maximum number of locals for function / method body -max-locals=15 - -# Maximum number of parents for a class (see R0901). -max-parents=7 - -# Maximum number of public methods for a class (see R0904). -max-public-methods=20 - -# Maximum number of return / yield for function / method body -max-returns=6 - -# Maximum number of statements in function / method body -max-statements=50 - -# Minimum number of public methods for a class (see R0903). -min-public-methods=2 - - -[EXCEPTIONS] - -# Exceptions that will emit a warning when being caught. Defaults to -# "Exception" -overgeneral-exceptions=Exception +pylint.cfg \ No newline at end of file From e5997349e6bf7d96a1dae9305c1c6271727634db Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Sat, 17 Aug 2019 20:31:47 +0530 Subject: [PATCH 47/85] changes in file --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ec606283..65d938a6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -95,7 +95,6 @@ pipeline { stage('Pylint Checker'){ steps{ sh ''' - cd repo export TERM="linux" pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) PyBitmessage/ > pylint.log || exit 0 ''' From 66d4b77286222e9c268c53e620c5d1e1a59fe0fb Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Mon, 26 Aug 2019 19:54:40 +0530 Subject: [PATCH 48/85] adding static code in jenkins file --- Jenkinsfile | 12 ++ pylint.cfg | 543 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 554 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 65d938a6..660c2220 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -122,6 +122,18 @@ pipeline { // } // } + stage('Static code metrics') { + steps { + echo "Raw metrics" + sh ''' source activate ${BUILD_TAG} + 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 + ''' + } + } + stage('Test Run') { steps { diff --git a/pylint.cfg b/pylint.cfg index 317ee220..4b4a617b 100644 --- a/pylint.cfg +++ b/pylint.cfg @@ -1 +1,542 @@ -pylint.cfg \ No newline at end of file +[MASTER] + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code +extension-pkg-whitelist= + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the blacklist. The +# regex matches against base names, not paths. +ignore-patterns= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. +jobs=1 + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Specify a configuration file. +#rcfile= + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED +confidence= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +disable=print-statement, + parameter-unpacking, + unpacking-in-except, + old-raise-syntax, + backtick, + long-suffix, + old-ne-operator, + old-octal-literal, + import-star-module-level, + non-ascii-bytes-literal, + raw-checker-failed, + bad-inline-option, + locally-disabled, + locally-enabled, + file-ignored, + suppressed-message, + useless-suppression, + deprecated-pragma, + apply-builtin, + basestring-builtin, + buffer-builtin, + cmp-builtin, + coerce-builtin, + execfile-builtin, + file-builtin, + long-builtin, + raw_input-builtin, + reduce-builtin, + standarderror-builtin, + unicode-builtin, + xrange-builtin, + coerce-method, + delslice-method, + getslice-method, + setslice-method, + no-absolute-import, + old-division, + dict-iter-method, + dict-view-method, + next-method-called, + metaclass-assignment, + indexing-exception, + raising-string, + reload-builtin, + oct-method, + hex-method, + nonzero-method, + cmp-method, + input-builtin, + round-builtin, + intern-builtin, + unichr-builtin, + map-builtin-not-iterating, + zip-builtin-not-iterating, + range-builtin-not-iterating, + filter-builtin-not-iterating, + using-cmp-argument, + eq-without-hash, + div-method, + idiv-method, + rdiv-method, + exception-message-attribute, + invalid-str-codec, + sys-max-int, + bad-python3-import, + deprecated-string-function, + deprecated-str-translate-call, + deprecated-itertools-function, + deprecated-types-field, + next-method-defined, + dict-items-not-iterating, + dict-keys-not-iterating, + dict-values-not-iterating + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable=c-extension-no-member + + +[REPORTS] + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio).You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Tells whether to display a full report or only the messages +reports=no + +# Activate the evaluation score. +score=yes + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=optparse.Values,sys.exit + + +[LOGGING] + +# Logging modules to check that the string format arguments are in logging +# function parameter format +logging-modules=logging + + +[SPELLING] + +# Limits count of emitted suggestions for spelling mistakes +max-spelling-suggestions=4 + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb + +# A regular expression matching the name of dummy variables (i.e. expectedly +# not used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis. It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + + +[SIMILARITIES] + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[BASIC] + +# Naming style matching correct argument names +argument-naming-style=snake_case + +# Regular expression matching correct argument names. Overrides argument- +# naming-style +#argument-rgx= + +# Naming style matching correct attribute names +attr-naming-style=snake_case + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style +#attr-rgx= + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo, + bar, + baz, + toto, + tutu, + tata + +# Naming style matching correct class attribute names +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style +#class-attribute-rgx= + +# Naming style matching correct class names +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming-style +#class-rgx= + +# Naming style matching correct constant names +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style +#const-rgx= + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style +#function-rgx= + +# Good variable names which should always be accepted, separated by a comma +good-names=i, + j, + k, + ex, + Run, + _ + +# Include a hint for the correct naming format with invalid-name +include-naming-hint=no + +# Naming style matching correct inline iteration names +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style +#inlinevar-rgx= + +# Naming style matching correct method names +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style +#method-rgx= + +# Naming style matching correct module names +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style +#module-rgx= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +property-classes=abc.abstractproperty + +# Naming style matching correct variable names +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style +#variable-rgx= + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=100 + +# Maximum number of lines in a module +max-module-lines=1000 + +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. +no-space-check=trailing-comma, + dict-separator + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[IMPORTS] + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=regsub, + TERMIOS, + Bastion, + rexec + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict, + _fields, + _replace, + _source, + _make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in a if statement +max-bool-expr=5 + +# Maximum number of branch for function / method body +max-branches=12 + +# Maximum number of locals for function / method body +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of statements in function / method body +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception From 1f9d71d611e4da2b3192627d426eb7bc03d046d2 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Tue, 27 Aug 2019 22:19:31 +0530 Subject: [PATCH 49/85] static code metrix --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 660c2220..f2ac43d4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -122,7 +122,7 @@ pipeline { // } // } - stage('Static code metrics') { + stage('Static code metrics') { steps { echo "Raw metrics" sh ''' source activate ${BUILD_TAG} @@ -166,6 +166,8 @@ pipeline { subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build successful", to: env.emailTo } + + } From f02e600d82b8419d10873a1399abbe0156e0d1fe Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Tue, 27 Aug 2019 22:34:56 +0530 Subject: [PATCH 50/85] static code metrix1 --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f2ac43d4..fdb23aa5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -125,8 +125,7 @@ pipeline { stage('Static code metrics') { steps { echo "Raw metrics" - sh ''' source activate ${BUILD_TAG} - radon raw --json src/ > raw_report.json + sh ''' 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 From b4d731c79876f752b8f576c8a75ad6cf853fc44e Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Tue, 27 Aug 2019 22:44:55 +0530 Subject: [PATCH 51/85] add env dependency --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index fdb23aa5..e2da04a6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -85,6 +85,7 @@ pipeline { export PATH=${VIRTUAL_ENV}/bin:${PATH} python setup.py install pip install pylint + pip install radon ''' // sudo /home/cis/.local/bin/nosetests --with-xunit tests } From fb1ad71265561530acab60065cbec79ccd169f2d Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 14:21:04 +0530 Subject: [PATCH 52/85] change in req adding radon --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 2e9da23f..11579ba2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ python_prctl psutil pycrypto nose +radon From aaec5b58db7bb260ee36e4c7c93da9de8374c83a Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 15:55:31 +0530 Subject: [PATCH 53/85] changing in env --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e2da04a6..4d11d6ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -126,7 +126,8 @@ pipeline { stage('Static code metrics') { steps { echo "Raw metrics" - sh ''' radon raw --json src/ > raw_report.json + sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} + 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 From a26293e50988fdf55943eb37dea5b9afd18b4efe Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 18:37:05 +0530 Subject: [PATCH 54/85] 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) + } } } From 056c41c3076ff7cb6fc413bc8c010802298367f7 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 19:03:40 +0530 Subject: [PATCH 55/85] changes in file --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c70a4962..f066490f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -125,12 +125,12 @@ pipeline { stage('Static code metrics') { steps { - echo "Raw metrics" - sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} - radon raw --json src/ > raw_report.json - radon cc --json src/ > cc_report.json - radon mi --json src/ > mi_report.json - ''' + // echo "Raw metrics" + // sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} + // radon raw --json src/ > raw_report.json + // radon cc --json src/ > cc_report.json + // radon mi --json src/ > mi_report.json + // ''' echo "Test coverage" From 25806d0c5ca92d377c7823d707a7e17131545913 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 19:19:20 +0530 Subject: [PATCH 56/85] changes in file --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f066490f..24188b94 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -171,7 +171,7 @@ pipeline { // Archive unit tests for the future junit (allowEmptyResults: true, testResults: './reports/unit_tests.xml', - fingerprint: true) + testResults: true) } } } From d6929e8c06acb3bb533551ac8f8e258a02a449d4 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 19:24:08 +0530 Subject: [PATCH 57/85] changes in file --- Jenkinsfile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 24188b94..30eee10d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -160,21 +160,21 @@ pipeline { } } - 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', - testResults: true) - } - } - } + // 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', + // testResults: true) + // } + // } + // } stage('Test Run') { From d5fe9c723fa541a2fa2244b6ea17d7ec5f62ea06 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 19:28:55 +0530 Subject: [PATCH 58/85] changes in file --- Jenkinsfile | 4 ++-- coverage.xml | 0 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 coverage.xml diff --git a/Jenkinsfile b/Jenkinsfile index 30eee10d..42e0bc0a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -136,7 +136,7 @@ pipeline { 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 + python -m coverage xml -o coverage.xml ''' echo "Style check" sh ''' source activate ${BUILD_TAG} @@ -148,7 +148,7 @@ pipeline { step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, - coberturaReportFile: 'reports/coverage.xml', + coberturaReportFile: 'coverage.xml', failNoReports: false, failUnhealthy: false, failUnstable: false, diff --git a/coverage.xml b/coverage.xml new file mode 100644 index 00000000..e69de29b From 432b8aafc59ceb4c522f2e8713114ac7203ed554 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 19:30:59 +0530 Subject: [PATCH 59/85] changes in file and environment --- Jenkinsfile | 2 +- requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 42e0bc0a..28cbf20a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -134,7 +134,7 @@ pipeline { echo "Test coverage" - sh ''' source activate ${BUILD_TAG} + sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} coverage run src/bitmessagemain.py -t 1 1 2 3 python -m coverage xml -o coverage.xml ''' diff --git a/requirements.txt b/requirements.txt index 11579ba2..c4803384 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ psutil pycrypto nose radon +coverage From 24305aa251a73dcad53c9455cc49f17db8381909 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 19:34:53 +0530 Subject: [PATCH 60/85] changes in file and environment --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 28cbf20a..11493a99 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -136,7 +136,7 @@ pipeline { echo "Test coverage" sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} coverage run src/bitmessagemain.py -t 1 1 2 3 - python -m coverage xml -o coverage.xml + python -m coverage xml -o PyBitmessage/coverage.xml ''' echo "Style check" sh ''' source activate ${BUILD_TAG} @@ -148,7 +148,7 @@ pipeline { step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, - coberturaReportFile: 'coverage.xml', + coberturaReportFile: 'PyBitmessage/coverage.xml', failNoReports: false, failUnhealthy: false, failUnstable: false, From 677905277d2b9d8718ad9f28fc418122ab109cb0 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 19:39:32 +0530 Subject: [PATCH 61/85] changes in file and environment --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 11493a99..cc873c55 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -86,6 +86,7 @@ pipeline { python setup.py install pip install pylint pip install radon + pip install coverage ''' // sudo /home/cis/.local/bin/nosetests --with-xunit tests } From 6567eb767252272c62a35dc279a508c950eeace1 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 19:50:53 +0530 Subject: [PATCH 62/85] changes in file and environment --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index cc873c55..9bf90187 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -135,7 +135,7 @@ pipeline { echo "Test coverage" - sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} + sh ''' source activate ${BUILD_TAG} coverage run src/bitmessagemain.py -t 1 1 2 3 python -m coverage xml -o PyBitmessage/coverage.xml ''' From 023fda884abbe6e333cb743309fe8e1eb673e512 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 19:55:39 +0530 Subject: [PATCH 63/85] changes in file and environment --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9bf90187..cc873c55 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -135,7 +135,7 @@ pipeline { echo "Test coverage" - sh ''' source activate ${BUILD_TAG} + sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} coverage run src/bitmessagemain.py -t 1 1 2 3 python -m coverage xml -o PyBitmessage/coverage.xml ''' From 7d5bd5fda31b71fb7e65127233042b3fae1f7a03 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 20:01:01 +0530 Subject: [PATCH 64/85] changes in file and environment --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cc873c55..ff0a69a7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -135,8 +135,7 @@ pipeline { echo "Test coverage" - sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} - coverage run src/bitmessagemain.py -t 1 1 2 3 + sh ''' coverage run src/bitmessagemain.py -t 1 1 2 3 python -m coverage xml -o PyBitmessage/coverage.xml ''' echo "Style check" From 80306b9d9d33585b272e7f2fe45b94c8c7ff42c7 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 20:04:04 +0530 Subject: [PATCH 65/85] changes in file and environment --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ff0a69a7..da92aeff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -135,7 +135,8 @@ pipeline { echo "Test coverage" - sh ''' coverage run src/bitmessagemain.py -t 1 1 2 3 + sh ''' pip install coverage + coverage run src/bitmessagemain.py -t 1 1 2 3 python -m coverage xml -o PyBitmessage/coverage.xml ''' echo "Style check" From e6a39fc7456623f2cd7f62206ec4831d75650600 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 20:08:59 +0530 Subject: [PATCH 66/85] changes in file and environment --- Jenkinsfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index da92aeff..674365a3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -135,10 +135,19 @@ pipeline { echo "Test coverage" - sh ''' pip install coverage + sh ''' + echo ${SHELL} + [ -d venv ] && rm -rf venv + #virtualenv --python=python2.7 venv + virtualenv venv + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + python setup.py install + pip install coverage coverage run src/bitmessagemain.py -t 1 1 2 3 python -m coverage xml -o PyBitmessage/coverage.xml ''' + echo "Style check" sh ''' source activate ${BUILD_TAG} pylint PyBitmessage || true From 171c2cb2d36d37b9a3fda65730b9e9560edf687d Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 20:14:39 +0530 Subject: [PATCH 67/85] changes in file and environment --- Jenkinsfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 674365a3..b1c5f380 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -147,11 +147,6 @@ pipeline { coverage run src/bitmessagemain.py -t 1 1 2 3 python -m coverage xml -o PyBitmessage/coverage.xml ''' - - echo "Style check" - sh ''' source activate ${BUILD_TAG} - pylint PyBitmessage || true - ''' } post{ always{ From 59940e33c27d33010d417a0e8fffd6b43879ecdb Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 20:23:20 +0530 Subject: [PATCH 68/85] chnages in coverage file in env --- Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index b1c5f380..99156592 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -147,6 +147,11 @@ pipeline { coverage run src/bitmessagemain.py -t 1 1 2 3 python -m coverage xml -o PyBitmessage/coverage.xml ''' + + // echo "Style check" + // sh ''' source activate ${BUILD_TAG} + // pylint PyBitmessage || true + // ''' } post{ always{ From 96b268037873b03af542aff3fe175c4d636bcf64 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 20:55:28 +0530 Subject: [PATCH 69/85] changes in pylint --- Jenkinsfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 99156592..b3295439 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -148,10 +148,17 @@ pipeline { python -m coverage xml -o PyBitmessage/coverage.xml ''' - // echo "Style check" - // sh ''' source activate ${BUILD_TAG} - // pylint PyBitmessage || true - // ''' + echo "Style check" + sh ''' echo ${SHELL} + [ -d venv ] && rm -rf venv + #virtualenv --python=python2.7 venv + virtualenv venv + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + python setup.py install + pip install pylint + pylint PyBitmessage || true + ''' } post{ always{ From a605c58c307547fc9c76866c67ce80ba8917bf63 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 21:09:39 +0530 Subject: [PATCH 70/85] addintion of json file --- Jenkinsfile | 19 +++++++++++++------ cc_report.json | 1 + mi_report.json | 1 + raw_report.json | 1 + 4 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 cc_report.json create mode 100644 mi_report.json create mode 100644 raw_report.json diff --git a/Jenkinsfile b/Jenkinsfile index b3295439..be76cd84 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -126,12 +126,19 @@ pipeline { stage('Static code metrics') { steps { - // echo "Raw metrics" - // sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} - // radon raw --json src/ > raw_report.json - // radon cc --json src/ > cc_report.json - // radon mi --json src/ > mi_report.json - // ''' + echo "Raw metrics" + sh ''' echo ${SHELL} + [ -d venv ] && rm -rf venv + #virtualenv --python=python2.7 venv + virtualenv venv + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + python setup.py install + pip install radon + radon raw --json PyBitmessage/ > raw_report.json + radon cc --json PyBitmessage/ > cc_report.json + radon mi --json PyBitmessage/ > mi_report.json + ''' echo "Test coverage" diff --git a/cc_report.json b/cc_report.json new file mode 100644 index 00000000..bd5a516d --- /dev/null +++ b/cc_report.json @@ -0,0 +1 @@ +cc_report.json \ No newline at end of file diff --git a/mi_report.json b/mi_report.json new file mode 100644 index 00000000..ba4b6df4 --- /dev/null +++ b/mi_report.json @@ -0,0 +1 @@ +mi_report.json \ No newline at end of file diff --git a/raw_report.json b/raw_report.json new file mode 100644 index 00000000..0409bce1 --- /dev/null +++ b/raw_report.json @@ -0,0 +1 @@ +raw_report.json \ No newline at end of file From f72adf147403ff8a515d2899aa45bdd3d9c14e65 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Wed, 28 Aug 2019 22:13:21 +0530 Subject: [PATCH 71/85] addintion of json file --- Jenkinsfile | 21 +++++++++++++++++++++ index.html | 1 + nosetests.xml | 0 3 files changed, 22 insertions(+) create mode 100644 index.html create mode 100644 nosetests.xml diff --git a/Jenkinsfile b/Jenkinsfile index be76cd84..1cfe6e9b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -184,6 +184,27 @@ pipeline { } } + stage ('Unit Tests') { + steps { + sh """ + #. venv/bin/activate + export PATH=${VIRTUAL_ENV}/bin:${PATH} + make unittest || true + """ + } + + post { + always { + junit keepLongStdio: true, testResults: 'nosetests.xml' + publishHTML target: [ + reportDir: 'PyBitmessage', + reportFiles: 'index.html', + reportName: 'Coverage Report - Unit Test' + ] + } + } + } + // stage('Unit tests') { // steps { // sh ''' source activate ${BUILD_TAG} diff --git a/index.html b/index.html new file mode 100644 index 00000000..64233a9e --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +index.html \ No newline at end of file diff --git a/nosetests.xml b/nosetests.xml new file mode 100644 index 00000000..e69de29b From 32fdc5c2b3fe6d43608b01258883b8931646d383 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 29 Aug 2019 15:31:01 +0530 Subject: [PATCH 72/85] changes in file --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 1cfe6e9b..b2087dd0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -189,6 +189,8 @@ pipeline { sh """ #. venv/bin/activate export PATH=${VIRTUAL_ENV}/bin:${PATH} + cd PyBitmessage + touch *.xml make unittest || true """ } From 28b9a6c24117712005f70f4883f4e87390cb3084 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 29 Aug 2019 15:44:32 +0530 Subject: [PATCH 73/85] chage in unit test --- Jenkinsfile | 21 ++++++--------------- nosetests.xml => result.xml | 0 2 files changed, 6 insertions(+), 15 deletions(-) rename nosetests.xml => result.xml (100%) diff --git a/Jenkinsfile b/Jenkinsfile index b2087dd0..fa6c1655 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -184,25 +184,16 @@ pipeline { } } - stage ('Unit Tests') { + stage('Unit tests') { steps { - sh """ - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - cd PyBitmessage - touch *.xml - make unittest || true - """ + sh ''' source activate ${BUILD_TAG} + python -m pytest --verbose --junit-xml results.xml + ''' } - post { always { - junit keepLongStdio: true, testResults: 'nosetests.xml' - publishHTML target: [ - reportDir: 'PyBitmessage', - reportFiles: 'index.html', - reportName: 'Coverage Report - Unit Test' - ] + // Archive unit tests for the future + junit allowEmptyResults: true, testResults: 'results.xml', fingerprint: true } } } diff --git a/nosetests.xml b/result.xml similarity index 100% rename from nosetests.xml rename to result.xml From a10f9268450fac006ae37cf27bf65e6020fc9f33 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 29 Aug 2019 15:45:12 +0530 Subject: [PATCH 74/85] chage in unit test --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fa6c1655..0a172d96 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -187,13 +187,13 @@ pipeline { stage('Unit tests') { steps { sh ''' source activate ${BUILD_TAG} - python -m pytest --verbose --junit-xml results.xml + python -m pytest --verbose --junit-xml result.xml ''' } post { always { // Archive unit tests for the future - junit allowEmptyResults: true, testResults: 'results.xml', fingerprint: true + junit allowEmptyResults: true, testResults: 'result.xml', fingerprint: true } } } From 670f022aba5fdc89904240217caacf4130e6c88b Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 29 Aug 2019 15:47:28 +0530 Subject: [PATCH 75/85] chage in unit test --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0a172d96..2dc9283d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -187,13 +187,13 @@ pipeline { stage('Unit tests') { steps { sh ''' source activate ${BUILD_TAG} - python -m pytest --verbose --junit-xml result.xml + python -m pytest --verbose --junit-xml results.xml ''' } post { always { // Archive unit tests for the future - junit allowEmptyResults: true, testResults: 'result.xml', fingerprint: true + junit allowEmptyResults: true, testResults: 'test-reports/results.xml' } } } From 20502a21428459652eef750580f4275cf2c1b970 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 29 Aug 2019 16:07:11 +0530 Subject: [PATCH 76/85] chage in unit test --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2dc9283d..f0377b6e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -186,7 +186,7 @@ pipeline { stage('Unit tests') { steps { - sh ''' source activate ${BUILD_TAG} + sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} python -m pytest --verbose --junit-xml results.xml ''' } From aaf1af6c59e69500965d381be40608796ecc71de Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 29 Aug 2019 16:27:06 +0530 Subject: [PATCH 77/85] chage in unit test --- Jenkinsfile | 3 ++- requirements.txt | 1 + result.xml => results.xml | 0 3 files changed, 3 insertions(+), 1 deletion(-) rename result.xml => results.xml (100%) diff --git a/Jenkinsfile b/Jenkinsfile index f0377b6e..8cba64d2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -187,13 +187,14 @@ pipeline { stage('Unit tests') { steps { sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} + pip install pytest python -m pytest --verbose --junit-xml results.xml ''' } post { always { // Archive unit tests for the future - junit allowEmptyResults: true, testResults: 'test-reports/results.xml' + junit allowEmptyResults: true, testResults: 'results.xml' } } } diff --git a/requirements.txt b/requirements.txt index c4803384..5429dce1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ pycrypto nose radon coverage +pytest diff --git a/result.xml b/results.xml similarity index 100% rename from result.xml rename to results.xml From 244d95d53b531f211faba9f6569bca81246af917 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 29 Aug 2019 16:27:49 +0530 Subject: [PATCH 78/85] chage in unit test1 --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8cba64d2..a5faa874 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -198,7 +198,6 @@ pipeline { } } } - // stage('Unit tests') { // steps { // sh ''' source activate ${BUILD_TAG} From e9a5fe278d5fca034fc7dc29713fd56a0a0be5ac Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Thu, 29 Aug 2019 16:32:44 +0530 Subject: [PATCH 79/85] chage in unit test2 --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index a5faa874..a4cbb7a1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -188,6 +188,7 @@ pipeline { steps { sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} pip install pytest + pip install psutil python -m pytest --verbose --junit-xml results.xml ''' } From c7a4876e06cb21fccc4057c6d6e386973173d173 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 30 Aug 2019 13:39:47 +0530 Subject: [PATCH 80/85] chage in unit test --- Jenkinsfile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a4cbb7a1..d1d6adc7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -184,21 +184,21 @@ pipeline { } } - stage('Unit tests') { - steps { - sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} - pip install pytest - pip install psutil - python -m pytest --verbose --junit-xml results.xml - ''' - } - post { - always { - // Archive unit tests for the future - junit allowEmptyResults: true, testResults: 'results.xml' - } - } - } + // stage('Unit tests') { + // steps { + // sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} + // pip install pytest + // pip install psutil + // python -m pytest --verbose --junit-xml results.xml + // ''' + // } + // post { + // always { + // // Archive unit tests for the future + // junit allowEmptyResults: true, testResults: 'results.xml' + // } + // } + // } // stage('Unit tests') { // steps { // sh ''' source activate ${BUILD_TAG} From 7a66fa22798d12057539d9af592a8b39fac795d2 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Fri, 30 Aug 2019 19:02:29 +0530 Subject: [PATCH 81/85] chage in unit test add dependency --- Jenkinsfile | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d1d6adc7..379ce05d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -184,21 +184,22 @@ pipeline { } } - // stage('Unit tests') { - // steps { - // sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} - // pip install pytest - // pip install psutil - // python -m pytest --verbose --junit-xml results.xml - // ''' - // } - // post { - // always { - // // Archive unit tests for the future - // junit allowEmptyResults: true, testResults: 'results.xml' - // } - // } - // } + stage('Unit tests') { + steps { + sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} + pip install pytest + pip install psutil + pip install python-prctl==1.5.0 + python -m pytest --verbose --junit-xml results.xml + ''' + } + post { + always { + // Archive unit tests for the future + junit allowEmptyResults: true, testResults: 'results.xml' + } + } + } // stage('Unit tests') { // steps { // sh ''' source activate ${BUILD_TAG} From 9d648566d6b644bcac9c5d128ea3d23bc5e7cc55 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Tue, 24 Sep 2019 16:05:01 +0530 Subject: [PATCH 82/85] changes in jenkins file --- .gitignore | 3 + Jenkinsfile | 36 +++++++++- Jenkinsfile1 | 40 ----------- Jenkinsfile2 | 166 --------------------------------------------- index.html | 1 - src/proofofwork.py | 2 +- 6 files changed, 39 insertions(+), 209 deletions(-) delete mode 100644 Jenkinsfile1 delete mode 100644 Jenkinsfile2 delete mode 100644 index.html diff --git a/.gitignore b/.gitignore index 2bcb5340..f7fe9824 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ dist docs/_*/* docs/autodoc/ pyan/ +*.swp +tags +.coverage diff --git a/Jenkinsfile b/Jenkinsfile index 379ce05d..3148d590 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -103,6 +103,23 @@ pipeline { } } + + // stage('Nosetest'){ + // steps{ + // sh ''' + // echo ${SHELL} + // [ -d venv ] && rm -rf venv + // #virtualenv --python=python2.7 venv + // virtualenv venv + // #. venv/bin/activate + // export PATH=${VIRTUAL_ENV}/bin:${PATH} + // python setup.py install + // sudo apt-get install python-mock python-nose python-coverage pylint + + // ''' + // } + // } + // stage('Pylint Checker') { // steps { // sh ''' @@ -137,7 +154,7 @@ pipeline { pip install radon radon raw --json PyBitmessage/ > raw_report.json radon cc --json PyBitmessage/ > cc_report.json - radon mi --json PyBitmessage/ > mi_report.json + radon mi --json PyBitmessage/ > mi_report.json ''' @@ -200,6 +217,23 @@ pipeline { } } } + + stage('Setup Test') { + steps { + sh ''' export PATH=${VIRTUAL_ENV}/bin:${PATH} + pip install pytest + pip install psutil + pip install python-prctl==1.5.0 + python -m pytest --verbose --junit-xml results.xml + ''' + } + post { + always { + // Archive unit tests for the future + junit allowEmptyResults: true, testResults: 'results.xml' + } + } + } // stage('Unit tests') { // steps { // sh ''' source activate ${BUILD_TAG} diff --git a/Jenkinsfile1 b/Jenkinsfile1 deleted file mode 100644 index c4012809..00000000 --- a/Jenkinsfile1 +++ /dev/null @@ -1,40 +0,0 @@ -pipeline { - agent any - - triggers { - pollSCM('*/5 * * * *') - } - - - stages { - - stage('Build environment') { - steps { - sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate''' - sh '''pip install -r /home/cis/Desktop/Python/PyBitmessage/requirements.txt''' - } - } - stage('Test environment') { - steps { - sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate - cd /home/cis/Desktop/Python/PyBitmessage - sudo python setup.py install - sudo su - sudo /home/cis/.local/bin/nosetests --with-xunit tests - ''' - } - } - stage('Test Run') { - steps { - sh '''python /home/cis/Desktop/Python/PyBitmessage/src/bitmessagemain.py -t - ''' - } - } - } - - post { - failure { - echo "Send e-mail, when failed" - } - } -} diff --git a/Jenkinsfile2 b/Jenkinsfile2 deleted file mode 100644 index d99b3f09..00000000 --- a/Jenkinsfile2 +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/env groovy - -/** - * Jenkinsfile - */ -pipeline { - agent any - options { - buildDiscarder( - // Only keep the 10 most recent builds - logRotator(numToKeepStr:'10')) - } - environment { - projectName = 'BitMessage' - emailTo = 'kuldeep.m@cisinlabs.com' - emailFrom = 'kuldeep.m@cisinlabs.com' - VIRTUAL_ENV = "${env.WORKSPACE}/venv" - } - - stages { - - /* - stage ('Checkout') { - steps { - checkout scm - } - } - */ - - stage ('Install_Requirements') { - steps { - sh """ - echo ${SHELL} - [ -d venv ] && rm -rf venv - #virtualenv --python=python2.7 venv - virtualenv venv - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - pip install --upgrade pip - pip install -r requirements.txt -r dev-requirements.txt - make clean - """ - } - } - - stage ('Check_style') { - steps { - sh """ - #. venv/bin/activate - [ -d report ] || mkdir report - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make check || true - """ - sh """ - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make flake8 | tee report/flake8.log || true - """ - sh """ - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make pylint | tee report/pylint.log || true - """ - step([$class: 'WarningsPublisher', - parserConfigurations: [[ - parserName: 'Pep8', - pattern: 'report/flake8.log' - ], - [ - parserName: 'pylint', - pattern: 'report/pylint.log' - ]], - unstableTotalAll: '0', - usePreviousBuildAsReference: true - ]) - } - } - - stage ('Unit Tests') { - steps { - sh """ - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - make unittest || true - """ - } - - post { - always { - junit keepLongStdio: true, testResults: 'report/nosetests.xml' - publishHTML target: [ - reportDir: 'report/coverage', - reportFiles: 'index.html', - reportName: 'Coverage Report - Unit Test' - ] - } - } - } - - stage ('System Tests') { - steps { - sh """ - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - // Write file containing test node connection information if needed. - // writeFile file: "test/fixtures/nodes.yaml", text: "---\n- node: \n" - make systest || true - """ - } - - post { - always { - junit keepLongStdio: true, testResults: 'report/nosetests.xml' - publishHTML target: [ - reportDir: 'report/coverage', - reportFiles: 'index.html', - reportName: 'Coverage Report - System Test' - ] - } - } - } - - stage ('Docs') { - steps { - sh """ - #. venv/bin/activate - export PATH=${VIRTUAL_ENV}/bin:${PATH} - PYTHONPATH=. pdoc --html --html-dir docs --overwrite env.projectName - """ - } - - post { - always { - publishHTML target: [ - reportDir: 'docs/*', - reportFiles: 'index.html', - reportName: 'Module Documentation' - ] - } - } - } - - stage ('Cleanup') { - steps { - sh 'rm -rf venv' - } - } - } - - post { - failure { - mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + - "is here: ${env.BUILD_URL}\nStarted by ${env.BUILD_CAUSE}" , - from: env.emailFrom, - //replyTo: env.emailFrom, - subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build failed", - to: env.emailTo - } - success { - mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build successful\n" + - "Started by ${env.BUILD_CAUSE}", - from: env.emailFrom, - //replyTo: env.emailFrom, - subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build successful", - to: env.emailTo - } - } -} \ No newline at end of file diff --git a/index.html b/index.html deleted file mode 100644 index 64233a9e..00000000 --- a/index.html +++ /dev/null @@ -1 +0,0 @@ -index.html \ No newline at end of file diff --git a/src/proofofwork.py b/src/proofofwork.py index bb16951c..e5c2a1eb 100644 --- a/src/proofofwork.py +++ b/src/proofofwork.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-branches,too-many-statements,protected-access + # pylint: disable=too-many-branches,too-many-statements,protected-access """ src/proofofwork.py ================== From bafe704012c02e701177ac8eba6f8a7ac2164a7b Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Tue, 24 Sep 2019 16:22:44 +0530 Subject: [PATCH 83/85] changes in the jenkins file for checking trigger --- Jenkinsfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 3148d590..0e9648f0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -74,6 +74,15 @@ pipeline { // } // } + stage('changes in script check') { + steps { + sh ''' + echo ${SHELL} + ''' + // sudo /home/cis/.local/bin/nosetests --with-xunit tests + } + } + stage('Test environment') { steps { sh ''' From 0395355e6c082a948992e03082931004e86f8605 Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Tue, 1 Oct 2019 20:52:10 +0530 Subject: [PATCH 84/85] changes in pylint changes --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0e9648f0..0d679f71 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -107,7 +107,7 @@ pipeline { steps{ sh ''' export TERM="linux" - pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) PyBitmessage/ > pylint.log || exit 0 + pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) PyBitmessage/src > pylint.log || exit 0 ''' } } From f0e75af3e8828dfedc548379a1016f6d5b88ad9d Mon Sep 17 00:00:00 2001 From: "shikhar.s" Date: Tue, 5 Nov 2019 20:22:45 +0530 Subject: [PATCH 85/85] add of sonar report file named report-task --- report-task.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 report-task.txt diff --git a/report-task.txt b/report-task.txt new file mode 100644 index 00000000..5a2ba99a --- /dev/null +++ b/report-task.txt @@ -0,0 +1 @@ +report-task.txt \ No newline at end of file