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

Allow a subset of tests to not have all of the requirements defined #82

Open
cawallin opened this issue Dec 14, 2015 · 3 comments
Open

Comments

@cawallin
Copy link
Member

If you specify a requirement for one test file, all other tests will have those requirements fulfilled as well. If you want to specifically write a test without that requirement, the test will work if you run it individually, but not if you run the whole suite.

You could solve this issue by having another test suite, but if you start getting a lot of interdependencies, it would start getting complicated (and you'd have a lot of test suites).

@kokosing
Copy link
Contributor

Does setting requirements per each test individually solve this? Can you write how you would like to set the requirements to tests to solve your issue? Because, as I understand your problem, such code as below is handling your case:

class Test extends ProductTest {
  @Requires(SomeRequirement.class)
  public void testOne() {
    ...
  }

  public void testTwo() {
    ...
  }
}

So testTwo is running with no requirements fulfilled.

@cawallin
Copy link
Member Author

Hmm, when I had two different test classes, all of the TD foreign servers were loaded for each of the classes (even those classes that weren't annotated with @requires(SomeForeignServers)). Is that expected?

@kokosing
Copy link
Contributor

As I understand ForeignServers are requirements for custom fulfiller and this fulfiller has to be executed on suite level (like immutable table fulfiller) and so it is executed before all tests for requirements from all tests. Because of that tests which does not need SomeForeignServers will have them created.

So this is kind of a conflicting requirements a feature that is not yet supported. That two tests require two different things where one cannot exists together with the other. Here one test requires to have SomeForeignServers always created, the other requires SomeForeignServers to be not created.

Other option would be to change the fulfiller to work on a test level, then each requirements will be fulfilled before each test, but as I understand will make running tests much much longer.

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