我使用pytest運行PEP8檢查(所有下面列出的是發生在Windows機器上的):違規插件使用錯誤的路徑來尋找PEP8報告
py.test --pep8 --junitxml=reports\pep8.log
我的設置工作,尋找PEP8在報告.log文件\ pep8.log
但是當我運行我看到那裏的侵犯插件查找報告的路徑是沒有意義的工作:
generated xml file: C:\Jenkins\jobs\python-template-2\workspace\reports\pep8.log =============== 89 failed, 33 skipped, 1 error in 1.48 seconds ================
C:\Jenkins\jobs\python-template-2\workspace>exit 1 Build step 'Выполнить команду Windows' marked build as failure ERROR: Publisher hudson.plugins.violations.ViolationsPublisher aborted due to exception java.io.FileNotFoundException: C:\Jenkins\jobs\python-template-2\builds\2013-10-22_13-30-44\violations\file\<\failure><\testcase>C:\Jenkins\jobs\python-template-2\workspace\contests\migrations\0003_auto__add_votinghistory.py.xml (Syntax error in filename) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(Unknown Source) at java.io.FileOutputStream.(Unknown Source) at hudson.FilePath.write(FilePath.java:1642) at hudson.plugins.violations.generate.ExecuteFilePath.execute(ExecuteFilePath.java:40) at hudson.plugins.violations.generate.GenerateXML.execute(GenerateXML.java:47) at hudson.plugins.violations.ViolationsCollector.invoke(ViolationsCollector.java:122) at hudson.plugins.violations.ViolationsCollector.invoke(ViolationsCollector.java:25) at hudson.FilePath.act(FilePath.java:912) at hudson.FilePath.act(FilePath.java:885) at hudson.plugins.violations.ViolationsPublisher.perform(ViolationsPublisher.java:74) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:781) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:753) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706) at hudson.model.Run.execute(Run.java:1690) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:230) Finished: FAILURE
Addittionally,嘗試啓動PEP8檢查無使用pyt EST,而不是我用這個命令窗口,找到並檢查所有.py文件:
FOR /R %i IN (*.py) DO pep8 %i 1>>reports\pep8.log
在這種情況下,我得到如下:
C:\Jenkins\jobs\python-template-2\workspace>exit 1 Build step 'Выполнить команду Windows' marked build as failure ERROR: Publisher hudson.plugins.violations.ViolationsPublisher aborted due to exception java.io.FileNotFoundException: C:\Jenkins\jobs\python-template-2\builds\2013-10-15_13-31-37\violations\file\C:\Jenkins\jobs\python-template-2\workspace\notifications\email.py.xml (Syntax error in filename) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(Unknown Source) at java.io.FileOutputStream.(Unknown Source) at hudson.FilePath.write(FilePath.java:1666) at hudson.plugins.violations.generate.ExecuteFilePath.execute(ExecuteFilePath.java:40) at hudson.plugins.violations.generate.GenerateXML.execute(GenerateXML.java:47) at hudson.plugins.violations.ViolationsCollector.invoke(ViolationsCollector.java:122) at hudson.plugins.violations.ViolationsCollector.invoke(ViolationsCollector.java:25) at hudson.FilePath.act(FilePath.java:916) at hudson.FilePath.act(FilePath.java:889) at hudson.plugins.violations.ViolationsPublisher.perform(ViolationsPublisher.java:74) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:786) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:758) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:711) at hudson.model.Run.execute(Run.java:1690) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:246) Finished: FAILURE