FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 08-13-2012, 04:36 PM
"Brian C. Lane"
 
Default Location for unittests - was: add couple of tests and support for them

On Fri, Aug 10, 2012 at 04:52:34AM -0400, Martin Sivak wrote:
> Hi,
>
> > Could you add all tests into the top-level tests/ directory? I don't
> > really like mixing tests and code into the same structure.
>
> This is for longer discussion. I don't like navigating separate (and different) directory structure to find the file with the proper unittest to modify.
>
> And since nobody was maintaining the tests we did with tmlcoch, I think having the tests for file.py in file_test.py makes people realize they should take a look at that file when the code is updated or moved somewhere.
>
> Test execution is handled by python-nose and it doesn't care about where the file is. On the other hand, importing the file under test is much much easier this way (it won't import all the package inits along the way, which is good - unittests are about unit isolation).
>
> Packaging is still OK as we can do rm *_test.py* in the install phase.
>
> David asked me to take care about the unittesting infrastructure and this is my proposal.

I like tests to be in their own directory tree. They make the core
source directories harder to read when you add _test.py to every file
that's already in there and I think it also helps keep some separation
between tests and the code.

I think the most useful thing we can do (other than better upkeep of the
tests) is integration of the test run into the build process, during
make release and rpm's %check section.

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-14-2012, 08:10 AM
Vratislav Podzimek
 
Default Location for unittests - was: add couple of tests and support for them

On Mon, 2012-08-13 at 09:36 -0700, Brian C. Lane wrote:
>
> I like tests to be in their own directory tree. They make the core
> source directories harder to read when you add _test.py to every file
> that's already in there and I think it also helps keep some separation
> between tests and the code.
>
> I think the most useful thing we can do (other than better upkeep of the
> tests) is integration of the test run into the build process, during
> make release and rpm's %check section.
That would definitely force us to update tests along with the patches.
But it will also cause many build fails and I am afraid we cannot afford
such problems in these days.

For me, the idea of having _test.py file next to the source file looks
good. I think it brings more advantages than disadvantages (there seems
to be only one).
And couldn't git help us with the "mess in files problem"? I was
thinking about separate *-tests branches for the tests, that would
contain also the _test.py files. But it would likely be hard to merge
e.g. master changes to master-tests. Any other ideas?

--
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-14-2012, 05:02 PM
"Brian C. Lane"
 
Default Location for unittests - was: add couple of tests and support for them

On Tue, Aug 14, 2012 at 10:10:51AM +0200, Vratislav Podzimek wrote:
> On Mon, 2012-08-13 at 09:36 -0700, Brian C. Lane wrote:
> >
> > I like tests to be in their own directory tree. They make the core
> > source directories harder to read when you add _test.py to every file
> > that's already in there and I think it also helps keep some separation
> > between tests and the code.
> >
> > I think the most useful thing we can do (other than better upkeep of the
> > tests) is integration of the test run into the build process, during
> > make release and rpm's %check section.
> That would definitely force us to update tests along with the patches.
> But it will also cause many build fails and I am afraid we cannot afford
> such problems in these days.

You wouldn't need to fail a build. Just run them and get used to seeing
the results.

>
> For me, the idea of having _test.py file next to the source file looks
> good. I think it brings more advantages than disadvantages (there seems
> to be only one).
> And couldn't git help us with the "mess in files problem"? I was
> thinking about separate *-tests branches for the tests, that would
> contain also the _test.py files. But it would likely be hard to merge
> e.g. master changes to master-tests. Any other ideas?

A separate branch would never stay in sync. We have a hard enough time
with the tests/ directory on-branch as it is

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 12:15 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org