Gentoo Archives: gentoo-portage-dev

From: "Michael A. Smith" <michael@××××××××.com>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] Re: equery refactorization
Date: Sun, 07 Dec 2008 03:34:06
Message-Id: 493B4428.50907@smith-li.com
In Reply to: Re: [gentoo-portage-dev] Re: equery refactorization by Douglas Anderson
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Let me rephrase:
5
6 The tests as they are written are not all that helpful or functional. Therefore
7 I'm refactoring them so that they are. If I don't, they won't be any good at all.
8
9 These are not sophisticated tests that comprehensively review your code. They
10 simply do some sanity checks on the output of equery.
11
12 - -Michael
13
14 Douglas Anderson wrote:
15 | On Sun, Dec 7, 2008 at 12:02 PM, Michael A. Smith <michael@××××××××.com> wrote:
16 |> -----BEGIN PGP SIGNED MESSAGE-----
17 |> Hash: SHA1
18 |>
19 |> Regarding gentoolkit/trunk/src/equery/tests
20 |>
21 |> I discovered all the test kit that's in equery, and have been refactoring
22 |> 'em.
23 |> They're written in bash, not python, so they're a candidate for some kind of
24 |> python unit testing. Right now, however, that's not a priority for me, so
25 |> I'm
26 |> just making the bash cleaner and hopefully faster and more maintainable. I
27 |> think it'll be helpful as we refactor.
28 |>
29 |> The question is, how maintainable are the "help" tests? These are tests that
30 |> try to confirm that the --help output of each module is correct. I think it
31 |> might be more work than it's worth to try to maintain those...
32 |>
33 |> Thoughts?
34 |
35 | I know some people like to write the tests and then write the code to
36 | match, but I don't think it's a good idea for you to refactor the
37 | tests as I'm refactoring the codebase :)
38 |
39 | Especially since I'm chopping and moving things, renaming functions,
40 | etc, as long as I think it'll help in the long term.
41 |
42 | I even changed the format of the help output ;) Why? Because we have
43 | two user-oriented tools with a similar "modular" design, equery and
44 | eselect, and yet they have a totally different naming scheme and
45 | behave quite differently. It's unnecessarily confusing so I tried to
46 | make them more uniform (I'll upload some code shortly). I always
47 | though equery's --help was cluttered and confusing. A complete
48 | overview is what `man equery' is for, IMHO.
49 |
50 | I also changed the way equery handles input slightly. For example this
51 | I think is unnecessarily lenient and in the end confusing, because it
52 | goes against what most other tools do (raise an exception):
53 |
54 | $ equery -q -i list mozilla-firefox
55 | !!! unknown global option -i, reusing as local option
56 |
57 | So, I don't think we should be working on the tests until we have most
58 | of the code refactored, but I re-extend my invitation for help on that
59 | because there's quite a bit to do!
60 |
61 | -Doug
62 |
63 |
64
65 -----BEGIN PGP SIGNATURE-----
66 Version: GnuPG v2.0.9 (GNU/Linux)
67 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
68
69 iEYEARECAAYFAkk7RCgACgkQzwtr5yY0JZyPZQCgmpf9EH+D7ydzyg6RnMMHdAfj
70 KfsAn0jJnHshaIMLisc0XRtH9HsQZS5y
71 =nGdc
72 -----END PGP SIGNATURE-----

Replies

Subject Author
Re: [gentoo-portage-dev] Re: equery refactorization Douglas Anderson <dja@××××××.com>