How to run junit test suite in Tycho #953
Replies: 5 comments
-
I see no obvious reason why it should not work, but fear you better provide a small reproducer project for more information or help what could be wrong. |
Beta Was this translation helpful? Give feedback.
-
a simple setup with test execution can be found here: https://github.com/eclipse/tycho/tree/master/demo/itp01 |
Beta Was this translation helpful? Give feedback.
-
Many thanks for your comments and I am sorry for my very late answer. Back to topic: |
Beta Was this translation helpful? Give feedback.
-
First of all: I was not able to solve my problem although I think I made some progress. Repeat of what I want: The first problem was that as soon tycho-surefire-plugin detected a test fragment it startet to execute the tests contained. Now the test fragments are compiling! First step done. The problem is now that my main test plugin fails to compile because of missing dependencies. but as soon as I add the fragments here, the build is complaining that the host plugins are missing. This approach I found e.g. here https://stackoverflow.com/questions/45190063/add-fragment-to-tycho-surefire-plugin#45190630 and here But in general: I have plugins with fragments. The unit tests are contained within the fragments. In the meantime I stumbled across this stackOverflow entry: In addition I followed this one (the section on eclipse-test-plugin packaging) I will now tests this on my huge project and we will see. Two questions are remaining:
I hope this will help somebody in the future and avoids reading and searching as much as I needed to do. :-) |
Beta Was this translation helpful? Give feedback.
-
I stumble over another problem. I tried several approaches only one of them worked. Let me explain what I tried so far (all is included in the project here: https://github.com/Monstereye/tycho-test-example.git ) Second I tried the following
The problem with the approach in 4. is that the target file is a targlet generated via oomph. Is there somebody how may have some time to look at my simple test project and find out why tycho-surefire is not able to resolve mockito? Any help is highly appreciated! |
Beta Was this translation helpful? Give feedback.
-
Hello
To be hones I don't know if this is the right place to ask my question. If not the just tell me and/or delete the discussion.
I have a rather huge eclipse rcp project which recently migrated to a maven tycho based build. All works fine except of our unit tests.
The tests ar, up to now, organised in a way that each plugin has its own test fragment.
Within each test fragment is a test suite that "collects" all the tests.
Above all is a "main" test plugin that has a test suite consisting of all the other test suites (which then containing the tests itselfs).
My problem is now that I don't understand how to run a setup like this?
What is now the best concept to let the unit tests run?
Maven surefire itself is not working because dependency resolution has to be done via manifest.mf and tycho.
Using tycho-surerfire is also not possible/"needed" because I don't need an OSGI runtime for the tests (so far at least) and if I try to let it run as such the OSGI runtime is crashing with missing dependencies.
Is this maybe an option? : https://github.com/eclipse/tycho/blob/master/RELEASE_NOTES.md#execute-unit-tests-with-eclipse-plugin-packaging
If so then I do something wrong:
I add the fragments as a module inside of pom.
Then I did exactly (hopefully correct :-) ) what is described there.
Problem is that the tests are not running. There is no surefire report.
Am I do something wrong?
What is the best concept to have unit tests in fragments?
If the concept with the test suites is not good for maven approach then this is no problem at all.
This is quickly removed.
To be honest I thought having tests in a separate fragment is rather a standard for eclipse rcp applications? (If not please correct me :-))
I was surprised to not find any examples how to setup such an approach.
Therefore my questions here.
I added my pom as text file (and removed the modules because I wanted to concentrate on the configuration.
It's a text file because uploading a xml file was restricted.
pom.txt
If there is any information missing you might want to have to be able to answer my question please tell me.
Hoping for an answer and many many thanks in advance
Sebastian Heinrich
Beta Was this translation helpful? Give feedback.
All reactions