Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jayboyi opened this issue Jan 28, 2022 · 2 comments

Comments

@jayboyi
Copy link

jayboyi commented Jan 28, 2022

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"

		"""
@sebaslogen
Copy link
Owner

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.

@jayboyi
Copy link
Author

jayboyi commented Jan 28, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants