Hi all,

I am running the tests with "mvn clean install -Pkres" and I have too
issues (most likely related):

- they need internet access: this means they will randomly fail if the
remote resources are not available (network is down, remote server is
down, ...)
- some of them are much too slow: to ensuite people will regularly run
the tests before checking in changes into the

We should make each test take less than a couple of seconds to run and
avoid the network connection requirement.

The slow / internet tests are in ontonet and the rule manager.

For instance:

Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 248.584 sec
Running org.apache.stanbol.ontologymanager.ontonet.ontology.TestIndexing
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 245.178 sec
Running org.apache.stanbol.ontologymanager.ontonet.ontology.TestOntologySpaces
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 48.027 sec

Running org.apache.stanbol.rules.manager.LoadRuleFileTest
http://kres.iks-project.eu/ontology/meta/rmi.owl#
106 121 106 121
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 38.346 sec
Running org.apache.stanbol.rules.manager.RemoveRecipeTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 42.226 sec
Running org.apache.stanbol.rules.manager.RemoveRuleTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 45.052 sec
Running org.apache.stanbol.rules.manager.GetRuleTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 97.485 sec
Running org.apache.stanbol.rules.manager.AddRecipeTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 109.664 sec
Running org.apache.stanbol.rules.manager.AddRuleTest
entriamo http://kres.iks-project.eu/ontology/meta/rmi.owl#MyRuleA
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 80.977 sec
Running org.apache.stanbol.rules.manager.GetRecipeTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 37.492 sec
Running org.apache.stanbol.rules.manager.RuleStoreTest

Possible solutions:

- make the rule engine have an offline mode where all the necessary
resources are preloaded from local resources included in the
src/test/resources folder of the project.

- change the ONManager tests to feature an offline mode where all
loaded ontology definitions are coming from local resources (e.g. in
src/test/resources).

- alternatively, use a mock network resource using one of the numerous
mock system to simulate network resources without downloading them.
This solution is less than optimal though: the rule manager has to be
fast in production, and should not relying on slow downloads anyway:
the default settings should be to use only locally pre-cached /
pre-loaded resources and only download missing resources on explicit
user requests rather than trying to do it automagically in the
background and randomly fail if the network is too slow.

- in the short term: exclude those tests from the automated surefire
test suite [1]

[1] 
http://maven.apache.org/plugins/maven-surefire-plugin/examples/inclusion-exclusion.html

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

Reply via email to