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

Tests are not starting with Allure-testng 2.9.0 and TestNG 7.0.0-beta1/3. "java.lang.NoSuchMethodError: org.testng.internal.TestResult" #308

Closed
1 of 3 tasks
davidggevorgyan opened this issue Jan 16, 2019 · 8 comments · Fixed by #321

Comments

@davidggevorgyan
Copy link

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

I'm using TestNG 7.0.0-beta1. If I'm changing Allure-testng version from 2.8.1 to 2.9.0 I'm getting an error on tests execution start. StackTrace is attached.

TestNG version 6.14.3 works with Allure 2.9.0 as expected.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Here is my demo code https://github.com/davidggevorgyan/automationpractice/tree/master-allure
Change Allure-testng version in pom.xml to 2.9.0 and run tests via mvn clean test

What is the expected behavior?

Tests are starting and passing. I expect to have the same behavior in 2.8.1 version and 2.9.0

What is the motivation / use case for changing the behavior?

Fixing the crash

Please tell us about your environment:

Allure version 2.2.0
Test framework [email protected]/3
Allure integration [email protected]
Generate report using [email protected]

Other information

//: # (

# Created at 2019-01-16T04:15:25.307
java.lang.NoSuchMethodError: org.testng.internal.TestResult.<init>(Ljava/lang/Object;Lorg/testng/ITestNGMethod;Ljava/lang/Throwable;Lorg/testng/ITestContext;)V
	at io.qameta.allure.testng.AllureTestNg.createFakeResult(AllureTestNg.java:171)
	at io.qameta.allure.testng.AllureTestNg.lambda$onStart$1(AllureTestNg.java:167)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
	at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1603)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at io.qameta.allure.testng.AllureTestNg.onStart(AllureTestNg.java:167)
	at org.testng.TestRunner.fireEvent(TestRunner.java:872)
	at org.testng.TestRunner.beforeRun(TestRunner.java:607)
	at org.testng.TestRunner.run(TestRunner.java:582)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:398)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:392)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:354)
	at org.testng.SuiteRunner.run(SuiteRunner.java:302)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1145)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1067)
	at org.testng.TestNG.runSuites(TestNG.java:997)
	at org.testng.TestNG.run(TestNG.java:965)
	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:283)
	at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)

```)
@baflQA
Copy link
Contributor

baflQA commented Feb 6, 2019

👍 upvoting!

@baflQA
Copy link
Contributor

baflQA commented Feb 6, 2019

So, It definitely fails if there are some tests marked with @test(enabled = false)

@baev
Copy link
Member

baev commented Feb 6, 2019

So, It definitely fails if there are some tests marked with @test(enabled = false)

yep, introduced in #275

@baflQA
Copy link
Contributor

baflQA commented Feb 6, 2019

Exactly :P Wanted to send You this link testng-team/testng@d9b7428#diff-dee9b63261a808b691a0b486b01da144R42
But it's already fixed :) Thx a lot!

@baflQA
Copy link
Contributor

baflQA commented Feb 6, 2019

Oh, I think I misread Your comment. It's not fixed, obviously.
Hm, They have removed all the public constructors from the TestResult class, and replaced them with the factory methods in TestNg 7. Also, the non-parameter constructor is private now.
On the other hand, that's why this class is in the "internal" package - should not be used by the external libraries. Do You guys have some idea how to make it work for the different versions of the TestNg? The simplest solution is to comment this part of code :P
Or, there might be allure-testng7 package added?

@baev
Copy link
Member

baev commented Feb 6, 2019

Yeah, I am thinking of adding separate integration for testng 7 since we would like to use some of the new extension points. But I don’t want to spend time on this until testng 7 goes GA

@AutomatedOwl
Copy link

AutomatedOwl commented Jun 5, 2019

is that a mandatory feature or optional? now when i'm running just one sanity test i'm getting report like this one:

Screenshot from 2019-06-05 12-31-31

is it worth adding PR for making it optional? @baev

@baev
Copy link
Member

baev commented Jun 5, 2019

@AutomatedOwl please do not comment on closed issues, create a separate one with more details provided

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

Successfully merging a pull request may close this issue.

4 participants