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

На Jenkins (OC Ubunta) не запускаются тесты

ubuntu
windows
jenkins
selenide
java
chrome
Теги: #<Tag:0x00007f7b60f83580> #<Tag:0x00007f7b60f833f0> #<Tag:0x00007f7b60f831e8> #<Tag:0x00007f7b60f830a8> #<Tag:0x00007f7b60f82ec8> #<Tag:0x00007f7b60f82d88>

(Alex Melnyk) #1

Тесты на #selenide запускаются с командной строки и нормально собираютя (проходят на #chrome ), OC #windows
но не могут собратся на #jenkins .
Подскажите, кто знает, в чём может быть ошибка. #jenkins стоит на (OC #ubuntu )
Вот лог ошибки

Started by user anonymous
Building in workspace /var/lib/jenkins/workspace/testingCarID
Parsing POMs
[AutoTest] $ /var/lib/jenkins/tools/hudson.model.JDK/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.5.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven/boot/plexus-classworlds-2.5.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven/conf/logging jenkins.maven3.agent.Maven31Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven /var/cache/jenkins/war/WEB-INF/lib/remoting-2.53.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.5.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar 45385
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f /home/user/AutoTest/pom.xml install test
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building SelenidTask 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ SelenidTask ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ SelenidTask ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to /home/user/AutoTest/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.341 s
[INFO] Finished at: 2016-07-29T16:12:14+03:00
[INFO] Final Memory: 21M/141M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project SelenidTask: Error while storing the mojo status: /home/user/AutoTest/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst (Permission denied) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[JENKINS] Archiving /home/user/AutoTest/pom.xml to functional.carid/SelenidTask/0.0.1-SNAPSHOT/SelenidTask-0.0.1-SNAPSHOT.pom
/home/user/AutoTest/pom.xml is not inside /var/lib/jenkins/workspace/testingCarID/home/user/AutoTest/; will archive in a separate pass
channel stopped
Finished: FAILURE

Вот Pom.xml

project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>functional.carid</groupId>
	<artifactId>SelenidTask</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<testng.version>6.9.10</testng.version>
		<surefire.version>2.19</surefire.version>
		<maven.compiler.version>3.3</maven.compiler.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-java</artifactId>
			<version>2.53.0</version>
		</dependency>
		<dependency>
			<groupId>org.testng</groupId>
			<artifactId>testng</artifactId>
			<version>${testng.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-server</artifactId>
			<version>2.53.1</version>
		</dependency>

		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-firefox-driver</artifactId>
			<version>2.53.1</version>
		</dependency>

		<dependency>
			<groupId>com.codeborne</groupId>
			<artifactId>selenide</artifactId>
			<version>3.7</version>
			<!-- <scope>test</scope> -->
		</dependency>
		<dependency>

			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-chrome-driver</artifactId>
			<version>2.53.1</version>
		</dependency>
		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-ie-driver</artifactId>
			<version>2.53.0</version>
		</dependency>

	</dependencies>

	<build>
		<plugins>
			<plugin>
			<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<!-- Plugin compiler of Maven -->
				<version>3.5.1</version>
				<!-- <configuration> <fork>true</fork> <executable>C:\Program Files\Java\jdk1.8.0_77\bin\javac.exe</executable></configuration> 
					Java version <source>1.8</source> <target>1.8</target>  -->
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>${surefire.version}</version>
				<inherited>true</inherited>
				<configuration>
					<suiteXmlFiles>
						<suiteXmlFile>testng.xml</suiteXmlFile>
					</suiteXmlFiles>
					<!-- This is to skip tests during normal maven execution (e.g. mvn package) 
						and run them in integration-test -->
					<!--  <skip>false</skip>-->
				</configuration>

			</plugin>
		</plugins>
	</build>
</project>

(Sergey Pirogov) #2

может что-то с правами доступа


(Sergey Korol) #3

Я так понимаю, что вы залили в репозиторий весь хлам, включая target folder?


(Alex Melnyk) #4

да, залил с target


(Alex Melnyk) #5

Попробовал с FTP, такая борода


T E S T S

Results :

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

[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.607 s
[INFO] Finished at: 2016-07-29T17:02:24+03:00
[INFO] Final Memory: 18M/243M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project SelenidTask: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test failed: There was an error in the forked process
[ERROR] org.apache.maven.surefire.testset.TestSetFailedException: Suite file /var/lib/jenkins/workspace/TestsFromFTP/testng.xml is not a valid file
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.locateTestSets(TestNGXmlTestSuite.java:115)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:107)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:286)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:240)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[JENKINS] Archiving /var/lib/jenkins/workspace/TestsFromFTP/pom.xml to functional.carid/SelenidTask/0.0.1-SNAPSHOT/SelenidTask-0.0.1-SNAPSHOT.pom
channel stopped
Finished: FAILURE


(Sergey Korol) #6

Тогда вам бы для начала почитать о конвеншенах, что нужно хранить в репозитории, а что нет.

Удалите лишнее, и будет вам счастье.


(Alex Melnyk) #7

Сбросте ссылку, please


(Sergey Korol) #8

Самый простенький пример .gitignore. А вообще, многое зависит от вашей структуры, IDE, доп. плагинов и т.п.


(Alex Melnyk) #9

Не могу разобраться, что может вызывать такую ошибку

 0K ...                                                   100%  133M=0s

2016-08-09 16:46:58 (133 MB/s) - ‘pom.xml.3’ saved [3100]

Parsing POMs
[workspace] $ /usr/lib/jvm/java-7-openjdk-amd64/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.5.jar:/usr/share/maven/boot/plexus-classworlds-2.x.jar org.jvnet.hudson.maven3.agent.Maven3Main /usr/share/maven /var/cache/jenkins/war/WEB-INF/lib/remoting-2.53.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.5.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar 43049
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /var/lib/jenkins/jobs/CaridAutoTest/workspace/pom.xml -Dmaven.repo.local=/var/lib/jenkins/maven-repositories/0 test
[INFO] Scanning for projects…
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SelenidTask 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — maven-resources-plugin:2.3:resources (default-resources) @ SelenidTask —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/jobs/CaridAutoTest/workspace/src/main/resources
[INFO]
[INFO] — maven-compiler-plugin:3.5.1:compile (default-compile) @ SelenidTask —
[INFO] No sources to compile
[INFO]
[INFO] — maven-resources-plugin:2.3:testResources (default-testResources) @ SelenidTask —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/jobs/CaridAutoTest/workspace/src/test/resources
[INFO]
[INFO] — maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ SelenidTask —
[INFO] No sources to compile
[INFO]
[INFO] — maven-surefire-plugin:2.19:test (default-test) @ SelenidTask —
[INFO] No tests to run.
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.041s
[INFO] Finished at: Tue Aug 09 16:47:15 EEST 2016
[INFO] Final Memory: 17M/144M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project SelenidTask: Exception in provider: Suite file /var/lib/jenkins/jobs/CaridAutoTest/workspace/testng.xml is not a valid file -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[JENKINS] Archiving /var/lib/jenkins/jobs/CaridAutoTest/workspace/pom.xml to functional.carid/SelenidTask/0.0.1-SNAPSHOT/SelenidTask-0.0.1-SNAPSHOT.pom
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
channel stopped
Finished: FAILURE


(Sergey Korol) #10

Что-то мне кажется, что suite у вас не в руте лежит. Пути надо указывать относительные, а не просто название xml.