Brad Hall wrote: > Hi, > > Link to CR: http://cr.opensolaris.org/~bhall/bug-2690/ > Link to BUG: http://defect.opensolaris.org/bz/show_bug.cgi?id=2690 > > This changes the depot startup/shutdown for the test suite so that it is done > once per class instead of once for each test in each class. I added a > variable to the classes to denote whether this should be enabled for a given > class or not named 'static'. I couldn't think of a better name at the time so > I'm open to suggestions if people think that's a bad name for this :) So, for > any "static" test class, the depot will only be started/shut down once (before > the first test case, after the last one).
You might want to add a small comment above each place you declare static -- or change the variable name to something more obvious such as "create_depot" with values "once" or "every_test". > The reults of doing this change the run time of cli-complete.py (cli tests) > from 270 seconds to 170 seconds, which starts to matter if you end up running > the test suite fairly often. A contributing portion of that comes from the UUID generation that is performed at startup now (sorry folks). FYI. > The caveat here being that this creates some issues for test cases if they > depend on the depot not having some state. For example if test_func1 adds > some packages to a repo and then test_func2 expects to have an empty repo, > there will be problems. I had to reorganize some tests to cope with this but > it may be more problematic in the future. This is indeed worth noting. General comments: http://cr.opensolaris.org/~bhall/bug-2690/src/tests/cli/testutils.py.wdiff.html I'd just remove the commented code in here. If we need the history, it's in the repository. pkg5unittest.py: ========== 49 + if result is None: result = self.defaultTestResult() Nitpick: newline after ':'. 209 + To make a test class into a static one, add a class variable: Nitpick: s/a class variable/this class variable declaration:/ Cheers, -- Shawn Walker _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
