Skip to content

The constructor of TestRunner encountered NBC changes in 7.8.0 #2928

Closed

Description

@Hkh9966

TestNG Version 7.8.0

Note: only the latest version is supported

When our project upgraded to version 7.8.0 and found that the TestRunner constructor had been changed, we thought it was an NBC change and would bring us a lot of changes.

Expected behavior

Keep the original constructor and add a new method if there are new requirements.

Actual behavior

The original constructor method has been modified.

Is the issue reproducible on runner?

  • Shell
  • Maven
  • Gradle
  • Ant
  • Eclipse
  • IntelliJ
  • NetBeans

Test case sample

Please, share the test case (as small as possible) which shows the issue

Contribution guidelines

Incase you plan to raise a pull request to fix this issue, please make sure you refer our Contributing section for detailed set of steps.

Activity

  1. juherr commented on Jun 30, 2023

    @juherr
    Member

    I agree it is a breaking change but I don't understand what is difficult to change on your side.
    Could you explain what is your use case?

  2. added
    aspect: regressionWorked in an earlier version and is now broken
    runner: customCustom or programmatic TestNG runner
    on Jun 30, 2023
  3. Hkh9966 commented on Jul 3, 2023

    @Hkh9966
    Author

    Previously, I need to create a custom SuiteRunner instance in my project, and I implemented ITestRunnerFactory to customize how TestRunner is implemented:

      SuiteRunner baseSuiteRunner = new SuiteRunner(configuration, suite,
                    "outputDir",
                    new ITestRunnerFactory() {
    
                        @Override
                        public TestRunner newTestRunner(ISuite suite, XmlTest xmlTest,
                                                        Collection<IInvokedMethodListener> listeners, List<IClassListener> classListeners) {
                            TestRunner runner =
                                    new TestRunner(configuration, suite, xmlTest,
                                            false,
                                            listeners, classListeners);
      //...
                            return runner;
                        }
    
                    },
                    xxx,
                   xxx);
    

    But now the TestRunner constructor needs to fill in an instance of SuiteRunner.

  4. added a commit that references this issue on Jul 14, 2023
    a08359c
  5. added a commit that references this issue on Jul 14, 2023
    7dc15af
  6. added this to the 7.9.0 milestone on Jul 14, 2023
  7. added
    type: bugReported behavior that differs from the intended behavior
    on Sep 2, 2026
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

    aspect: regressionWorked in an earlier version and is now brokenrunner: customCustom or programmatic TestNG runnertype: bugReported behavior that differs from the intended behavior

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions