CleanGUITestArchitecture icon indicating copy to clipboard operation
CleanGUITestArchitecture copied to clipboard

JENIKS: GRADLE: TESTNG: CUCUMBER FEATURE File: testrunner is faling on jekins pipeline only

Open jayboyi opened this issue 3 years ago • 2 comments

Hi, i have moved to gradle framework from maven. while running our test with gradle on local machine its getting success but while running the same on jekins with gradle commands i'm facing error on the testng cucumber as below

Gradle suite > Gradle test > regressionSuite.TestRunner.feature[0](Address Verification) FAILED cucumber.runtime.CucumberException at TestRunner.java:64 Caused by: java.lang.AssertionError at Assert.java:94

lines of the code at those lines is as follows: @Test(groups = "cucumber", description = "Runs Cucumber Feature", dataProvider = "features") public void feature(CucumberFeatureWrapper cucumberFeature) throws IOException { testNGCucumberRunner.runCucumber(cucumberFeature.getCucumberFeature()); }

Not able to find the root cause of this issue

commands using on Jekins file are: sh """

		ls -ltr
		pwd
		echo "gateway is ${gatewayname}"
		chmod 777 ./gradlew
        ./gradlew clean assemble
        ./gradlew test -Dcucumber.options="--tags @$gatewayname"

		"""

jayboyi avatar Jan 28 '22 11:01 jayboyi

My only suggestion would be to try to figure out the differences between your local execution environment and the one in Jenkins, like gradle version, Java version, etc.

sebaslogen avatar Jan 28 '22 15:01 sebaslogen

i'm not able to find those.. any hint.. and the command ./gradlew test i -Dcucumber.options="--tags @$gatewayname" is not running. If i see the Jenkins gradle commands it's starting the test with + ./gradlew build . But i gave above command to run tag wise... here my tag is SDT but its starting the very first feature file on the test run and failing with exception.

gateway is SDT

  • chmod 777 ./gradlew
  • ./gradlew clean assemble Starting a Gradle Daemon (subsequent builds will be faster)

Task :clean UP-TO-DATE Task :compileJava NO-SOURCE Task :processResources NO-SOURCE Task :classes UP-TO-DATE Task :jar Task :assemble

BUILD SUCCESSFUL in 4s 2 actionable tasks: 1 executed, 1 up-to-date

  • ./gradlew build

Task :compileJava NO-SOURCE Task :processResources NO-SOURCE Task :classes UP-TO-DATE Task :jar UP-TO-DATE Task :assemble UP-TO-DATE

Task :compileTestJava Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

Task :processTestResources Task :testClasses Task :test

Gradle suite > Gradle test > regressionSuite.TestRunner.feature[0](Address Verification) FAILED cucumber.runtime.CucumberException at TestRunner.java:64 Caused by: java.lang.AssertionError at Assert.java:94

1 test completed, 1 failed

jayboyi avatar Jan 28 '22 19:01 jayboyi