Foreman plugins/engines testing

Hi,

I've been working on first cut of a foreman-katello-engine, exposing some Katello stuff
on Foreman side.

One thing that authors of other plugins might be interested is how the unit testing
is see [1] : it downloads Foreman source code and tests the plugin in it's context,
as it was one app.

I've also set up travis successfully. Feel free to reuse/improve.

[1] - https://github.com/Katello/foreman-katello-engine#testing

– Ivan

Engine testing testing is something I was looking at ~2 weeks ago. It is
possible to do self-contained engine testing (by stubbing out a 'dummy'
Rails app that behaves as the plugin expects). Sadly, all the examples of
running self-contained engine tests are for Rails 3.2, which caused me a
lot of pain, so I was planning to wait for Joseph's 3.2 branch to hit
develop before I go back to it.

If want to have a shot at it yourself, I was playing with
https://github.com/eric1234/test_engine before I went on holiday :wink:

Greg

··· On 21 March 2013 12:55, Ivan Necas wrote:

One thing that authors of other plugins might be interested is how the
unit testing
is see [1] : it downloads Foreman source code and tests the plugin in it’s
context,
as it was one app.

The dummy app is good when the engine is not app specific. Although,
in our case the host app will always be Foreman, therefore it makes
more sense to me to use the Foreman as the 'dummy' app and
test the engine in it's context.

– Ivan

··· ----- Original Message ----- > > > > > On 21 March 2013 12:55, Ivan Necas < inecas@redhat.com > wrote: > > > > One thing that authors of other plugins might be interested is how > the unit testing > is see [1] : it downloads Foreman source code and tests the plugin in > it's context, > as it was one app. > > > > Engine testing testing is something I was looking at ~2 weeks ago. It > is possible to do self-contained engine testing (by stubbing out a > 'dummy' Rails app that behaves as the plugin expects). Sadly, all > the examples of running self-contained engine tests are for Rails > 3.2, which caused me a lot of pain, so I was planning to wait for > Joseph's 3.2 branch to hit develop before I go back to it. > > > If want to have a shot at it yourself, I was playing with > https://github.com/eric1234/test_engine before I went on holiday ;) > > > Greg > > -- > You received this message because you are subscribed to the Google > Groups "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out . > > >

> The dummy app is good when the engine is not app specific. Although,
> in our case the host app will always be Foreman, therefore it makes
> more sense to me to use the Foreman as the 'dummy' app and
> test the engine in it's context.
>
> I think it makes much more sense when you want your plugin to support
multiple versions of foreman, so you could bind it to a different version
of foreman each time.

Ohad

··· On Mon, Mar 25, 2013 at 3:35 PM, Ivan Necas wrote:

– Ivan

----- Original Message -----

On 21 March 2013 12:55, Ivan Necas < inecas@redhat.com > wrote:

One thing that authors of other plugins might be interested is how
the unit testing
is see [1] : it downloads Foreman source code and tests the plugin in
it’s context,
as it was one app.

Engine testing testing is something I was looking at ~2 weeks ago. It
is possible to do self-contained engine testing (by stubbing out a
’dummy’ Rails app that behaves as the plugin expects). Sadly, all
the examples of running self-contained engine tests are for Rails
3.2, which caused me a lot of pain, so I was planning to wait for
Joseph’s 3.2 branch to hit develop before I go back to it.

If want to have a shot at it yourself, I was playing with
https://github.com/eric1234/test_engine before I went on holiday :wink:

Greg


You received this message because you are subscribed to the Google
Groups “foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it,
send an email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out .


You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Both good points. I might borrow your style for my plugins, Ivan :slight_smile:

··· On 28 March 2013 08:37, Ohad Levy wrote:

On Mon, Mar 25, 2013 at 3:35 PM, Ivan Necas inecas@redhat.com wrote:

The dummy app is good when the engine is not app specific. Although,
in our case the host app will always be Foreman, therefore it makes
more sense to me to use the Foreman as the ‘dummy’ app and
test the engine in it’s context.

I think it makes much more sense when you want your plugin to support
multiple versions of foreman, so you could bind it to a different version
of foreman each time.