jjb: babeltrace: pylint job for bt2
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 26 Sep 2019 18:29:16 +0000 (14:29 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Thu, 26 Sep 2019 18:29:16 +0000 (14:29 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
jobs/babeltrace.yaml
scripts/babeltrace/black.sh [deleted file]
scripts/babeltrace/pylint.sh

index b6e3e2dd0dcc91f56b97f9f3e6e197bb167a2e0d..cc80e2e796fb8effc4b1600f38624cc1f612255c 100644 (file)
             - 'gerrit'
 
 - job-template:
-    name: dev_gerrit_babeltrace_black
+    name: dev_gerrit_babeltrace_pylint
     defaults: babeltrace
     concurrent: true
 
 
     builders:
       - shell:
-         !include-raw-escape: scripts/babeltrace/black.sh
+         !include-raw-escape: scripts/babeltrace/pylint.sh
 
     properties:
       - inject:
     defaults: babeltrace
     node: 'amd64'
 
-    scm: []
-
     triggers:
       - pollscm:
           cron: "@daily"
 
     builders:
-       - copyartifact:
-           project: babeltrace_{version}_build/arch=amd64,build=std,conf=python-bindings
-           which-build: last-successful
-           stable: false
-           filter: 'build/**'
-           target: 'deps/babeltrace'
        - shell:
           !include-raw-escape: scripts/babeltrace/pylint.sh
 
     publishers:
       - archive:
-          artifacts: 'pep8.out,pylint.out'
-      - violations:
-          pep8:
-            pattern: pep8.out
-            min: 10
-            max: 999
-            unstable: 999
-          pylint:
-            pattern: pylint.out
-            min: 10
-            max: 999
-            unstable: 999
+          artifacts: 'black.out,flake8.out'
       - email-ext:
           recipients: '{obj:email_to}'
           reply-to: ci-notification@lists.lttng.org
           conf: !!python/tuple [std]
       - 'babeltrace_{version}_cppcheck'
       - 'babeltrace_{version}_scan-build'
-      - 'babeltrace_{version}_pylint'
 
 - project:
     name: babeltrace2
           build: !!python/tuple [std]
           conf: !!python/tuple [std, prod]
           filter: ''
-      - 'dev_gerrit_babeltrace_black'
+      - 'dev_gerrit_babeltrace_pylint'
 
 
 - project:
diff --git a/scripts/babeltrace/black.sh b/scripts/babeltrace/black.sh
deleted file mode 100644 (file)
index 05cbfdb..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh -exu
-#
-# Copyright (C) 2015 Michael Jeanson <mjeanson@efficios.com>
-# Copyright (C) 2019 Francis Deslauriers <francis.deslauriers@efficios.com>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-PYTHON3=python3
-
-PYENV_HOME="$WORKSPACE/.pyenv/"
-
-# Delete previously built virtualenv
-if [ -d "$PYENV_HOME" ]; then
-    rm -rf "$PYENV_HOME"
-fi
-
-# Create virtualenv and install necessary packages
-virtualenv --system-site-packages -p ${PYTHON3} "$PYENV_HOME"
-
-set +ux
-. "$PYENV_HOME/bin/activate"
-set -ux
-
-pip install --quiet black
-
-black --diff --check src/babeltrace
index dc3950c0451af5a571db15ffcb66be0462b64395..35b287f08d2da3651f24261c634221f7d37caf96 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/sh -exu
 #
-# Copyright (C) 2015 - Michael Jeanson <mjeanson@efficios.com>
+# Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
+# Copyright (C) 2019 Francis Deslauriers <francis.deslauriers@efficios.com>
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-BABELTRACE_DIR="deps/babeltrace/build"
-
 PYTHON3=python3
-P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])")
-
-BINDINGS_DIR="$BABELTRACE_DIR/lib/python${P3_VERSION}/dist-packages/babeltrace"
 
 PYENV_HOME="$WORKSPACE/.pyenv/"
 
@@ -32,13 +28,18 @@ fi
 # Create virtualenv and install necessary packages
 virtualenv --system-site-packages -p ${PYTHON3} "$PYENV_HOME"
 
-set +u
+set +ux
 . "$PYENV_HOME/bin/activate"
-set -u
+set -ux
+
+pip install --quiet black
+pip install --quiet flake8
+
+exit_code=0
 
-pip install --quiet pylint
-pip install --quiet pep8
+cd src/babeltrace
 
-pep8 --exclude="nativebt.py" "$BINDINGS_DIR" | tee pep8.out
+black --diff --check . | tee ../../black.out || exit_code=1
+flake8 | tee ../../flake8.out || exit_code=1
 
-pylint -f parseable --ignore="nativebt.py" "$BINDINGS_DIR" | tee pylint.out
+exit $exit_code
This page took 0.02681 seconds and 4 git commands to generate.