Есть отличная удаленная работа для php+codeception+jenkins+allure+docker спецов. 100% remote! Присоединиться к проекту

Allure + Jenkins (Не создается репорт: NullPointerException)

maven-surefire-plugin
jenkins
maven
allure
Теги: #<Tag:0x00007f7b65381610> #<Tag:0x00007f7b65381480> #<Tag:0x00007f7b65381250> #<Tag:0x00007f7b65381070>

(Alex Sup) #1

Добрый день!
Проблема похожа на тему:
Не создается отчет с помощью Allure Jenkins Plugin (NullPointerException)

Я просмотрел свершенно все темы на http://automated-testing.info, и stackoverflow, но решения так и не нашел…

Локально на машине отчет создается, ранится.

В workspace Jenkins присутствует:
http://localhost:8080/me/my-views/view/All/job/MavenTest/ws/target/allure-results/


При запуске билда выдает Null Pointer Exception ошибку.

[details=STACK - JENKINS (посмотреть тут)]Started by user Oleksii
Building in workspace C:\Program Files (x86)\Jenkins\workspace\MavenTest

git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
git.exe config remote.origin.url https://github.com/SuprunO/MavenTest.git # timeout=10
Fetching upstream changes from https://github.com/SuprunO/MavenTest.git
git.exe --version # timeout=10
git.exe fetch --tags --progress https://github.com/SuprunO/MavenTest.git +refs/heads/:refs/remotes/origin/
git.exe rev-parse “refs/remotes/origin/master^{commit}” # timeout=10
git.exe rev-parse “refs/remotes/origin/origin/master^{commit}” # timeout=10
Checking out Revision 6547fbcfc3ba89fd8e98dfc36079067718ae07a1 (refs/remotes/origin/master)
git.exe config core.sparsecheckout # timeout=10
git.exe checkout -f 6547fbcfc3ba89fd8e98dfc36079067718ae07a1
git.exe rev-list 6547fbcfc3ba89fd8e98dfc36079067718ae07a1 # timeout=10
[MavenTest] $ cmd.exe /C “C:\apache-maven-3.3.9\bin\mvn.cmd -f pom.xml clean test site && exit %%ERRORLEVEL%%”
[INFO] Scanning for projects…
[WARNING]
[WARNING] Some problems were encountered while building the effective model for MavenTest:MavenTest:jar:1.0-SNAPSHOT
[WARNING] ‘build.plugins.plugin.version’ for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 71, column 17
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MavenTest 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — maven-clean-plugin:2.5:clean (default-clean) @ MavenTest —
[INFO] Deleting C:\Program Files (x86)\Jenkins\workspace\MavenTest\target
[INFO]
[INFO] — maven-resources-plugin:2.6:resources (default-resources) @ MavenTest —
[WARNING] Using platform encoding (Cp1251 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Program Files (x86)\Jenkins\workspace\MavenTest\src\main\resources
[INFO]
[INFO] — maven-compiler-plugin:3.1:compile (default-compile) @ MavenTest —
[INFO] No sources to compile
[INFO]
[INFO] — maven-resources-plugin:2.6:testResources (default-testResources) @ MavenTest —
[WARNING] Using platform encoding (Cp1251 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Program Files (x86)\Jenkins\workspace\MavenTest\src\test\resources
[INFO]
[INFO] — maven-compiler-plugin:3.1:testCompile (default-testCompile) @ MavenTest —
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1251, i.e. build is platform dependent!
[INFO] Compiling 2 source files to C:\Program Files (x86)\Jenkins\workspace\MavenTest\target\test-classes
[INFO]
[INFO] — maven-surefire-plugin:2.19.1:test (default-test) @ MavenTest —


T E S T S

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Running TestApp1
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.899 sec <<< FAILURE! - in TestApp1
testPrintHelloWorld1(TestApp1) Time elapsed: 0.059 sec <<< FAILURE!
org.junit.ComparisonFailure: expected:<Hello World [2]> but was:<Hello World [1]>
at TestApp1.testPrintHelloWorld1(TestApp1.java:19)

Results :

Failed tests:
TestApp1.testPrintHelloWorld1:19 expected:<Hello World [2]> but was:<Hello World [1]>

Tests run: 2, Failures: 1, Errors: 0, Skipped: 0

[ERROR] There are test failures.

Please refer to C:\Program Files (x86)\Jenkins\workspace\MavenTest\target\surefire-reports for the individual test results.
[INFO]
[INFO] — maven-site-plugin:3.3:site (default-site) @ MavenTest —
[INFO] configuring report plugin ru.yandex.qatools.allure:allure-maven-plugin:1.4.0
[WARNING] No project URL defined - decoration links will not be relativized!
[INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
[INFO] Generating “Allure” report — allure-maven-plugin:1.4.0
[INFO] Found DataProvider [ru.yandex.qatools.allure.data.providers.BehaviorDataProvider@14447be]
[INFO] Found DataProvider [ru.yandex.qatools.allure.data.providers.DefectsDataProvider@5099c59b]
[INFO] Found DataProvider [ru.yandex.qatools.allure.data.providers.GraphDataProvider@4f486211]
[INFO] Found DataProvider [ru.yandex.qatools.allure.data.providers.TestCasesDataProvider@8a6631b]
[INFO] Found DataProvider [ru.yandex.qatools.allure.data.providers.XUnitDataProvider@4d7a64ca]
[INFO] Found DataProvider [ru.yandex.qatools.allure.data.providers.AttachmentsProvider@3635099]
[INFO] Found DataProvider [ru.yandex.qatools.allure.data.providers.EnvironmentProvider@3332c7a5]
[INFO] Configured Artifact: ru.yandex.qatools.allure:allure-report-face:1.4.0:war
[INFO] Unpacking C:\WINDOWS\system32\config\systemprofile.m2\repository\ru\yandex\qatools\allure\allure-report-face\1.4.0\allure-report-face-1.4.0.war to C:\Program Files (x86)\Jenkins\workspace\MavenTest\target\site\allure-maven-plugin with includes “” and excludes “”
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 54.858 s
[INFO] Finished at: 2017-01-19T11:30:06+02:00
[INFO] Final Memory: 28M/170M
[INFO] ------------------------------------------------------------------------
ERROR: Build step failed with exception
java.lang.NullPointerException
at ru.yandex.qatools.allure.jenkins.AllureReportPublisherDescriptor.getCommandlineInstallation(AllureReportPublisherDescriptor.java:98)
at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.generateReport(AllureReportPublisher.java:147)
at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.perform(AllureReportPublisher.java:93)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
at hudson.model.Run.execute(Run.java:1753)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Build step ‘Allure Report’ marked build as failure
Finished: FAILURE
[/details]

Конфиг Билда:

Конфиг Коммандлайн:

POM.xml (тут)

https://codeshare.io/a3AD76

settings.xml

MAVEN SETTINGS XML


(Alex Sup) #2

UPD: NULL POINTER EXCEPTION решился добавлением названия COMMANDLINE.

Но репорт все равно не создается.
JENKINS STACK


(Alex Sup) #3

Я так догадываюсь, падает тест на

ЌҐЇаҐ¤ўЁ¤Ґ­­®Ґ Ї®пў«Ґ­ЁҐ: \Jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\Console1.

Хотя в пути нет кириллицы:
C:\Program Files (x86)\Jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\Console1


(Alex Sup) #4

Прописал путь к консоли commandline и все заработало! Всем спасибо!))))


(Roma Marinsky) #5

Буш должен :smiley: