Stable trunk?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
43 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Ray-91
I did once set up CruiseControl against OFBiz trunk, must of been a
while ago as I'm sure it was CVS then!

Put simply it did a daily checkout and test and then you could access
web based reports to see the status.

I'm happy to help get it set up again if people felt it was of interest
as it does provide a much more focused and visual environment for all to
access but would need someone to volunteer hosting it :-) !

I don't currently have much in the way of hardware and if I could get a
machine together it would probably end up on a personal connection so
not the most reliable.

Ray


David E Jones wrote:

>
> On Oct 29, 2008, at 11:54 AM, Adam Heath wrote:
>
>> BJ Freeman wrote:
>>> there has been an effort to put in test units.
>>> the only thing lacking, in making it complete is manpower.
>>
>> And fixing the existing tests that are broken. :|
>
> This is an area where it would be REALLY GREAT to have more effort go
> into the project. Yep, great enough to capitalize "REALLY" and "GREAT".
>
> Who has worked on the unit tests that are in place? I'll admit I haven't
> much except on the toolset and some of the framework unit tests and
> helping some of the Hotwax Media people who wrote many of the tests that
> now exist, especially the ones in the various applications.
>
> Is there anyone interested in working on this stuff? If there are enough
> people who want to actively work on it we can setup some coordination
> resources (ie Jira tasks, confluence pages, etc). If there are only 2-3
> then coordination through the mailing list would be better, and more
> visible to others possibly interested.
>
> -David
>
>
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Tim Ruppert
My vote is that I think it's a good idea.  Once we get our  
infrastructure upgrade completed (over the next few weeks), we'll get  
it up and running on our OFBiz server that Contegix sponsors.  It will  
be relatively easy.  We'll talk about which tool - be it Cruise  
Control, Bamboo, or Team City - once we get the hardware provisioned.

Cheers,
Tim
--
Tim Ruppert
HotWax Media
http://www.hotwaxmedia.com

o:801.649.6594
f:801.649.6595

On Oct 30, 2008, at 11:46 AM, Ray wrote:

> I did once set up CruiseControl against OFBiz trunk, must of been a
> while ago as I'm sure it was CVS then!
>
> Put simply it did a daily checkout and test and then you could access
> web based reports to see the status.
>
> I'm happy to help get it set up again if people felt it was of  
> interest
> as it does provide a much more focused and visual environment for  
> all to
> access but would need someone to volunteer hosting it :-) !
>
> I don't currently have much in the way of hardware and if I could  
> get a
> machine together it would probably end up on a personal connection so
> not the most reliable.
>
> Ray
>
>
> David E Jones wrote:
>>
>> On Oct 29, 2008, at 11:54 AM, Adam Heath wrote:
>>
>>> BJ Freeman wrote:
>>>> there has been an effort to put in test units.
>>>> the only thing lacking, in making it complete is manpower.
>>>
>>> And fixing the existing tests that are broken. :|
>>
>> This is an area where it would be REALLY GREAT to have more effort go
>> into the project. Yep, great enough to capitalize "REALLY" and  
>> "GREAT".
>>
>> Who has worked on the unit tests that are in place? I'll admit I  
>> haven't
>> much except on the toolset and some of the framework unit tests and
>> helping some of the Hotwax Media people who wrote many of the tests  
>> that
>> now exist, especially the ones in the various applications.
>>
>> Is there anyone interested in working on this stuff? If there are  
>> enough
>> people who want to actively work on it we can setup some coordination
>> resources (ie Jira tasks, confluence pages, etc). If there are only  
>> 2-3
>> then coordination through the mailing list would be better, and more
>> visible to others possibly interested.
>>
>> -David
>>
>>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Ray-91
Sounds great!

Yep can discuss tool another day only mentioned CC because I used it
last time, haven't evaluated others so open to suggestions and happy to
help if I can.

Ray


Tim Ruppert wrote:
> My vote is that I think it's a good idea.  Once we get our
> infrastructure upgrade completed (over the next few weeks), we'll get it
> up and running on our OFBiz server that Contegix sponsors.  It will be
> relatively easy.  We'll talk about which tool - be it Cruise Control,
> Bamboo, or Team City - once we get the hardware provisioned.
>
> Cheers,
> Tim

Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Brett
In reply to this post by David E Jones
David,
We have been using SeleniumRC and an extension called SeleniumXml that I
will be presenting on at the ApacheCon conference next week.  These could be
called from a normal ant process or used in Cruise Control.

