Gentoo Archives: gentoo-portage-dev

From: Jason Stubbs <jasonbstubbs@×××××××××××.com>
To: gentoo-portage-dev@g.o
Subject: [gentoo-portage-dev] Portage Modularisation
Date: Thu, 27 Nov 2003 09:08:01
Message-Id: 200311271807.45306.jasonbstubbs@mailandnews.com
In Reply to: [gentoo-portage-dev] Re: [gentoo-dev] Web-based Portage Frontendg by Jason Mobarak
1 On Thursday 27 November 2003 17:42, Jason Mobarak wrote:
2 > On 17:03 Thu 27 Nov , Jason Stubbs wrote:
3 > > Okay, so the unit tests are more for the separation of portage rather
4 > > than the> documentation of it. I did a little search on the definition of
5 > > unit test and found "Controlled evaluation performed by a system
6 > > programmer in the Development step to ensure that a piece of program code
7 > > performs as defined in the specification". Hence, my question. Now, I
8 > > understand what you want.
9 >
10 > To define unit tests with more precision I'll give a portage example --
11 > carpaski changes massive amounts of global variables, moving them around so
12 > that the portage module isn't dependant on modifying globals (which is a
13 > *very* *very* bad practice in python, you should always know where
14 > variables are being modified and not have "procedures" that modify stuff in
15 > the global namespace, or any other namespace except the most immediate one
16 > -- saves headaches and makes for saner code). These changes to reliance on
17 > globals variables has the potential of breaking many facets of portage the
18 > API, so you need a set of tests that spans across all of portage and
19 > effectively tests everything for proper behaviour, if a failure is
20 > encounter it can be quickly located and diagnosed.
21 >
22 > Somethings you need to do to get up to speed on unit tests:
23 >
24 > 1) Read the documentation for the unittest module in the Python standard
25 > library.
26 > 2) Read http://pyunit.sourceforge.net/pyunit.html
27 > 3) Get a CVS CO of Twistedmatrix.com's CVS and look over how they do there
28 > unit tests, they use their own implementation of unittest but the
29 > differences are minor
30
31 Will research up on that.
32
33 > > I can checkout your module by CVS daily and then send you patches if you
34 > > like.
35 >
36 > This is kind of going to be PITA, we need CVS, sometime in the future I'll
37 > find out if we can get you a developer account, but for the time being if
38 > you have a dedicated server that you can set up CVS on that'd be great,
39 > otherwise I can set you up with an account on my machine
40 > (shamash.eece.unm.edu) which is on a university network and "always on and
41 > reliable". Shamash has CVS and we can set up a portage module on there and
42 > I'll do regular commits of our combined changes to gentoo-src.
43
44 I have a machine that is always on and connected but is not publicly
45 accessible. If you could set that up with shamash that would be great.
46
47 > > b) You document and separate and I unit test what has been completed.
48 >
49 > I like (b),
50
51 Okay. Will research unit tests quicker. ;-)
52
53 > > BTW, will this work become redundant by portage-ng?
54 >
55 > I hope after portage is separated into a library the code can be
56 > incorporated into "portage-ng", we could very well be working on the
57 > beginnings of the next generation of portage. I want to add "layers" to how
58 > everything interacts, key design patterns being heavy focusing on "plug-in"
59 > orientation and
60 > model-view-control. Some keywords you should research if you are interested
61 > in this are Mix-In style programming and the use of interfaces to abstract
62 > aggregate interaction between sections of a program.
63 >
64 > "Portage-ng" is being touted as a complete rewrite currently (from what I
65 > remember) and it seems senseless to throw away the 10k lines of code that
66 > make up the current portage system.
67
68 That's good to hear. Otherwise would be a bit demotivating...
69
70 > Also, please subscribe to the "gentoo-portage-dev" mailing list. I am going
71 > to CC this message to the mailing list.
72
73 Was already there. Even without a role in the development, I still like to
74 know what's going on. ;-)
75
76 Regards,
77 Jason Stubbs
78
79 --
80 gentoo-portage-dev@g.o mailing list