Giter Site home page Giter Site logo

Comments (5)

krmahadevan avatar krmahadevan commented on June 12, 2024

@youming-lin - This seems to be a problem specific to TestNG eclipse plugin perhaps?

Can you please run the below sample and tell me what you see? I dont see issue that you are experiencing.

import org.testng.IInvokedMethod;
import org.testng.IInvokedMethodListener;
import org.testng.ITestResult;
import org.testng.TestNG;
import java.util.ArrayList;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;

public class IssueMain {

  public static void main(String[] args) {
    TestNG testng = new TestNG(false);
    testng.setTestClasses(new Class[]{TestNGEclipseIgnoreBugSample.class});
    InvokedMethodListener listener = new InvokedMethodListener();
    testng.addListener(listener);
    testng.run();
    assertThat(listener.invokedMethods).isEmpty();
  }

  public static class InvokedMethodListener implements IInvokedMethodListener {
    final List<String> invokedMethods = new ArrayList<>();

    @Override
    public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {
      invokedMethods.add(method.getTestMethod().getMethodName());
    }
  }
}

If the problem still exists when running via eclipse, then you should perhaps file this issue on https://github.com/testng-team/testng-eclipse

@missedone - FYI

from testng.

youming-lin avatar youming-lin commented on June 12, 2024

@krmahadevan Thanks for checking!
I created a new project with just this test class and cannot reproduce this any more (neither running mvn test nor through TestNG Eclipse plugin). Not sure what is going with the original project's configuration.

from testng.

ramtech123 avatar ramtech123 commented on June 12, 2024

I have same issue with @ignore annotation, individual tests are disabled only when using enabled = false.

  • Gradle 7.6,
  • Verified with different versions of testng
    -- 7.5.1 and 7.8.0 - @Ignore annotation at method level is not working in both cases
    -- 7.4.0 - @Ignore annotation disables the test, as expected.

(PS: not using eclipse)

Was there any issue / resolution that was identified? Thanks

from testng.

krmahadevan avatar krmahadevan commented on June 12, 2024

@ramtech123 - Please share a sample project that can be used to reproduce the problem

from testng.

ramtech123 avatar ramtech123 commented on June 12, 2024

It is working fine with a plain vanilla gradle project. Need to figure out the difference with my main project as the latter has some additional configurations. Will try to get a reproducer in a few days. Thanks.

from testng.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.