Skip to content

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

Description

@davidggevorgyan

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 testng@7.0.0-beta1/3
Allure integration allure-testng@2.9.0
Generate report using allure-maven@2.10.0

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)

```)

Activity

  1. baflQA commented on Feb 6, 2019

    @baflQA
    Contributor

    👍 upvoting!

  2. baflQA commented on Feb 6, 2019

    @baflQA
    Contributor

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

  3. baev commented on Feb 6, 2019

    @baev
    Member

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

    yep, introduced in #275

  4. baflQA commented on Feb 6, 2019

    @baflQA
    Contributor

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

  5. baflQA commented on Feb 6, 2019

    @baflQA
    Contributor

    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?

  6. baev commented on Feb 6, 2019

    @baev
    Member

    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

  7. added a commit that references this issue on Feb 12, 2019
    e3161ac
  8. AutomatedOwl commented on Jun 5, 2019

    @AutomatedOwl

    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

  9. baev commented on Jun 5, 2019

    @baev
    Member

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions