buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Assaf Arkin <as...@labnotes.org>
Subject Re: unpredictable behavior of test.using :integration
Date Wed, 21 Oct 2009 18:40:38 GMT
On Wed, Oct 21, 2009 at 2:10 AM, Peter Schröder <ps@blau.de> wrote:

> another thing i noticed, is that calling
>
> project.test.using :integration in a post-define task
>
> seems to work differntly form calling it directly in the project via
>
> test.using :integration
>
> any ideas?
>

Flipping integration bit on simply changes when tests are run: after
packaging (integration), instead of before packaging (regular). All other
behavior is the same (setup, teardown, frameworks, etc).

Test options are inherited, options you define in a parent project are
inherited by its sub-project, and that should include the integration
option.

Changing the order in which tests are run involving setting up task
dependencies, which happens at the very end of the project definition, after
evaluating the block. If you then (post-define) change the setting, nothing
much happens, as task are already wired to run in non-integration order.

Assaf


>
> Am 21.10.2009 um 09:32 schrieb Peter Schröder:
>
> > hi there,
> >
> > we are experiencing somewhat strange behavior when using integration
> > tests.
> >
> > we have a setup where a project has n subprojects and only one of them
> > has tests that should be executed as integration-tests.
> >
> > we are using environment-variables to let buildr include some test-
> > classes that are only executed on our system-test-servers.
> >
> > this works very well: compiles, package artifacts, calls integration-
> > setup, performs-tests, integration-teardown
> >
> > on the other hand we have the same setup but with a single project
> > without subprojects, where the integration setup is missing, so the
> > system-tests fail without a system to test. in that project i have to
> > call the integration-target directly to have the desired behavior.
> >
> > the builds are quite complex so i wont include them here, but i played
> > around a little bit with a dummy project (see below).
> >
> > the things i dont understand are:
> >
> > 1. why are setup and teardown called for all projects even though they
> > are never configured with :integration
> > 2. why are all tests executed as :integration if you just configure it
> > in the parent project
> > 3. under wich circumstances will the integration-target get invoked
> >
> >
> > module SystemTests
> >   include Extension
> >
> >   after_define do |project|
> >     info "after define for #{project}"
> >     #project.test.using :integration
> >     project.integration.setup do
> >       info "-" * 50 + " integeration setup for #{project}"
> >     end
> >
> >     project.integration.teardown do
> >       info "-" * 50 + " integeration teardown for #{project}"
> >     end
> >   end
> >
> > end
> >
> > class Buildr::Project
> >   include SystemTests
> > end
> >
> > repositories.remote << 'http://www.ibiblio.org/maven2/'
> >
> > info "define all"
> > define 'all' do
> >
> >   info "define subA"
> >   define 'subA' do
> >     info "subA goes here"
> >     #test.using :integration
> >   end
> >
> >   info "define subB"
> >   define 'subB' do
> >     info "subB goes here"
> >     #test.using :junit
> >   end
> >
> >   info "all goes here"
> >
> >   test.using :integration
> >
> > end
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message