You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by Reto Bachmann-Gmür <re...@apache.org> on 2012/09/23 13:01:15 UTC

failing build because CELI NER test cannot reach external server

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:2.11:test (default-test) on
project org.apache.stanbol.enhancer.engines.celi: There are test failures.

The cause of the error is:
org.apache.stanbol.enhancer.servicesapi.EngineException: Error while
calling the CELI NER (Named Entity Recognition) service (configured URL:
http://linguagrid.org/LSGrid/ws/com.celi-france.linguagrid.namedentityrecognition.v0u0.demo
)!
    at
org.apache.stanbol.enhancer.engines.celi.ner.impl.CeliNamedEntityExtractionEnhancementEngine.computeEnhancements(CeliNamedEntityExtractionEnhancementEngine.java:285)


I think the tests shold not access external services.

Cheers,
Reto

Re: failing build because CELI NER test cannot reach external server

Posted by Rupert Westenthaler <ru...@gmail.com>.
Hi,

Since http://svn.apache.org/r1501224 FileNotFoundExceptions cause
Tests to be skipped.

best
Rupert


On Tue, Jul 9, 2013 at 1:39 PM, Rupert Westenthaler
<ru...@gmail.com> wrote:
> On Mon, Jul 8, 2013 at 6:53 PM, Reto Bachmann-Gmür <re...@wymiwyg.com> wrote:
>> I think the build is failing again because of
>> http://www.linguagrid.org/LSGrid/ws/morpho-analyser 404s.
>>
>
> True. Normally the test should be skipped in such cases, but
> HttpUrlConnection does throw an FileNotFoundExceptions and this is not
> included in the list of cases that trigger the skipping of a test
> depending on a remote service.
>
> I will check with the Documentation of HttpUrlConnection and if it
> says that FileNotFoundExceptions  can indicate unavailable web
> services I will adopt the code accordingly.
>
> best
> Rupert
>
>> Cheers,
>> Reto
>>
>> On Tue, Sep 25, 2012 at 11:32 AM, Bertrand Delacretaz
>> <bd...@apache.org> wrote:
>>> On Tue, Sep 25, 2012 at 11:18 AM, Fabian Christ
>>> <ch...@googlemail.com> wrote:
>>>>... Maybe, we could mark those unit tests that access external resources
>>>> with some annotation that says: This unit test accesses an online
>>>> resource. Via some switch all those tests could be disabled if
>>>> desired....
>>>
>>> Yes, you could use the JUnit 4.8 Categories feature for that.
>>>
>>> -Bertrand
>
>
>
> --
> | Rupert Westenthaler             rupert.westenthaler@gmail.com
> | Bodenlehenstraße 11                             ++43-699-11108907
> | A-5500 Bischofshofen



-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: failing build because CELI NER test cannot reach external server

Posted by Rupert Westenthaler <ru...@gmail.com>.
On Mon, Jul 8, 2013 at 6:53 PM, Reto Bachmann-Gmür <re...@wymiwyg.com> wrote:
> I think the build is failing again because of
> http://www.linguagrid.org/LSGrid/ws/morpho-analyser 404s.
>

True. Normally the test should be skipped in such cases, but
HttpUrlConnection does throw an FileNotFoundExceptions and this is not
included in the list of cases that trigger the skipping of a test
depending on a remote service.

I will check with the Documentation of HttpUrlConnection and if it
says that FileNotFoundExceptions  can indicate unavailable web
services I will adopt the code accordingly.

best
Rupert

> Cheers,
> Reto
>
> On Tue, Sep 25, 2012 at 11:32 AM, Bertrand Delacretaz
> <bd...@apache.org> wrote:
>> On Tue, Sep 25, 2012 at 11:18 AM, Fabian Christ
>> <ch...@googlemail.com> wrote:
>>>... Maybe, we could mark those unit tests that access external resources
>>> with some annotation that says: This unit test accesses an online
>>> resource. Via some switch all those tests could be disabled if
>>> desired....
>>
>> Yes, you could use the JUnit 4.8 Categories feature for that.
>>
>> -Bertrand



