NetCal / DNC

The NetworkCalculus.org Deterministic Network Calculator
http://dnc.networkcalculus.org
GNU Lesser General Public License v2.1
25 stars 23 forks source link

Make main/tests transitive from DiscoDNC to dependent projects #17

Closed matyesz closed 6 years ago

matyesz commented 6 years ago

Tests should not be copied through dependent projects but should be available as a dependency.

sbondorf commented 6 years ago

The motivation for this is to solve NetCal/DiscoDNCext_MPARTC#6, I guess.

I do have another point in favor of this idea. We currently only provide tests for small networks that cover basic compositions of algebraic operations. For these networks, expected results were computed manually. In addition, I would like to add a set of tests consisting of larger, considerably more complex networks that test against the results of previous DiscoDNC versions. This is mostly targeted at testing tool feature (on contrast to DNC computations) such as convolution of alternative arrival bounds or a cache for intermediate results (see [1]). Yet, the networks used in [1] already come at a size of 37MB.

[1] Quality and Cost of Deterministic Network Calculus – Design and Evaluation of an Accurate and Fast Analysis (Steffen Bondorf, Paul Nikolaus, Jens B. Schmitt), In Proceedings of the ACM on Measurement and Analysis of Computing Systems (POMACS), ACM, volume 1, 2017.

matyesz commented 6 years ago

Let me clean the tests to use purely junit5. At the moment it is mixed with junit4 (suites like FF_tests that are not even ran during mvn test phase). First clean this up then add the transitivity. Even the surefire plugin must be used in a total different way when using junit 5 thus dependencies can be cleaned a bit more. https://junit.org/junit5/docs/current/user-guide/#running-tests-build-maven Still we have to keep the Suites, as this is the only possibility to run the test cases that are common in both projects without copying the full java package.

matyesz commented 6 years ago

//Pure junit5 test suite @ExtendWith(TestTimer.class) @SelectClasses({LinkedListTest_add.class, LinkedListTest_remove.class}) public class TestSuite

matyesz commented 6 years ago

Investigation done. Results: junit5 does not support test suites at the moment but junit4 launcher does not run junit5 annotated test cases. We have 2 possibilities:

  1. We create a test jar and add dependency to extension as mentioned above. In this case test classes will be visible but must be extended by a class to be ran. It is easy to implement but not too nice and we still will have duplicates.
  2. We create a multimodule project with one common test module. This way we can build and release the core and extensions together and run common tests on them stored in a separate module. As I se the tests are anyway rather integration tests than junit. Parent module
    • Core
    • Ext1
    • Ext2
    • Integration test As far as I managed to get into junit5 this is the recommended usage for integration tests. Suites are not really recommended as anyway maven runs all junit tests in a given project.

Parent module is not even needed, a separate it project would do it. What do you think?

sbondorf commented 6 years ago

If Maven's multi module capabilities automate assembly of Core and extensions in order to run the tests (that is how I understand it), I am in favor of this alternative. That will work with locally installed extensions as well, right? As the MPA RTC toolbox is not in the Maven Central Repository, we will not be able to push the extension there either.

matyesz commented 6 years ago

Yes, when maven does the build it will compile both core and extension then runs integration tests automatically. If mvn test is ran the same happens. You will also be able to build the projects separately with their own junit test in this case integration tests are not ran. It will if a parent pom is added and the test module is installed next to the extension. Core can remain just a dependency. We joust have to find out whether we will include an aggregator project (parent pom) or each developer must create their own one according to their project setup.

matyesz commented 6 years ago

Could you create repositories for tests and the parent?

sbondorf commented 6 years ago

Sure. https://github.com/NetCal/DiscoDNC_tests https://github.com/NetCal/DiscoDNC_meta (naming is inspired by linux distribution package naming)

sbondorf commented 6 years ago

Refactoring complete after these pull requests: https://github.com/NetCal/DiscoDNC/pull/19 https://github.com/NetCal/DiscoDNC_tests/pull/2 https://github.com/NetCal/DiscoDNCext_MPARTC/pull/7

sbondorf commented 6 years ago

There's still a branch called #17_make_tests_transitive. Can we delete it?

matyesz commented 6 years ago

Done.