TelluIoT / ThingML

The ThingML modelling language
https://github.com/TelluIoT/ThingML
Apache License 2.0
101 stars 32 forks source link

How to run the tests ? #259

Closed fungiboletus closed 5 years ago

fungiboletus commented 5 years ago

I'm working on #258 and I would like to run the tests for the NodeJS compiler on my machine.

However I have no idea about how to run the tests. I tried a mvn clean install in the ./testing directory and it failed after 30s.

brice-morin commented 5 years ago

OK, first pull my latest changes. I removed Integer some time ago because it is ambiguous (compared to e.g. Int16), but it was quite intensively used in the tests...

you may have to mvn clean install in ./testing/framework and ./testing/reportbuilder first, then mvn clean install in ./testing

brice-morin commented 5 years ago

Also, it is possible to just run the nodejs tests, but I do not remember how...

brice-morin commented 5 years ago

or in Eclipse, right click on testing project,-> run as JUnit

fungiboletus commented 5 years ago

cd ./testing/framework && mvn clean install

Failed to execute goal on project testing.framework: Could not resolve dependencies for project org.thingml:testing.framework:jar:2.0.0-SNAPSHOT: Failed to collect dependencies at org.thingml:compilers.framework:jar:2.0.0-SNAPSHOT -> org.thingml:thingml:jar:2.0.0-SNAPSHOT: Failed to read artifact descriptor for org.thingml:thingml:jar:2.0.0-SNAPSHOT: Could not find artifact org.thingml:language:pom:2.0.0-SNAPSHOT in thingml-snapshot (http://maven.thingml.org/thingml-snapshot/) -> [Help 1]

brice-morin commented 5 years ago

Hmmm...

Did you mvn clean install at the root first?

fungiboletus commented 5 years ago

I did yesterday, but I just did it again to make sure and it doesn't help.

brice-morin commented 5 years ago

Hmmm...

Try also cd language && mvn clean install

fungiboletus commented 5 years ago

After hours minutes of fetching eclipse 50kb .jar dependencies from the slowest university servers ever it finally failed :

[INFO] Reactor Summary:
[INFO]
[INFO] ThingML :: Language 2.0.0-SNAPSHOT ................. SUCCESS [  0.602 s]
[INFO] ThingML :: Language :: Model ....................... SUCCESS [01:00 min]
[INFO] ThingML :: Language :: Eclipse :: IDE .............. SUCCESS [  7.695 s]
[INFO] ThingML :: Language :: Eclipse :: UI ............... SUCCESS [  7.720 s]
[INFO] ThingML :: Language :: Editor :: Web ............... SUCCESS [ 44.883 s]
[INFO] ThingML :: Language :: Eclipse :: Target ........... SUCCESS [  0.128 s]
[INFO] ThingML :: Language :: Eclipse :: Feature .......... SUCCESS [  0.870 s]
[INFO] ThingML :: Language :: Eclipse :: Repository ....... SUCCESS [  2.409 s]
[INFO] ThingML :: Language :: Tests ....................... FAILURE [  6.108 s]
[INFO] ThingML :: Language :: Eclipse :: UI :: Tests 2.0.0-SNAPSHOT SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18:35 min
[INFO] Finished at: 2018-11-14T10:21:54+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:1.2.0:test (default-test) on project thingml.tests: An unexpected error occured while launching the test runtime (return code 13).
fungiboletus commented 5 years ago

Ok Interestingly even though Language::Tests failed to build I can now build and run the tests.

There are test failures. it said. My computer spent more CPU cycles to display the errors and exceptions in the shitty terminal than computing the tests.

Tests run: 979, Failures: 434, Errors: 0, Skipped: 545 I can't believe all the tests are wrong.

brice-morin commented 5 years ago

well, the errors when compiling language are indeed not an issue (or at least not a blocking one).

As for the tests themselves, all the tests for which you have the proper setup to run the generated code (e.g. node and npm for NodeJS) should run (the other should be skipped (probably posix, posixmt and go in your case?). Still, most nodejs tests should pass.... Not quite sure what is wrong, thoug... Is there some useful information from the errors and exceptions being displayed in you terminal?

fungiboletus commented 5 years ago

Yes, posix and go are skipped. I probably don't have enough storage on my laptop to store the error log. I can't see anything in the terminal history, but this one is quite short. I might try again if I found it the alternative to tee in powershell and buy a 2TB SSD.

fungiboletus commented 5 years ago

So the powershell equivalent to tee is tee. Example : mvn clean install | tee -filepath bigdata.log.

Using the latest version, by pulling and not fetching (fuck this fetch button on my Git GUI, so stupid), it runs. A few NodeJS tests fails, but that's expected I guess.

fungiboletus commented 5 years ago

I also decided to ignore the many Timeout while executing 'mvn exec:java' because maven is so slow that it's not relevant.