Let's talk more about this next week at the conference.


Brett

On Wed, Oct 29, 2008 at 2:34 PM, David E Jones <[hidden email]>wrote:

>
> Erwan,
>
> It would be great to have some tests that go through the user interface,
> but we don't have tools for this yet that fit into the automated test system
> in OFBiz (ie so they can run along with other tests, and run automatically).
>
> The goal is for the tests to all work with an "ant run-tests" (or "java
> -jar ofbiz.jar tests"), and to cover as much of OFBiz OOTB as possible, and
> then to also be easy to customize or comment out those that no longer apply
> after people customize or add on to OFBiz.
>
> If you guys would like to work on getting Selenium tests to work this way,
> that would be great. Others have looked at this and run into troubles, so
> the last idea I heard was to use something different and that might be more
> manual for initial test writing, but probably easier to maintain.
>
> At Hotwax we've written/recorded a bunch of Selenium tests for clients, but
> they are difficult to maintain and as far as we've gone they also have to be
> manually run and watched.
>
> -David
>
>
>
> On Oct 29, 2008, at 12:09 PM, Erwan de FERRIERES wrote:
>
>  Here at Nereide, we are ready to make selenium tests (it's a task we have
>> planned to do, but which is always postponed....).
>> So, if it's ok with you and that you are interested in that, we are going
>> to make it real !
>>
>> David E Jones a écrit :
>>
>>> On Oct 29, 2008, at 11:54 AM, Adam Heath wrote:
>>>
>>>> BJ Freeman wrote:
>>>>
>>>>> there has been an effort to put in test units.
>>>>> the only thing lacking, in making it complete is manpower.
>>>>>
>>>>
>>>> And fixing the existing tests that are broken. :|
>>>>
>>> This is an area where it would be REALLY GREAT to have more effort go
>>> into the project. Yep, great enough to capitalize "REALLY" and "GREAT".
>>> Who has worked on the unit tests that are in place? I'll admit I haven't
>>> much except on the toolset and some of the framework unit tests and helping
>>> some of the Hotwax Media people who wrote many of the tests that now exist,
>>> especially the ones in the various applications.
>>> Is there anyone interested in working on this stuff? If there are enough
>>> people who want to actively work on it we can setup some coordination
>>> resources (ie Jira tasks, confluence pages, etc). If there are only 2-3 then
>>> coordination through the mailing list would be better, and more visible to
>>> others possibly interested.
>>> -David
>>>
>>
>> --
>> - Erwan -
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

David E Jones

Thanks for the reminder Brett... not sure how I forgot about that  
presentation!

So yes, let's definitely talk about it at the conference.

BTW, in addition to this presentation and others that might be  
related, we have a BOF session on Thurs evening to talk about future  
stuff to work on in OFBiz. Anyway, yes, there will be time to talk.

And yes, for everyone who is not attending I'm sure people will be  
open and communicative (as is normally the case) about new features,  
direction, etc. Still, the best experience and involvement is to  
attend, so if you can, it's not too late!

-David


On Oct 30, 2008, at 12:55 PM, Brett Palmer wrote:

> David,
> We have been using SeleniumRC and an extension called SeleniumXml  
> that I
> will be presenting on at the ApacheCon conference next week.  These  
> could be
> called from a normal ant process or used in Cruise Control.
>
> Let's talk more about this next week at the conference.
>
>
> Brett
>
> On Wed, Oct 29, 2008 at 2:34 PM, David E Jones <[hidden email]
> >wrote:
>
>>
>> Erwan,
>>
>> It would be great to have some tests that go through the user  
>> interface,
>> but we don't have tools for this yet that fit into the automated  
>> test system
>> in OFBiz (ie so they can run along with other tests, and run  
>> automatically).
>>
>> The goal is for the tests to all work with an "ant run-tests" (or  
>> "java
>> -jar ofbiz.jar tests"), and to cover as much of OFBiz OOTB as  
>> possible, and
>> then to also be easy to customize or comment out those that no  
>> longer apply
>> after people customize or add on to OFBiz.
>>
>> If you guys would like to work on getting Selenium tests to work  
>> this way,
>> that would be great. Others have looked at this and run into  
>> troubles, so
>> the last idea I heard was to use something different and that might  
>> be more
>> manual for initial test writing, but probably easier to maintain.
>>
>> At Hotwax we've written/recorded a bunch of Selenium tests for  
>> clients, but
>> they are difficult to maintain and as far as we've gone they also  
>> have to be
>> manually run and watched.
>>
>> -David
>>
>>
>>
>> On Oct 29, 2008, at 12:09 PM, Erwan de FERRIERES wrote:
>>
>> Here at Nereide, we are ready to make selenium tests (it's a task  
>> we have
>>> planned to do, but which is always postponed....).
>>> So, if it's ok with you and that you are interested in that, we  
>>> are going
>>> to make it real !
>>>
>>> David E Jones a écrit :
>>>
>>>> On Oct 29, 2008, at 11:54 AM, Adam Heath wrote:
>>>>
>>>>> BJ Freeman wrote:
>>>>>
>>>>>> there has been an effort to put in test units.
>>>>>> the only thing lacking, in making it complete is manpower.
>>>>>>
>>>>>
>>>>> And fixing the existing tests that are broken. :|
>>>>>
>>>> This is an area where it would be REALLY GREAT to have more  
>>>> effort go
>>>> into the project. Yep, great enough to capitalize "REALLY" and  
>>>> "GREAT".
>>>> Who has worked on the unit tests that are in place? I'll admit I  
>>>> haven't
>>>> much except on the toolset and some of the framework unit tests  
>>>> and helping
>>>> some of the Hotwax Media people who wrote many of the tests that  
>>>> now exist,
>>>> especially the ones in the various applications.
>>>> Is there anyone interested in working on this stuff? If there are  
>>>> enough
>>>> people who want to actively work on it we can setup some  
>>>> coordination
>>>> resources (ie Jira tasks, confluence pages, etc). If there are  
>>>> only 2-3 then
>>>> coordination through the mailing list would be better, and more  
>>>> visible to
>>>> others possibly interested.
>>>> -David
>>>>
>>>
>>> --
>>> - Erwan -
>>>
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Sharan-F
In reply to this post by BJ Freeman
Hi BJ

I've also been looking at testing from a user perspective (i.e. what they can see and do via the user interface). My method has been to take a high level process (eg Customer Sales) generate the use cases then break them down into detailed test scripts that follow an end to end flow.

I'd be very interested in seeing what you've done and also finding out if any of the work I've done could be linked in as I'm keen to contribute to the project.

Thanks
Sharan

BJ Freeman wrote
I have been slowly creating test more from a user input than testing code.
I think I can complete one that will work on the trunk for an example
and review.
target jan 09

David E Jones sent the following on 10/29/2008 11:02 AM:
>
> On Oct 29, 2008, at 11:54 AM, Adam Heath wrote:
>
>> BJ Freeman wrote:
>>> there has been an effort to put in test units.
>>> the only thing lacking, in making it complete is manpower.
>>
>> And fixing the existing tests that are broken. :|
>
> This is an area where it would be REALLY GREAT to have more effort go
> into the project. Yep, great enough to capitalize "REALLY" and "GREAT".
>
> Who has worked on the unit tests that are in place? I'll admit I haven't
> much except on the toolset and some of the framework unit tests and
> helping some of the Hotwax Media people who wrote many of the tests that
> now exist, especially the ones in the various applications.
>
> Is there anyone interested in working on this stuff? If there are enough
> people who want to actively work on it we can setup some coordination
> resources (ie Jira tasks, confluence pages, etc). If there are only 2-3
> then coordination through the mailing list would be better, and more
> visible to others possibly interested.
>
> -David
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Adam Heath-2
In reply to this post by Scott Gray
Scott Gray wrote:
> From memory, the main reason the current unit tests are failing is
> because they were mistakenly only tested against the component they
> were built for and not when running the entire set of tests.  It means
> that the demo data used in the tests gets reused across tests and as
> that data changes it causes subsequent tests to fail because they were
> expected the data to be in it's original state.

So the seed data needs to really be treated as seed data, ie, read-only.
 And each test needs it's own set of 'test' data.

Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Scott Gray
I'm talking about demo data not seed data, I don't see why the demo
data can't be used for testing?

Regards
Scott

2008/10/31 Adam Heath <[hidden email]>:

> Scott Gray wrote:
>> From memory, the main reason the current unit tests are failing is
>> because they were mistakenly only tested against the component they
>> were built for and not when running the entire set of tests.  It means
>> that the demo data used in the tests gets reused across tests and as
>> that data changes it causes subsequent tests to fail because they were
>> expected the data to be in it's original state.
>
> So the seed data needs to really be treated as seed data, ie, read-only.
>  And each test needs it's own set of 'test' data.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Adam Heath-2
Scott Gray wrote:
> I'm talking about demo data not seed data, I don't see why the demo
> data can't be used for testing?

That is exactly the problem.  Testing mutates things.  If each test has
it's very own set of data, then there will never be a clash with
anything else.

And, the demo data is useful for those wanting to see how various parts
of ofbiz function, OOTB.

Reusing them can only lead to headaches, which is why we have the full
test suite containing so many failures.
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

David E Jones

One way or another we want to avoid dependencies between test cases.  
In the case of data it means that no test case should depend on data  
changes made in a previous test case. Using demo data isn't the thing  
that's bad, it's changing something that another test case might  
depend on.

The best way to fix this would be to have each test case clean up  
after itself. This could involve saving data before changing it so  
that we can change it back... or even better let the database do it  
since it already supports that through rolling back a transaction...

We may need to make some changes so that it is clear that the test  
succeeded even though the transaction was rolled back (ie the test  
runner needs to rollback the transaction, not the test case code  
itself).

Does that sound like a reasonable approach?

-David


On Oct 30, 2008, at 11:39 PM, Adam Heath wrote:

> Scott Gray wrote:
>> I'm talking about demo data not seed data, I don't see why the demo
>> data can't be used for testing?
>
> That is exactly the problem.  Testing mutates things.  If each test  
> has
> it's very own set of data, then there will never be a clash with
> anything else.
>
> And, the demo data is useful for those wanting to see how various  
> parts
> of ofbiz function, OOTB.
>
> Reusing them can only lead to headaches, which is why we have the full
> test suite containing so many failures.

Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Scott Gray
In reply to this post by Adam Heath-2
Even if you gave each test it's own data, you would still need the
demo data to provide all of the supporting data needed to effectively
test the system, each test couldn't set the system up in it's
entirety.

The database is supposed to be cleared before and after running the
tests, so using the demo data doesn't prevent people from using the
demo data for demos.

The reason the tests are broken at the moment is not because demo data
was used/misused but because it wasn't understood that the entire test
suite should pass in a single sweep, if I understand correctly the
test being committed was tested as a standalone unit.  Normally the
test would have failed while being developed, the problem spotted and
fixed.

Regards
Scott

2008/10/31 Adam Heath <[hidden email]>:

> Scott Gray wrote:
>> I'm talking about demo data not seed data, I don't see why the demo
>> data can't be used for testing?
>
> That is exactly the problem.  Testing mutates things.  If each test has
> it's very own set of data, then there will never be a clash with
> anything else.
>
> And, the demo data is useful for those wanting to see how various parts
> of ofbiz function, OOTB.
>
> Reusing them can only lead to headaches, which is why we have the full
> test suite containing so many failures.
>
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

BJ Freeman
not to hijack the thread
been looking at using
http://maxq.tigris.org/
but it can not revert the data.
one thought was to have a test url that did setup and reset.


Scott Gray sent the following on 10/30/2008 11:01 PM:

> Even if you gave each test it's own data, you would still need the
> demo data to provide all of the supporting data needed to effectively
> test the system, each test couldn't set the system up in it's
> entirety.
>
> The database is supposed to be cleared before and after running the
> tests, so using the demo data doesn't prevent people from using the
> demo data for demos.
>
> The reason the tests are broken at the moment is not because demo data
> was used/misused but because it wasn't understood that the entire test
> suite should pass in a single sweep, if I understand correctly the
> test being committed was tested as a standalone unit.  Normally the
> test would have failed while being developed, the problem spotted and
> fixed.
>
> Regards
> Scott
>
> 2008/10/31 Adam Heath <[hidden email]>:
>> Scott Gray wrote:
>>> I'm talking about demo data not seed data, I don't see why the demo
>>> data can't be used for testing?
>> That is exactly the problem.  Testing mutates things.  If each test has
>> it's very own set of data, then there will never be a clash with
>> anything else.
>>
>> And, the demo data is useful for those wanting to see how various parts
>> of ofbiz function, OOTB.
>>
>> Reusing them can only lead to headaches, which is why we have the full
>> test suite containing so many failures.
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Jacques Le Roux
Administrator
In reply to this post by David E Jones
It looks like the better proposition so far to me

Jacques

From: "David E Jones" <[hidden email]>

>
> One way or another we want to avoid dependencies between test cases.  
> In the case of data it means that no test case should depend on data  
> changes made in a previous test case. Using demo data isn't the thing  
> that's bad, it's changing something that another test case might  
> depend on.
>
> The best way to fix this would be to have each test case clean up  
> after itself. This could involve saving data before changing it so  
> that we can change it back... or even better let the database do it  
> since it already supports that through rolling back a transaction...
>
> We may need to make some changes so that it is clear that the test  
> succeeded even though the transaction was rolled back (ie the test  
> runner needs to rollback the transaction, not the test case code  
> itself).
>
> Does that sound like a reasonable approach?
>
> -David
>
>
> On Oct 30, 2008, at 11:39 PM, Adam Heath wrote:
>
>> Scott Gray wrote:
>>> I'm talking about demo data not seed data, I don't see why the demo
>>> data can't be used for testing?
>>
>> That is exactly the problem.  Testing mutates things.  If each test  
>> has
>> it's very own set of data, then there will never be a clash with
>> anything else.
>>
>> And, the demo data is useful for those wanting to see how various  
>> parts
>> of ofbiz function, OOTB.
>>
>> Reusing them can only lead to headaches, which is why we have the full
>> test suite containing so many failures.
>
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Ray-91
In reply to this post by David E Jones
Seems OK for the simpler unit tests but would also be good to have a
solution that keeps it easy to write higher level tests.

For example small unit tests to ensure stock management in the facility
manager works could be quite simple and are essential first level unit
tests. But we really need to also write test cases that create customer
orders and purchase orders and process those whilst also cancelling
orders and order line items and testing that stock levels still work.
May not be unit tests exactly but still good to have a data solution
that allows them to be catered for, could a rollback really handle that
sort of test?

Would it be to difficult to write a routine that went through the
database and removed all data and then reimported seed/demo? Don't
suppose Derby supports checkpoints!

Ray


David E Jones wrote:

>
> One way or another we want to avoid dependencies between test cases. In
> the case of data it means that no test case should depend on data
> changes made in a previous test case. Using demo data isn't the thing
> that's bad, it's changing something that another test case might depend on.
>
> The best way to fix this would be to have each test case clean up after
> itself. This could involve saving data before changing it so that we can
> change it back... or even better let the database do it since it already
> supports that through rolling back a transaction...
>
> We may need to make some changes so that it is clear that the test
> succeeded even though the transaction was rolled back (ie the test
> runner needs to rollback the transaction, not the test case code itself).
>
> Does that sound like a reasonable approach?
>
> -David
>
>
> On Oct 30, 2008, at 11:39 PM, Adam Heath wrote:
>
>> Scott Gray wrote:
>>> I'm talking about demo data not seed data, I don't see why the demo
>>> data can't be used for testing?
>>
>> That is exactly the problem.  Testing mutates things.  If each test has
>> it's very own set of data, then there will never be a clash with
>> anything else.
>>
>> And, the demo data is useful for those wanting to see how various parts
>> of ofbiz function, OOTB.
>>
>> Reusing them can only lead to headaches, which is why we have the full
>> test suite containing so many failures.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Erwan de FERRIERES-3
In reply to this post by Brett
Will the slides be available on the Internet after your presentation ?
I'm not coming to the ApacheCon, but I am very interested to see what
you've done with Selenium.


Brett Palmer a écrit :

> David,
> We have been using SeleniumRC and an extension called SeleniumXml that I
> will be presenting on at the ApacheCon conference next week.  These could be
> called from a normal ant process or used in Cruise Control.
>
> Let's talk more about this next week at the conference.
>
>
> Brett
>
> On Wed, Oct 29, 2008 at 2:34 PM, David E Jones <[hidden email]>wrote:
>
>> Erwan,
>>
>> It would be great to have some tests that go through the user interface,
>> but we don't have tools for this yet that fit into the automated test system
>> in OFBiz (ie so they can run along with other tests, and run automatically).
>>
>> The goal is for the tests to all work with an "ant run-tests" (or "java
>> -jar ofbiz.jar tests"), and to cover as much of OFBiz OOTB as possible, and
>> then to also be easy to customize or comment out those that no longer apply
>> after people customize or add on to OFBiz.
>>
>> If you guys would like to work on getting Selenium tests to work this way,
>> that would be great. Others have looked at this and run into troubles, so
>> the last idea I heard was to use something different and that might be more
>> manual for initial test writing, but probably easier to maintain.
>>
>> At Hotwax we've written/recorded a bunch of Selenium tests for clients, but
>> they are difficult to maintain and as far as we've gone they also have to be
>> manually run and watched.
>>
>> -David
>>
>>
>>
>> On Oct 29, 2008, at 12:09 PM, Erwan de FERRIERES wrote:
>>
>>  Here at Nereide, we are ready to make selenium tests (it's a task we have
>>> planned to do, but which is always postponed....).
>>> So, if it's ok with you and that you are interested in that, we are going
>>> to make it real !
>>>
>>> David E Jones a écrit :
>>>
>>>> On Oct 29, 2008, at 11:54 AM, Adam Heath wrote:
>>>>
>>>>> BJ Freeman wrote:
>>>>>
>>>>>> there has been an effort to put in test units.
>>>>>> the only thing lacking, in making it complete is manpower.
>>>>>>
>>>>> And fixing the existing tests that are broken. :|
>>>>>
>>>> This is an area where it would be REALLY GREAT to have more effort go
>>>> into the project. Yep, great enough to capitalize "REALLY" and "GREAT".
>>>> Who has worked on the unit tests that are in place? I'll admit I haven't
>>>> much except on the toolset and some of the framework unit tests and helping
>>>> some of the Hotwax Media people who wrote many of the tests that now exist,
>>>> especially the ones in the various applications.
>>>> Is there anyone interested in working on this stuff? If there are enough
>>>> people who want to actively work on it we can setup some coordination
>>>> resources (ie Jira tasks, confluence pages, etc). If there are only 2-3 then
>>>> coordination through the mailing list would be better, and more visible to
>>>> others possibly interested.
>>>> -David
>>>>
>>> --
>>> - Erwan -
>>>
>>
>

--
- Erwan -
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Shi Yusen
In reply to this post by Ray-91
How about unit tests using another Derby configuration rather than the
localderby configed in entityengine.xml by default? And further,
separate the test code and demo data to a new folder, when interface is
defined and use cases (demo seeds) are given out, the test case coding
can be paralleled to the function coding?

I guess this will make run-test simple and independent.

Shi Yusen

在 2008-10-31五的 09:57 +0000,Ray写道:

> Seems OK for the simpler unit tests but would also be good to have a
> solution that keeps it easy to write higher level tests.
>
> For example small unit tests to ensure stock management in the facility
> manager works could be quite simple and are essential first level unit
> tests. But we really need to also write test cases that create customer
> orders and purchase orders and process those whilst also cancelling
> orders and order line items and testing that stock levels still work.
> May not be unit tests exactly but still good to have a data solution
> that allows them to be catered for, could a rollback really handle that
> sort of test?
>
> Would it be to difficult to write a routine that went through the
> database and removed all data and then reimported seed/demo? Don't
> suppose Derby supports checkpoints!
>
> Ray
>
>
> David E Jones wrote:
> >
> > One way or another we want to avoid dependencies between test cases. In
> > the case of data it means that no test case should depend on data
> > changes made in a previous test case. Using demo data isn't the thing
> > that's bad, it's changing something that another test case might depend on.
> >
> > The best way to fix this would be to have each test case clean up after
> > itself. This could involve saving data before changing it so that we can
> > change it back... or even better let the database do it since it already
> > supports that through rolling back a transaction...
> >
> > We may need to make some changes so that it is clear that the test
> > succeeded even though the transaction was rolled back (ie the test
> > runner needs to rollback the transaction, not the test case code itself).
> >
> > Does that sound like a reasonable approach?
> >
> > -David
> >
> >
> > On Oct 30, 2008, at 11:39 PM, Adam Heath wrote:
> >
> >> Scott Gray wrote:
> >>> I'm talking about demo data not seed data, I don't see why the demo
> >>> data can't be used for testing?
> >>
> >> That is exactly the problem.  Testing mutates things.  If each test has
> >> it's very own set of data, then there will never be a clash with
> >> anything else.
> >>
> >> And, the demo data is useful for those wanting to see how various parts
> >> of ofbiz function, OOTB.
> >>
> >> Reusing them can only lead to headaches, which is why we have the full
> >> test suite containing so many failures.
> >
> >

Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Adam Heath-2
In reply to this post by David E Jones
David E Jones wrote:

>
> One way or another we want to avoid dependencies between test cases. In
> the case of data it means that no test case should depend on data
> changes made in a previous test case. Using demo data isn't the thing
> that's bad, it's changing something that another test case might depend on.
>
> The best way to fix this would be to have each test case clean up after
> itself. This could involve saving data before changing it so that we can
> change it back... or even better let the database do it since it already
> supports that through rolling back a transaction...
>
> We may need to make some changes so that it is clear that the test
> succeeded even though the transaction was rolled back (ie the test
> runner needs to rollback the transaction, not the test case code itself).
>
> Does that sound like a reasonable approach?

Nope.  Can't have nested/chained transactions, and this won't help the
tests that do funky transaction stuff.
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Brett
In reply to this post by Erwan de FERRIERES-3
If presentations aren't posted after ApacheCon I can post mine to the
mailing list.
Brett

On Fri, Oct 31, 2008 at 5:03 AM, Erwan de FERRIERES <
[hidden email]> wrote:

> Will the slides be available on the Internet after your presentation ? I'm
> not coming to the ApacheCon, but I am very interested to see what you've
> done with Selenium.
>
>
> Brett Palmer a écrit :
>
>  David,
>> We have been using SeleniumRC and an extension called SeleniumXml that I
>> will be presenting on at the ApacheCon conference next week.  These could
>> be
>> called from a normal ant process or used in Cruise Control.
>>
>> Let's talk more about this next week at the conference.
>>
>>
>> Brett
>>
>> On Wed, Oct 29, 2008 at 2:34 PM, David E Jones <[hidden email]
>> >wrote:
>>
>>  Erwan,
>>>
>>> It would be great to have some tests that go through the user interface,
>>> but we don't have tools for this yet that fit into the automated test
>>> system
>>> in OFBiz (ie so they can run along with other tests, and run
>>> automatically).
>>>
>>> The goal is for the tests to all work with an "ant run-tests" (or "java
>>> -jar ofbiz.jar tests"), and to cover as much of OFBiz OOTB as possible,
>>> and
>>> then to also be easy to customize or comment out those that no longer
>>> apply
>>> after people customize or add on to OFBiz.
>>>
>>> If you guys would like to work on getting Selenium tests to work this
>>> way,
>>> that would be great. Others have looked at this and run into troubles, so
>>> the last idea I heard was to use something different and that might be
>>> more
>>> manual for initial test writing, but probably easier to maintain.
>>>
>>> At Hotwax we've written/recorded a bunch of Selenium tests for clients,
>>> but
>>> they are difficult to maintain and as far as we've gone they also have to
>>> be
>>> manually run and watched.
>>>
>>> -David
>>>
>>>
>>>
>>> On Oct 29, 2008, at 12:09 PM, Erwan de FERRIERES wrote:
>>>
>>>  Here at Nereide, we are ready to make selenium tests (it's a task we
>>> have
>>>
>>>> planned to do, but which is always postponed....).
>>>> So, if it's ok with you and that you are interested in that, we are
>>>> going
>>>> to make it real !
>>>>
>>>> David E Jones a écrit :
>>>>
>>>>  On Oct 29, 2008, at 11:54 AM, Adam Heath wrote:
>>>>>
>>>>>  BJ Freeman wrote:
>>>>>>
>>>>>>  there has been an effort to put in test units.
>>>>>>> the only thing lacking, in making it complete is manpower.
>>>>>>>
>>>>>>>  And fixing the existing tests that are broken. :|
>>>>>>
>>>>>>  This is an area where it would be REALLY GREAT to have more effort go
>>>>> into the project. Yep, great enough to capitalize "REALLY" and "GREAT".
>>>>> Who has worked on the unit tests that are in place? I'll admit I
>>>>> haven't
>>>>> much except on the toolset and some of the framework unit tests and
>>>>> helping
>>>>> some of the Hotwax Media people who wrote many of the tests that now
>>>>> exist,
>>>>> especially the ones in the various applications.
>>>>> Is there anyone interested in working on this stuff? If there are
>>>>> enough
>>>>> people who want to actively work on it we can setup some coordination
>>>>> resources (ie Jira tasks, confluence pages, etc). If there are only 2-3
>>>>> then
>>>>> coordination through the mailing list would be better, and more visible
>>>>> to
>>>>> others possibly interested.
>>>>> -David
>>>>>
>>>>>  --
>>>> - Erwan -
>>>>
>>>>
>>>
>>
> --
> - Erwan -
>
Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

David E Jones
In reply to this post by Adam Heath-2

On Oct 31, 2008, at 9:06 AM, Adam Heath wrote:

> David E Jones wrote:
>>
>> One way or another we want to avoid dependencies between test  
>> cases. In
>> the case of data it means that no test case should depend on data
>> changes made in a previous test case. Using demo data isn't the thing
>> that's bad, it's changing something that another test case might  
>> depend on.
>>
>> The best way to fix this would be to have each test case clean up  
>> after
>> itself. This could involve saving data before changing it so that  
>> we can
>> change it back... or even better let the database do it since it  
>> already
>> supports that through rolling back a transaction...
>>
>> We may need to make some changes so that it is clear that the test
>> succeeded even though the transaction was rolled back (ie the test
>> runner needs to rollback the transaction, not the test case code  
>> itself).
>>
>> Does that sound like a reasonable approach?
>
> Nope.  Can't have nested/chained transactions, and this won't help the
> tests that do funky transaction stuff.

Yes, of course, those tests will have to use their own data.

Either way, the rule is the same, don't change stuff (including demo  
data) that other tests may depend on, and don't write a test that  
depends on changes from another test (if it's not in the same suite at  
least).

-David

Reply | Threaded
Open this post in threaded view
|

Re: OOTB Unit Tests (was Re: Stable trunk?)

Jacques Le Roux
Administrator
In reply to this post by Sharan-F
Hi Sharan,

Maybe you are already in a relationship directly with BJ. But, if I can allow myself, in respect to OFBiz project, what kind of
contribution would you envision ?

Thanks

Jacques

From: "Sharan-F" <[hidden email]>

>
> Hi BJ
>
> I've also been looking at testing from a user perspective (i.e. what they
> can see and do via the user interface). My method has been to take a high
> level process (eg Customer Sales) generate the use cases then break them
> down into detailed test scripts that follow an end to end flow.
>
> I'd be very interested in seeing what you've done and also finding out if
> any of the work I've done could be linked in as I'm keen to contribute to
> the project.
>
> Thanks
> Sharan
>
>
> BJ Freeman wrote:
>>
>> I have been slowly creating test more from a user input than testing code.
>> I think I can complete one that will work on the trunk for an example
>> and review.
>> target jan 09
>>
>> David E Jones sent the following on 10/29/2008 11:02 AM:
>>>
>>> On Oct 29, 2008, at 11:54 AM, Adam Heath wrote:
>>>
>>>> BJ Freeman wrote:
>>>>> there has been an effort to put in test units.
>>>>> the only thing lacking, in making it complete is manpower.
>>>>
>>>> And fixing the existing tests that are broken. :|
>>>
>>> This is an area where it would be REALLY GREAT to have more effort go
>>> into the project. Yep, great enough to capitalize "REALLY" and "GREAT".
>>>
>>> Who has worked on the unit tests that are in place? I'll admit I haven't
>>> much except on the toolset and some of the framework unit tests and
>>> helping some of the Hotwax Media people who wrote many of the tests that
>>> now exist, especially the ones in the various applications.
>>>
>>> Is there anyone interested in working on this stuff? If there are enough
>>> people who want to actively work on it we can setup some coordination
>>> resources (ie Jira tasks, confluence pages, etc). If there are only 2-3
>>> then coordination through the mailing list would be better, and more
>>> visible to others possibly interested.
>>>
>>> -David
>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Stable-trunk--tp20200392p20255065.html
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>

123