--
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: failing build because CELI NER test cannot reach external server

Posted by Reto Bachmann-Gmür <re...@wymiwyg.com>.
I think the build is failing again because of
http://www.linguagrid.org/LSGrid/ws/morpho-analyser 404s.

Cheers,
Reto

On Tue, Sep 25, 2012 at 11:32 AM, Bertrand Delacretaz
<bd...@apache.org> wrote:
> On Tue, Sep 25, 2012 at 11:18 AM, Fabian Christ
> <ch...@googlemail.com> wrote:
>>... Maybe, we could mark those unit tests that access external resources
>> with some annotation that says: This unit test accesses an online
>> resource. Via some switch all those tests could be disabled if
>> desired....
>
> Yes, you could use the JUnit 4.8 Categories feature for that.
>
> -Bertrand

Re: failing build because CELI NER test cannot reach external server

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Tue, Sep 25, 2012 at 11:18 AM, Fabian Christ
<ch...@googlemail.com> wrote:
>... Maybe, we could mark those unit tests that access external resources
> with some annotation that says: This unit test accesses an online
> resource. Via some switch all those tests could be disabled if
> desired....

Yes, you could use the JUnit 4.8 Categories feature for that.

-Bertrand

Re: failing build because CELI NER test cannot reach external server

Posted by Fabian Christ <ch...@googlemail.com>.
Hi,

I think the point why such tests are unit tests is because those tests
do not require a running Stanbol instance. At the moment
integration-tests are executed against a running Stanbol server. But
what should we do with tests that access external resources but do not
need Stanbol?

Maybe, we could mark those unit tests that access external resources
with some annotation that says: This unit test accesses an online
resource. Via some switch all those tests could be disabled if
desired.

Best,
 - Fabian

2012/9/25 Bertrand Delacretaz <bd...@apache.org>:
> On Tue, Sep 25, 2012 at 10:09 AM, Fabian Christ
> <ch...@googlemail.com> wrote:
>> ...why not handle all unit tests that access external services as
>> integration-tests? IMHO these are no unit tests anymore if they access
>> an external resource. So migrating them to integration-tests would be
>> solution....
>
> +1, having unit tests that timeout on connections or fail silently
> because an external service is not there is not good.
>
> Maybe we need three types of tests:
> 1) Unit tests - quick, no external connections
> 2) Integration tests in offline mode
> 3) Integration tests in online mode, activated by a Maven profile or -Dproperty
>
> -Bertrand



-- 
Fabian
http://twitter.com/fctwitt

Re: failing build because CELI NER test cannot reach external server

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Tue, Sep 25, 2012 at 10:09 AM, Fabian Christ
<ch...@googlemail.com> wrote:
> ...why not handle all unit tests that access external services as
> integration-tests? IMHO these are no unit tests anymore if they access
> an external resource. So migrating them to integration-tests would be
> solution....

+1, having unit tests that timeout on connections or fail silently
because an external service is not there is not good.

Maybe we need three types of tests:
1) Unit tests - quick, no external connections
2) Integration tests in offline mode
3) Integration tests in online mode, activated by a Maven profile or -Dproperty

-Bertrand

Re: failing build because CELI NER test cannot reach external server

Posted by Fabian Christ <ch...@googlemail.com>.
Hi,

why not handle all unit tests that access external services as
integration-tests? IMHO these are no unit tests anymore if they access
an external resource. So migrating them to integration-tests would be
solution.

Best,
 - Fabian

