When I added the commands that I use manually at the command prompt to run my project to Jenkins, Jenkins is unable to find the file that's referenced.
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.631 s <<< FAILURE! - in TestSuite
[ERROR] main(test.java.IterateToEAMethods) Time elapsed: 0.016 s <<< FAILURE!
java.io.FileNotFoundException: Q:\A_Parts routing\03_Systeme\Selenium\Vega Automatisierung Teil 1\AutomatisierterSteuerungsantrag.xls (The system cannot find the path specified)
at test.java.IterateToEAMethods.main(IterateToEAMethods.java:162)
When I run this project through the command line using the exact same commands it runs fine.
CD C:\Users\D171_o_QECJACK031\eclipse-workspace\VegaAutomatisierungPart2
mvn --settings settings.xml compile clean test
Does anyone know how to get Jenkins to have access to the file?
None of my other projects that use files have this problem and they run through Jenkins.
You need to replace \ with \\ when accessing paths in windows.
You could use dir with the path where your scripts are present :
// dir("<Your path where scripts are present>")
dir ("C:\\Users\\D171_o_QECJACK031\\eclipse-workspace\\VegaAutomatisierungPart2"){
<Your commands>
}
Related
I'm running mvn test, and based on the generated xml results file, i'm preparing the results summary.
Here now i'm only able to handle right or wrong testcases.
and if any issue in the code, i'm getting the compilation error in the mvn test
Can we log the compilation errors as well in the surefire-reports ?
Outcome expected: include the compilation error case in the below result itself.
-------------------------------------------------------------------------------
Test set: com.example.helloworld.HelloWorldApplicationTests
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.666 s - in com.example.helloworld.HelloWorldApplicationTests
I know there is a similar question to this (to question: Neo4j Spatial: can't run spatial), however that question seems to be solved when installing dependencies. I think that is not the solution to my case.
After installing Neo4j and installing maven
$ brew install neo4j
$ brew install maven
making a directory called spatial and cloning neo4j-spatial to this folder.
$ git clone https://github.com/neo4j-contrib/spatial.git
Then i tried to maven install this git clone.
/spatial$ mvn install
After a lot of test it returns a "Build failure"
Results :
Failed tests:
ProgressLoggingListenerTest.testProgressLoggingListnerWithAllLogs:38->testProgressLoggingListenerWithSpecifiedWaits:62
Argument(s) are different! Wanted:
forwardingPrintStream.println(
"100.00 (10/10) - Completed test"
);
-> at org.neo4j.gis.spatial.ProgressLoggingListenerTest.testProgressLoggingListenerWithSpecifiedWaits(ProgressLoggingListenerTest.java:62)
Actual invocation has different arguments:
forwardingPrintStream.println(
"10,00 (1/10) - Running test"
);
-> at org.neo4j.gis.spatial.rtree.ProgressLoggingListener.lambda$new$1(ProgressLoggingListener.java:45)
ProgressLoggingListenerTest.testProgressLoggingListnerWithOnlyStartAndEnd:46->testProgressLoggingListenerWithSpecifiedWaits:62
Argument(s) are different! Wanted:
forwardingPrintStream.println(
"100.00 (10/10) - Completed test"
);
-> at org.neo4j.gis.spatial.ProgressLoggingListenerTest.testProgressLoggingListenerWithSpecifiedWaits(ProgressLoggingListenerTest.java:62)
Actual invocation has different arguments:
forwardingPrintStream.println(
"10,00 (1/10) - Running test"
);
-> at org.neo4j.gis.spatial.rtree.ProgressLoggingListener.lambda$new$1(ProgressLoggingListener.java:45)
Tests run: 146, Failures: 2, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10:34 min
[INFO] Finished at: 2016-09-23T15:55:35+02:00
[INFO] Final Memory: 44M/558M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project neo4j-spatial: There are test failures.
[ERROR]
[ERROR] Please refer to /Volumes/Macintosh HD/Users/Tom/spatial/target/surefire-reports for the individual test results.
[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/MojoFailureException
In my queeste to solve this "Build failure" I discovered that most maven install errors are due to dependencies. However these error messages do not indicate any missing dependencies?
I tried using mvn verify however this just seems to try to build the plugin again returning the same Build failure.
/spatial$ mvn verify
Two questions;
- Am I missing dependencies or is the problem in something else?
- If I am missing dependencies, what are they and how to install them?
Thanks in advance!
The tests depend on the locale of the build environment as it checks the result of number formatting with decimal number, expecting a point as the decimal separator:
"100.00 (10/10) - Completed test"
Your locale uses the comma as the decimal separator, based on the actual value reported:
"10,00 (1/10) - Running test"
You have 2 options:
Build the project without running the tests:
mvn install -Dmaven.test.skip
Change the locale for the build:
LANG=C mvn install
or
LANG=en_US mvn install
I follow the evosuite maven documentation to generate unit test cases for my project. Below is the command I've used:
mvn -DmemoryInMB=2000 -Dcores=2 evosuite:generate evosuite:export test
The tool takes around 1 hour to generate test cases for my project (with 9700 lines of Java code). However when it proceed to mvn test phase, all test cases failed with the same message:
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec <<< FAILURE! - in com.xxx.yyy.util.Messages_ESTest
com.xxx.yyy.util.Messages_ESTest Time elapsed: 0 sec <<< ERROR!
java.lang.IllegalStateException: Trying to set up the sandbox while executing a test case
at <evosuite>.<evosuite>(<evosuite>)
at <evosuite>.<evosuite>(<evosuite>)
at <evosuite>.<evosuite>(<evosuite>)
While running the generated test case in Intellij IDEA most of them can pass the test:
Any one got any idea?
this is clearly a bug, which would be best to report on
https://github.com/EvoSuite/evosuite/issues
furthermore, currently in 1.0.3 the tests generated by EvoSuite do not work well with "mvn test". The fix is already in the SNAPSHOT though, and will be part of next release. However, the "Trying to set up the sandbox" might be a new bug as I haven't seen it before... :(
I'm running Cucumber tests (with Maven, in Jenkins) and outputting failed scenario's to target/rerun.txt, as per these instructions: https://github.com/cucumber/cucumber-jvm/issues/890
It creates the rerun.txt and it inputs failed scenario's, but enters them as: features/name.feature:2. The rerun then tries to run them as classpath/name.feature, and fails to see they are in src/test/resources/features.
If I put the features files in the classpath instead, I get an inconsistent filters error (probably because I'm using tags in the first call and the text in the second call).
How to get Cucumber to either output the correct path for features, or to get it to find the features based on the rerun.txt?
The error:
Running com.xxx.cucumber._RunCukesTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.002 sec <<< FAILURE!
initializationError(com.xxx.cucumber._RunCukesTest) Time elapsed: 0 sec <<< ERROR!
java.lang.IllegalArgumentException: Neither found on file system or on classpath: Not a file or directory: classpath\SubFolder\Test1.feature,
No resource found for: classpath:SubFolder/Test1.feature
Additional info:
All initial calls to tests are done via tags.
All features are in subfolders in classpath/src/test/resources/features
This test has to run in Jenkins, automatically, every day.
The first run uses this:
#RunWith(Cucumber.class)
#CucumberOptions(
strict = false,
features={"src/test/resources/features/"},
snippets=SnippetType.CAMELCASE,
plugin = { "pretty", "json:target/cucumber-reports/test-report.json", "html:target/cucumber-reports",
"rerun:target/rerun.txt"})
public class RunCukesTest {
}
The second run of failed scenario's uses this:
#RunWith(Cucumber.class)
#CucumberOptions(
strict = false,
features={"#target/rerun.txt"},
snippets=SnippetType.CAMELCASE,
plugin = {"pretty", "json:target/cucumber-reports/test-report.json", "html:target/cucumber-reports"})
public class _RunCukesTest {
}
Change the feature file location of first test runner to features = "."
This will make 'rerun.txt' to be updated with correct path to the feature file.
We are trying to migrate our system to WebDriver from Selenium 1.
Thorough the Hudson slave an error message appeared, but the test run fine in eclipse.
Environments:
Hudson master: Linux machine
Hudson slave: windows 7, x86
Java version: 1.7.0_03
System:
A new Hudson job was set up for the task, with the same configurations as it was for Selenium 1 test suites. The job executes a target from the build.xml file. clean,makedir and compile targets were ran successfully.
On executing the tests the following error message appeared on Hudson Console:
run_shopping_travel_tests:
[junit] Running com.example.tests.ExampleTests
[junit] Tests run: 1, Failures: 0, Errors: 2, Time elapsed: 2.385 sec
[junit] Test com.example.tests.ExampleTests FAILED
[junit] Running com.example.tests.Example2Test
[junit] Tests run: 1, Failures: 0, Errors: 2, Time elapsed: 0.752 sec
[junit] Test com.example.tests.Example2Test FAILED
[echo] selenium directory: C:\Selenium
The error:
Error Message
LINUX
Stacktrace
java.lang.NoSuchFieldError: LINUX
at org.openqa.selenium.firefox.FirefoxBinary.isOnLinux(FirefoxBinary.java:62)
at org.openqa.selenium.firefox.FirefoxBinary.startProfile(FirefoxBinary.java:72)
at org.openqa.selenium.firefox.FirefoxBinary.clean(FirefoxBinary.java:273)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:78)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:85)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:121)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:77)
at com.example.tests.ExampleTests.setup(ExampleTests.java:43)
The java code for the test:
public class ExampleTests
{
FirefoxDriver driver = null;
#Before
public void setup() {
File profileDir = new File( "C:\\Selenium\\FirefoxProfile" );
FirefoxProfile profile = new FirefoxProfile(profileDir);
driver = new FirefoxDriver(profile); // line 43, where error appears
}
#Test
public void T100_VerifyExampleTest() {
// some test code here
}
}
We have tried to run the test without "profile" and the same error message appeared.
Thanks in advance.
Problem solved.
There were some jar libraries included which were used for compiling by -javac (in the ant script), but not by eclipse.
Solution:
Check the jar files one-by-one,and delete the unnecessary ones from the lib folder.