<br><tt><font size=2>testtools-bounces@list.coin-or.org wrote on 01/16/2009
07:51:48 AM:<br>
<br>
&gt; Gents,<br>
&gt; <br>
&gt; &nbsp; &nbsp;JP and I have been exchanging emails about BuildDirSuffix,
and he's been<br>
&gt; persistent enough to convince me that there's a possibility of accidental<br>
&gt; persistence from one build to the next. &nbsp;I'm testing out a fix
(pop the value<br>
&gt; from configuration if it's not specified for a given build). &nbsp;But
it<br>
&gt; seems to me<br>
&gt; the problem really lies in the way that the main loop of <br>
&gt; nightlyBuild assembles<br>
&gt; a configuration. We're in nightlyBuild.py.<br>
&gt; <br>
&gt; &nbsp; &nbsp;Where it says `Define loop invariant configuration values',
we<br>
&gt; initialise a map (configuration) and a set of sets (configurations).
Prior to<br>
&gt; entering the loop on projects, some persistent keys (rootDir,<br>
&gt; buildMethod) are set in configuration, to be used by all projects.<br>
&gt; <br>
&gt; &nbsp; &nbsp;Now we enter the project loop (`Loop once for each project
...'). &nbsp;We<br>
&gt; set two more keys, project and `clear previous build', to be used
<br>
&gt; for all builds<br>
&gt; of a project. (Arguably, `clear previous build' should be handled
as a <br>
&gt; persistent key, since it's initialised from a global variable.)<br>
&gt; <br>
&gt; &nbsp; &nbsp;Now we enter the build loop, processing the builds specified
for the<br>
&gt; project. We fill in a whole bunch more keys in configuration. Eventually,
we<br>
&gt; check to see if configuration is already in configurations. If not,
<br>
&gt; we process <br>
&gt; it (NBbuildConfig.run) and record it in configurations.<br>
&gt; <br>
&gt; &nbsp; &nbsp;Now, it seems to me that at this point the logical thing
to do is clear<br>
&gt; configuration back to an empty map and start over to fill in configuration
for<br>
&gt; the next build, but that doesn't happen. &nbsp;The consequence is
that once a<br>
&gt; key:value pair is added to configuration, it persists until explicitly
removed<br>
&gt; or changed. &nbsp;This is not safe. &nbsp;I'd like to propose something
a bit different,<br>
&gt; but fairly close to what now exists.</font></tt>
<br>
<br><tt><font size=2>Sounds like a prudent thing to do.</font></tt>
<br>
<br><tt><font size=2><br>
&gt; <br>
&gt; &nbsp; &nbsp;There are three classes of keys in a configuration: &nbsp;top-level
(for all<br>
&gt; projects), project-level (for all builds of a project), and build-<br>
&gt; level (for an<br>
&gt; individual build). &nbsp;Right now, rootDir and buildMethod are handled
<br>
&gt; as top-level,<br>
&gt; project and `clear previous build' are handled as project-level, and
all the<br>
&gt; rest are (or should be) handled as build-level.<br>
&gt; <br>
&gt; &nbsp; &nbsp;Why not make this explicit, by creating two new variables,<br>
&gt; top_configuration and project_configuration. &nbsp;These get loaded
at the places<br>
&gt; where top-level and project-level keys are processed now.<br>
&gt; <br>
&gt; &nbsp; &nbsp;Then, in the inner loop (`for bc in buildConfigs'), the
first action<br>
&gt; is to clear configuration and load it with the values from <br>
&gt; top_configuration and <br>
&gt; project_configuration. This should prevent accidental carry-over.</font></tt>
<br>
<br><tt><font size=2>You have obviously studied and thought about the code
more than myself.</font></tt>
<br><tt><font size=2>From my perspective it sort of grew and had more things
patched into it (as I learned and experimented more with python).</font></tt>
<br>
<br><tt><font size=2>The changes you suggest are fine with me.</font></tt>
<br>
<br><tt><font size=2>If you would feel more comfortable not making bigger
changes trunk, feel free to make a copy in branches.</font></tt>
<br><tt><font size=2>I could then check out the branches and run a test
on the 4 platforms where I currently nightlyBuild.</font></tt>
<br><tt><font size=2>But I think it is OK to make changes in trunk.</font></tt>
<br><tt><font size=2>After all, there aren't many people using nightlyBuild.</font></tt>
<br><tt><font size=2><br>
&gt; <br>
&gt; &nbsp; &nbsp;Documentation and code comments should be updated to
reflect the three <br>
&gt; classes of parameters. As an added benefit, the user could override
top-level <br>
&gt; and project-level keys in a build configuration, should s/he so desire.</font></tt>
<br>
<br><tt><font size=2>More documentation is of course good.<br>
&gt; &nbsp; &nbsp;<br>
&gt; &nbsp; &nbsp;You guys will regret dragging me into this ... &nbsp;
:-)</font></tt>
<br>
<br><tt><font size=2>No &amp; No.</font></tt>
<br><tt><font size=2>I most certainly don't regret it.</font></tt>
<br><tt><font size=2>I don't really think you feel dragged into this either
(at least I hope not).</font></tt>
<br>
<br><tt><font size=2><br>
&gt; &nbsp; &nbsp;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;Lou<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; Testtools mailing list<br>
&gt; Testtools@list.coin-or.org<br>
&gt; http://list.coin-or.org/mailman/listinfo/testtools<br>
</font></tt>