2012/9/25 Rupert Westenthaler <ru...@gmail.com>:
> Hi,
>
> I can confirm that
>
> 1. the Integration tests do run in OfflineMode
> 2. that the CELI engines do support OfflineMode and therefore
> deactivate themselves if stanbol is started in OfflineMode
>
> For Unit Tests it is a real dilemma because on the one hand failing
> tests because of non-functional (or non reachable) external services
> are inconvenient on the other hand without running those tests with
> normal tests there is a good change that we will miss API (and data
> changes) of those external Services. E.g. some time ago the confidence
> values provided by geoname.org changed from [0..1] to [0..*]. This
> would have been not detected without running the those test with every
> build.
>
> So what I typically do is to catch IOExceptions that typically result
> of unreachable (or timed out) calls to external services. This ensures
> that test do not fail if the external service is down - or the
> developer does not have a internet connection while still ensuring
> that the Stanbol Engines are validated against the external services
> with every build.
>
> I will have a look what kind of Exception caused the failed build and
> make sure that those do cause tests to be skipped for future builds.
>
> WDYT
> Rupert
>
> On Mon, Sep 24, 2012 at 2:28 PM, Reto Bachmann-Gmür <re...@wymiwyg.com> wrote:
>> On Mon, Sep 24, 2012 at 1:37 PM, Bertrand Delacretaz <bdelacretaz@apache.org
>>> wrote:
>>
>>> On Mon, Sep 24, 2012 at 12:19 PM, Reto Bachmann-Gmür <re...@apache.org>
>>> wrote:
>>> > On Mon, Sep 24, 2012 at 8:54 AM, Bertrand Delacretaz <
>>> bdelacretaz@apache.org
>>> >> On Sunday, September 23, 2012, Reto Bachmann-Gmür wrote:
>>> >> > ...I think the tests shold not access external services...
>>> >> Yes - there's OfflineMode for that.
>>> >>
>>> > ...The offline mode is for not updating libraries from the remote repos.
>>> If I
>>> > have the libraries in the local repository I can use the offline mode. If
>>> > tests are skipped in offline mode this means that some projects might
>>> buil
>>> > with -o and fail otherwise...
>>>
>>> Sorry I was too terse maybe, didn't mean maven's offline mode, but the
>>> STANBOL-86 OfflineMode service, which allows you to modify your
>>> service's behavior when the system should not make any external
>>> requests, which IMO is needed when running our automated tests.
>>>
>>
>> The test that was failing was a unit tests that doesn't use OSGi and thus
>> couldn't use STANBOL-86.
>>
>> For the integration tests STANBOL-86 seems a good approach. If understand
>> STANBOL-87 <https://issues.apache.org/jira/browse/STANBOL-87> correctly the
>> integrations tests are always run in offline mode. I think the unit tests
>> should always be offline while for the integration tests it might be good
>> to have the options to check if things integrate with the outside world.
>>
>> Cheers,
>> Reto
>>
>>
>>> -Bertrand
>>>
>
>
>
> --
> | Rupert Westenthaler             rupert.westenthaler@gmail.com
> | Bodenlehenstraße 11                             ++43-699-11108907
> | A-5500 Bischofshofen



-- 
Fabian
http://twitter.com/fctwitt

Re: failing build because CELI NER test cannot reach external server

Posted by Rupert Westenthaler <ru...@gmail.com>.
Hi,

I can confirm that

1. the Integration tests do run in OfflineMode
2. that the CELI engines do support OfflineMode and therefore
deactivate themselves if stanbol is started in OfflineMode

For Unit Tests it is a real dilemma because on the one hand failing
tests because of non-functional (or non reachable) external services
are inconvenient on the other hand without running those tests with
normal tests there is a good change that we will miss API (and data
changes) of those external Services. E.g. some time ago the confidence
values provided by geoname.org changed from [0..1] to [0..*]. This
would have been not detected without running the those test with every
build.

So what I typically do is to catch IOExceptions that typically result
of unreachable (or timed out) calls to external services. This ensures
that test do not fail if the external service is down - or the
developer does not have a internet connection while still ensuring
that the Stanbol Engines are validated against the external services
with every build.

I will have a look what kind of Exception caused the failed build and
make sure that those do cause tests to be skipped for future builds.

WDYT
Rupert

On Mon, Sep 24, 2012 at 2:28 PM, Reto Bachmann-Gmür <re...@wymiwyg.com> wrote:
> On Mon, Sep 24, 2012 at 1:37 PM, Bertrand Delacretaz <bdelacretaz@apache.org
>> wrote:
>
>> On Mon, Sep 24, 2012 at 12:19 PM, Reto Bachmann-Gmür <re...@apache.org>
>> wrote:
>> > On Mon, Sep 24, 2012 at 8:54 AM, Bertrand Delacretaz <
>> bdelacretaz@apache.org
>> >> On Sunday, September 23, 2012, Reto Bachmann-Gmür wrote:
>> >> > ...I think the tests shold not access external services...
>> >> Yes - there's OfflineMode for that.
>> >>
>> > ...The offline mode is for not updating libraries from the remote repos.
>> If I
>> > have the libraries in the local repository I can use the offline mode. If
>> > tests are skipped in offline mode this means that some projects might
>> buil
>> > with -o and fail otherwise...
>>
>> Sorry I was too terse maybe, didn't mean maven's offline mode, but the
>> STANBOL-86 OfflineMode service, which allows you to modify your
>> service's behavior when the system should not make any external
>> requests, which IMO is needed when running our automated tests.
>>
>
> The test that was failing was a unit tests that doesn't use OSGi and thus
> couldn't use STANBOL-86.
>
> For the integration tests STANBOL-86 seems a good approach. If understand
> STANBOL-87 <https://issues.apache.org/jira/browse/STANBOL-87> correctly the
> integrations tests are always run in offline mode. I think the unit tests
> should always be offline while for the integration tests it might be good
> to have the options to check if things integrate with the outside world.
>
> Cheers,
> Reto
>
>
>> -Bertrand
>>



-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: failing build because CELI NER test cannot reach external server

Posted by Reto Bachmann-Gmür <re...@wymiwyg.com>.
On Mon, Sep 24, 2012 at 1:37 PM, Bertrand Delacretaz <bdelacretaz@apache.org
> wrote:

> On Mon, Sep 24, 2012 at 12:19 PM, Reto Bachmann-Gmür <re...@apache.org>
> wrote:
> > On Mon, Sep 24, 2012 at 8:54 AM, Bertrand Delacretaz <
> bdelacretaz@apache.org
> >> On Sunday, September 23, 2012, Reto Bachmann-Gmür wrote:
> >> > ...I think the tests shold not access external services...
> >> Yes - there's OfflineMode for that.
> >>
> > ...The offline mode is for not updating libraries from the remote repos.
> If I
> > have the libraries in the local repository I can use the offline mode. If
> > tests are skipped in offline mode this means that some projects might
> buil
> > with -o and fail otherwise...
>
> Sorry I was too terse maybe, didn't mean maven's offline mode, but the
> STANBOL-86 OfflineMode service, which allows you to modify your
> service's behavior when the system should not make any external
> requests, which IMO is needed when running our automated tests.
>

The test that was failing was a unit tests that doesn't use OSGi and thus
couldn't use STANBOL-86.

For the integration tests STANBOL-86 seems a good approach. If understand
STANBOL-87 <https://issues.apache.org/jira/browse/STANBOL-87> correctly the
integrations tests are always run in offline mode. I think the unit tests
should always be offline while for the integration tests it might be good
to have the options to check if things integrate with the outside world.

Cheers,
Reto


> -Bertrand
>

Re: failing build because CELI NER test cannot reach external server

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Mon, Sep 24, 2012 at 12:19 PM, Reto Bachmann-Gmür <re...@apache.org> wrote:
> On Mon, Sep 24, 2012 at 8:54 AM, Bertrand Delacretaz <bdelacretaz@apache.org
>> On Sunday, September 23, 2012, Reto Bachmann-Gmür wrote:
>> > ...I think the tests shold not access external services...
>> Yes - there's OfflineMode for that.
>>
> ...The offline mode is for not updating libraries from the remote repos. If I
> have the libraries in the local repository I can use the offline mode. If
> tests are skipped in offline mode this means that some projects might buil
> with -o and fail otherwise...

Sorry I was too terse maybe, didn't mean maven's offline mode, but the
STANBOL-86 OfflineMode service, which allows you to modify your
service's behavior when the system should not make any external
requests, which IMO is needed when running our automated tests.

-Bertrand

Re: failing build because CELI NER test cannot reach external server

Posted by Alessio Bosca <al...@celi.it>.
Hi,

thanks for the info. I'll investigate about that

Bests
     Alessio

On 09/24/2012 01:35 PM, Fabian Christ wrote:
> Hi,
>
> I think what Bertrand meant was, that we have a mechanism to declare
> integration tests as online or offline mode tests. I do not know the
> details right now, but I think there is a flag to disable online
> tests.
>
> IIRC that's independent of the Maven offline mode.
>
> Best,
>   - Fabian
>
> 2012/9/24 Alessio Bosca <al...@celi.it>:
>> Dear Reto and all,
>>
>> sorry for the inconvenience. The server hosting our web services crashed and
>> our backup mechanism failed in automatically detecting the problem and
>> restarting the server.
>> Now CELI services are on line and working again; I just run the tests of
>> CELI enhancement engines on my machine and they passed.
>>
>> Concerning the discussion about accessing external services during the
>> tests, if you prefer I could remove the actual access to CELI services from
>> the code. In the tests  the interaction with the service can be substituted
>> with a resource (a file) containing a serialization of the service response.
>> However this tests will not guarantee that the services are actually
>> working.. Do you have any suggestion on how solving this issue?
>>
>> Bests
>>      Alessio
>>
>>
>>
>>
>> On 09/24/2012 12:19 PM, Reto Bachmann-Gmür wrote:
>>> On Mon, Sep 24, 2012 at 8:54 AM, Bertrand Delacretaz
>>> <bdelacretaz@apache.org
>>>> wrote:
>>>> On Sunday, September 23, 2012, Reto Bachmann-Gmür wrote:
>>>>
>>>>> ...I think the tests shold not access external services...
>>>> Yes - there's OfflineMode for that.
>>>>
>>> The offline mode is for not updating libraries from the remote repos. If I
>>> have the libraries in the local repository I can use the offline mode. If
>>> tests are skipped in offline mode this means that some projects might buil
>>> with -o and fail otherwise. I think this shouldn't be the case, a built
>>> should be tested in offline mode with the same accuracy. Besides I'm not
>>> sure how tests could check if maven is run in offline mode, the cedi tests
>>> also fail independently if the maven built is run offline or online.
>>>
>>>
>>> Reto
>>>
>>
>> --
>> *************************************
>> Alessio Bosca, Ph.D.
>> CELI s.r.l.
>> Via San Quintino 31
>> 10121 Torino
>> Tel. +39 011.562.71.15
>> Fax +39 011.506.40.86
>> http://www.celi.it
>> *************************************
>>
>>
>
>


-- 
*************************************
Alessio Bosca, Ph.D.
CELI s.r.l.
Via San Quintino 31
10121 Torino
Tel. +39 011.562.71.15
Fax +39 011.506.40.86
http://www.celi.it
*************************************



Re: failing build because CELI NER test cannot reach external server

Posted by Fabian Christ <ch...@googlemail.com>.
Hi,

I think what Bertrand meant was, that we have a mechanism to declare
integration tests as online or offline mode tests. I do not know the
details right now, but I think there is a flag to disable online
tests.

IIRC that's independent of the Maven offline mode.

Best,
 - Fabian

