Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [epsilon-dev] Tests in Jenkins

Hi all,

I have been working on this problem and there are several issues and challenges associated with making this work. I’ll try to point them out individually, if I can untangle the mess in my head.

1. Tycho surefire plugin. It seems that Tycho takes over the tests, which is good to run the plug-in tests. However, running the unit tests from within a nested eclipse fails due to discrepancies between versions of the compiled classes.
  - A workaround is to split the tests plugin into two, and have a separate tests.unit plugin which we use to run the tests. For pros/cons see points: 

2, Junit vs Maven. Making JUnit directly run the tests (i.e. mimicking what we do from Eclipse run configurations) is a PITA because it requires to setup the classpath. However, this has the advantage that the file access (for test models, metamodels and scripts) as currently done would work. Running the tests via maven we no longer have to worry about the class path. However, maven runs the tests from the compiled classes, which  means that file access has to be changed to access resources within classes.  In my proposed attempt I went with the mvn path (but has some side effects too).

3. The current file resolution approach woks as expected with scripts/models that import other models within JUnit because since we access files in the sources folder the paths to imported files work. When reading resources from classes this does not work.

4. Some HUTN tests expect the Family.ecore metramodel to be registered (I think), but it gets registered with the class resource path so then it can not be used… or something like that. Needs more investigation.

My ideas:

- As I said before I went via the maven approach and created a separate plugin for the unit tests.

- The FileUitl class has been modified to make use of temp files to create temp versions of the required models and scripts; it also respects the folder hierarchy so relative paths work . I have changed a lot of the tests to play nicely with this change. But the results tell me that there are still a couple of places where some missing imported or references models are missing. 

- The tests can be invoked using mvn surefire:test.  Explicit call to maven’s surefire needs to be done to avoid Tycho’s surefire. This command has to be executed after the main maven build has finished.

- There are several test that fail atm. Some because of assertions, other for missing files and other for the missing Families meta model. Further, I am always getting out of memory errors when some of the new tests try to start separate threads. I am using Xmx6166M and still getting this errors. More investigation needs to be done to see if the failing tests are because of actual errors or because as a result of issues on creating the temp files. These errors needs further investigation because  I think the results from the mvn run are different from the ones I get from running within eclipse.

- One of the effects of the change is that some tests fail from within eclipse with a Security exception caused by conflicts between hamcrest versions. I have tried to solve this issue by changing the import order of dependencies, changing where dependencies are imported, etc. and can’t figure out what else to do. I am not happy that we would always need to run the tests from the command line.

Any ideas or help on this is welcome. I have pushed this idea to hoyos/unittests

Cheers,


On 12 Jan 2019, at 16:16, Sina Madani <sinadoom@xxxxxxxxxxxxxx> wrote:

Hi Dimitris,
 
I think this is a great idea, and only discovered that EpsilonTestSuite was not run as part of mvn clean install recently. If we can guarantee that the tests will be run in a Unix environment then this would work. Currently there are a number of tests that fail on Windows and even under Linux due to the aforementioned file locations, permissions etc. Perhaps we could start with a smaller subset and gradually add the tests which are currently failing in certain circumstances once fixed? Also the Xmx needs to be adjusted to at least 4G (I think I may have already done this) to accommodate the full test suite.
 
Thanks,
Sina
_______________________________________________
epsilon-dev mailing list
epsilon-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/epsilon-dev



Back to the top