Gentoo Archives: gentoo-portage-dev

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

Replies

Subject Author
[gentoo-portage-dev] Portage Modularisation Jason Stubbs <jasonbstubbs@×××××××××××.com>
Re: [gentoo-portage-dev] Re: [gentoo-dev] Web-based Portage Frontendg Jason Stubbs <jasonbstubbs@×××××××××××.com>