-
Bug
-
Resolution: Not A Defect
-
Minor
-
None
-
Warnings 5.0 beta2
Jenkinsfile:
pipeline { agent any stages { stage('checkout'){ steps{ git branch: 'static_analysis', url: 'https://github.com/lioramilbaum/devopsloft.git' } } } post { always { recordIssues enabledForFailure: true, aggregatingResults : true, tools: [ [tool: [$class: 'Flake8'], pattern: '**/*.py'] ] } } }
Console log:
Started by user [jenkins|http://localhost:8080/user/jenkins] Running in Durability level: MAX_SURVIVABILITY[Pipeline] nodeRunning on [Jenkins|http://localhost:8080/computer/(master)/] in /var/jenkins_home/workspace/devopsloft[Pipeline] {[Pipeline] stage[Pipeline] { (checkout)[Pipeline] git > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url [https://github.com/lioramilbaum/devopsloft.git] # timeout=10 Fetching upstream changes from [https://github.com/lioramilbaum/devopsloft.git] > git --version # timeout=10 > git fetch --tags --progress [https://github.com/lioramilbaum/devopsloft.git] +refs/heads/*:refs/remotes/origin/* > git rev-parse refs/remotes/origin/static_analysis^\{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/static_analysis^\{commit} # timeout=10 Checking out Revision 61cff2d8f616561c1129acbcaa3439ce984d88d1 (refs/remotes/origin/static_analysis) > git config core.sparsecheckout # timeout=10 > git checkout -f 61cff2d8f616561c1129acbcaa3439ce984d88d1 > git branch -a -v --no-abbrev # timeout=10 > git branch -D static_analysis # timeout=10 > git checkout -b static_analysis 61cff2d8f616561c1129acbcaa3439ce984d88d1 Commit message: "Experimenting Warnings plugin 5.0 beta2" > git rev-list --no-walk 61cff2d8f616561c1129acbcaa3439ce984d88d1 # timeout=10[Pipeline] }[Pipeline] // stage[Pipeline] stage[Pipeline] { (Declarative: Post Actions)[Pipeline] recordIssues[Flake8] Searching for all files in '/var/jenkins_home/workspace/devopsloft' that match the pattern '**/*.py' [Flake8] -> found 4 files [Flake8] Successfully parsed file /var/jenkins_home/workspace/devopsloft/application.py [Flake8] -> found 0 issues (skipped 0 duplicates) [Flake8] Successfully parsed file /var/jenkins_home/workspace/devopsloft/config.py [Flake8] -> found 0 issues (skipped 0 duplicates) [Flake8] Successfully parsed file /var/jenkins_home/workspace/devopsloft/mod_auth/forms.py [Flake8] -> found 0 issues (skipped 0 duplicates) [Flake8] Successfully parsed file /var/jenkins_home/workspace/devopsloft/mod_auth/models.py [Flake8] -> found 0 issues (skipped 0 duplicates) [Flake8] No filter has been set, publishing all 0 issues [Flake8] Attaching ResultAction with ID 'flake8' to run 'devopsloft #4'. [Flake8] No valid reference build found that meets the criteria (IGNORE_JOB_RESULT - SUCCESSFUL_QUALITY_GATE) [Flake8] All reported issues will be considered outstanding [Flake8] No quality gates have been set - skipping [Flake8] Health report is disabled - skipping [Flake8] Created analysis result for 0 issues (found 0 new issues, fixed 0 issues)[Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineFinished: SUCCESS
Expecting similar results as when running it manually:
flake8 ../devopsloft/
../devopsloft/application.py:42:1: E302 expected 2 blank lines, found 1 ../devopsloft/application.py:46:1: E302 expected 2 blank lines, found 1 ../devopsloft/application.py:51:1: E302 expected 2 blank lines, found 1 ../devopsloft/application.py:55:1: E302 expected 2 blank lines, found 1 ../devopsloft/application.py:59:1: E302 expected 2 blank lines, found 1 ../devopsloft/application.py:88:1: E302 expected 2 blank lines, found 1 ../devopsloft/application.py:121:1: E302 expected 2 blank lines, found 1 ../devopsloft/application.py:141:1: E302 expected 2 blank lines, found 1 ../devopsloft/application.py:147:1: E305 expected 2 blank lines after class or function definition, found 1
In your pipeline you don't actually call flake8. The warnings plugin only scans the report files and visualizes the results. You need to start the tool on your own. Or is your pipeline just a snippet?