2012/9/24 Alessio Bosca <al...@celi.it>:
> Dear Reto and all,
>
> sorry for the inconvenience. The server hosting our web services crashed and
> our backup mechanism failed in automatically detecting the problem and
> restarting the server.
> Now CELI services are on line and working again; I just run the tests of
> CELI enhancement engines on my machine and they passed.
>
> Concerning the discussion about accessing external services during the
> tests, if you prefer I could remove the actual access to CELI services from
> the code. In the tests  the interaction with the service can be substituted
> with a resource (a file) containing a serialization of the service response.
> However this tests will not guarantee that the services are actually
> working.. Do you have any suggestion on how solving this issue?
>
> Bests
>     Alessio
>
>
>
>
> On 09/24/2012 12:19 PM, Reto Bachmann-Gmür wrote:
>>
>> On Mon, Sep 24, 2012 at 8:54 AM, Bertrand Delacretaz
>> <bdelacretaz@apache.org
>>>
>>> wrote:
>>> On Sunday, September 23, 2012, Reto Bachmann-Gmür wrote:
>>>
>>>> ...I think the tests shold not access external services...
>>>
>>> Yes - there's OfflineMode for that.
>>>
>> The offline mode is for not updating libraries from the remote repos. If I
>> have the libraries in the local repository I can use the offline mode. If
>> tests are skipped in offline mode this means that some projects might buil
>> with -o and fail otherwise. I think this shouldn't be the case, a built
>> should be tested in offline mode with the same accuracy. Besides I'm not
>> sure how tests could check if maven is run in offline mode, the cedi tests
>> also fail independently if the maven built is run offline or online.
>>
>>
>> Reto
>>
>
>
> --
> *************************************
> Alessio Bosca, Ph.D.
> CELI s.r.l.
> Via San Quintino 31
> 10121 Torino
> Tel. +39 011.562.71.15
> Fax +39 011.506.40.86
> http://www.celi.it
> *************************************
>
>



-- 
Fabian
http://twitter.com/fctwitt

Re: failing build because CELI NER test cannot reach external server

Posted by Alessio Bosca <al...@celi.it>.
Dear Reto and all,

sorry for the inconvenience. The server hosting our web services crashed 
and our backup mechanism failed in automatically detecting the problem 
and restarting the server.
Now CELI services are on line and working again; I just run the tests 
of  CELI enhancement engines on my machine and they passed.

Concerning the discussion about accessing external services during the 
tests, if you prefer I could remove the actual access to CELI services 
from the code. In the tests  the interaction with the service can be 
substituted with a resource (a file) containing a serialization of the 
service response.
However this tests will not guarantee that the services are actually 
working.. Do you have any suggestion on how solving this issue?

Bests
     Alessio



On 09/24/2012 12:19 PM, Reto Bachmann-Gmür wrote:
> On Mon, Sep 24, 2012 at 8:54 AM, Bertrand Delacretaz <bdelacretaz@apache.org
>> wrote:
>> On Sunday, September 23, 2012, Reto Bachmann-Gmür wrote:
>>
>>> ...I think the tests shold not access external services...
>> Yes - there's OfflineMode for that.
>>
> The offline mode is for not updating libraries from the remote repos. If I
> have the libraries in the local repository I can use the offline mode. If
> tests are skipped in offline mode this means that some projects might buil
> with -o and fail otherwise. I think this shouldn't be the case, a built
> should be tested in offline mode with the same accuracy. Besides I'm not
> sure how tests could check if maven is run in offline mode, the cedi tests
> also fail independently if the maven built is run offline or online.
>
>
> Reto
>


-- 
*************************************
Alessio Bosca, Ph.D.
CELI s.r.l.
Via San Quintino 31
10121 Torino
Tel. +39 011.562.71.15
Fax +39 011.506.40.86
http://www.celi.it
*************************************



Re: failing build because CELI NER test cannot reach external server

Posted by Reto Bachmann-Gmür <re...@apache.org>.
On Mon, Sep 24, 2012 at 8:54 AM, Bertrand Delacretaz <bdelacretaz@apache.org
> wrote:

> On Sunday, September 23, 2012, Reto Bachmann-Gmür wrote:
>
> > ...I think the tests shold not access external services...
>
> Yes - there's OfflineMode for that.
>

The offline mode is for not updating libraries from the remote repos. If I
have the libraries in the local repository I can use the offline mode. If
tests are skipped in offline mode this means that some projects might buil
with -o and fail otherwise. I think this shouldn't be the case, a built
should be tested in offline mode with the same accuracy. Besides I'm not
sure how tests could check if maven is run in offline mode, the cedi tests
also fail independently if the maven built is run offline or online.


Reto

Re: failing build because CELI NER test cannot reach external server

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Sunday, September 23, 2012, Reto Bachmann-Gmür wrote:

> ...I think the tests shold not access external services...

Yes - there's OfflineMode for that.

-Bertrand