You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Felix Meschberger <fm...@gmail.com> on 2009/04/06 09:37:35 UTC

Re: "mvn clean" should delete "sling" work folders

Hi Bertrand

Bertrand Delacretaz schrieb:
> Hi,
> 
> I was bitten by this one again, trying to run Sling tests failed due
> to a stale "sling" work folder, or more precisely gave different
> results when run in the launchpad/testing folder vs. top of the source
> code tree.
> 
> In my opinion, "mvn clean test" should have predictable results,
> without taking previous runs into account.
> 
> Why did we move the "sling" folders from target/sling (where mvn clean
> kills them) to siblings of src folders?
> Is that on purpose, or a side effect of other changes?
> 
> I'd move them back, if people agree - having non-repeatable "mvn clean
> test" cycles can be a big waste of people's time.

+1, but ...

This started to surface when I redid the launchpad. One thing I did was
to remove support for system properties in the Sling web app, since
system properties have a lot of issues in web application scenario.

I found a way to solve this problem with the maven jetty plugin, where
you can inject more configuration (it requires an update of the plugin
used by Sling, no big deal).

I did not find a solution to this problem, yet, for integration tests,
which uses the cargo plugin to launch Sling to fire the tests.

Maybe we would have to start and stop Sling differently. Eg. by
launching a separate process with Sling standalone and shutdown that
instance after the tests. Such setup could be hooked into the
pre-integration-test and post-integration-test phases.

WDYT ?

Regards
Felix

> 
> -Bertrand
> 

Re: "mvn clean" should delete "sling" work folders

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Juan José Vázquez Delgado schrieb:
>> Do you know it a bit ? Can you take a stab at converting the current
>> Cargo based setup to be using Pax Exam ?
> 
> First time for me. I´m gonna try this and tell us.

Great ! Thanks.

Regards
Felix



Re: "mvn clean" should delete "sling" work folders

Posted by Juan José Vázquez Delgado <ju...@gmail.com>.
> Do you know it a bit ? Can you take a stab at converting the current
> Cargo based setup to be using Pax Exam ?

First time for me. I´m gonna try this and tell us.

Juanjo.

Re: "mvn clean" should delete "sling" work folders

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Juan José Vázquez Delgado schrieb:
> Hi,
> 
>> Maybe we would have to start and stop Sling differently. Eg. by
>> launching a separate process with Sling standalone and shutdown that
>> instance after the tests. Such setup could be hooked into the
>> pre-integration-test and post-integration-test phases.
>>
>> WDYT ?
> 
> Really, I´m not very comfortable with the testing infrastructure
> either. Since OSGi environment is the main runtime for Sling, IMHO
> testing should fit to this feature. Maybe we could use Pax Exam to
> make this [1]. WDYT?

Just reading quickly on the start page seems to be exactly, what we need.

Do you know it a bit ? Can you take a stab at converting the current
Cargo based setup to be using Pax Exam ?

Regards
Felix

> 
> BR,
> 
> Juanjo.
> 
> [1] http://wiki.ops4j.org/display/ops4j/Pax+Exam
> 


Re: "mvn clean" should delete "sling" work folders

Posted by Juan José Vázquez Delgado <ju...@gmail.com>.
Hi,

> Maybe we would have to start and stop Sling differently. Eg. by
> launching a separate process with Sling standalone and shutdown that
> instance after the tests. Such setup could be hooked into the
> pre-integration-test and post-integration-test phases.
>
> WDYT ?

Really, I´m not very comfortable with the testing infrastructure
either. Since OSGi environment is the main runtime for Sling, IMHO
testing should fit to this feature. Maybe we could use Pax Exam to
make this [1]. WDYT?

BR,

Juanjo.

[1] http://wiki.ops4j.org/display/ops4j/Pax+Exam

Re: "mvn clean" should delete "sling" work folders

Posted by Juan José Vázquez Delgado <ju...@gmail.com>.
> Redoing our testing infrastructure just for this reason feels a bit
> like overkill to me.

Not only. With Pax Exam we could test Sling deployed on any OSGi
environment (at least on some of them).

Juanjo.

Re: "mvn clean" should delete "sling" work folders

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Mon, Apr 6, 2009 at 12:27 PM, Felix Meschberger <fm...@gmail.com> wrote:

> Bertrand Delacretaz schrieb:
>> ...Can't we just use a specific system property to set the sling.home
>> value for integration tests?...

> ...But having a special system property coded into Sling just for the sake
> of keeping the current integration tests just does not sound right
> either. In fact, I truly dislike special casing, of which such a
> property would be an instance ;-)...

Ok, for now, in revision 762318 I have updated the top-level pom.xml
so that "mvn clean" deletes the "sling" folder that's created there
when running a full build with integration tests.

We can remove this workaround once a better solution is in place.

-Bertrand

Re: "mvn clean" should delete "sling" work folders

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Bertrand Delacretaz schrieb:
>> ...Maybe we would have to start and stop Sling differently. Eg. by
>> launching a separate process with Sling standalone and shutdown that
>> instance after the tests. Such setup could be hooked into the
>> pre-integration-test and post-integration-test phases....
> 
> Can't we just use a specific system property to set the sling.home
> value for integration tests?
> 
> We could use "sling.integration.testing.home" for example, to make it
> clear what that is, and this property would override any other
> setting, logging a warning when that happens.
> 
> Seems reasonably foolproof and simple to implement, or am I missing something?
> 
> Redoing our testing infrastructure just for this reason feels a bit
> like overkill to me.

This sounds like so, yes.

But having a special system property coded into Sling just for the sake
of keeping the current integration tests just does not sound right
either. In fact, I truly dislike special casing, of which such a
property would be an instance ;-)

Another workaround, we could try would be to replace the original
web.xml file of the Sling web app with a specially crafted one. But,
this is kind of fragile, too.

Regards
Felix

Re: "mvn clean" should delete "sling" work folders

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Mon, Apr 6, 2009 at 9:37 AM, Felix Meschberger <fm...@gmail.com> wrote:
> Hi Bertrand
>
> Bertrand Delacretaz schrieb:
>> ...Why did we move the "sling" folders from target/sling (where mvn clean
>> kills them) to siblings of src folders?
>> Is that on purpose, or a side effect of other changes?...

> This started to surface when I redid the launchpad. One thing I did was
> to remove support for system properties in the Sling web app, since
> system properties have a lot of issues in web application scenario.

Ok, in general this seems to make sense.

>
> ...Maybe we would have to start and stop Sling differently. Eg. by
> launching a separate process with Sling standalone and shutdown that
> instance after the tests. Such setup could be hooked into the
> pre-integration-test and post-integration-test phases....

Can't we just use a specific system property to set the sling.home
value for integration tests?

We could use "sling.integration.testing.home" for example, to make it
clear what that is, and this property would override any other
setting, logging a warning when that happens.

Seems reasonably foolproof and simple to implement, or am I missing something?

Redoing our testing infrastructure just for this reason feels a bit
like overkill to me.

-Bertrand