<div dir="ltr">Or maybe we should just code teardown so that if setup isn't  called, we don't do teardown either.  Lots of times I see people say "just include basesuite for X method" and since I don't need whatever its setup does, I don't call it in my setup  I don't think that's a programmer error, per se.</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 15, 2015 at 7:39 AM roger peppe <<a href="mailto:rogpeppe@gmail.com">rogpeppe@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It shouldn't be hard to write some code (using go/types) that<br>
automatically checks<br>
for these invariants.<br>
<br>
<br>
On 15 July 2015 at 07:05, John Meinel <<a href="mailto:john@arbash-meinel.com" target="_blank">john@arbash-meinel.com</a>> wrote:<br>
><br>
><br>
> On Wed, Jul 15, 2015 at 2:44 AM, Bogdan Teleaga<br>
> <<a href="mailto:bteleaga@cloudbasesolutions.com" target="_blank">bteleaga@cloudbasesolutions.com</a>> wrote:<br>
>><br>
>> Hello everybody,<br>
>><br>
>> Lately I've been noticing a couple of failures regarding a new testing<br>
>> feature introduced on windows.<br>
>><br>
>> Without going into implementation details too deep the main idea is that<br>
>> whenever a new suite is created<br>
>> that inherits from a base suite and a SetUpX function is defined, it needs<br>
>> to call the SetUpX function of the<br>
>> base suite. The main reason would be that if that's not done we will not<br>
>> do set up for any test, but we will do<br>
>> a tear down. To some extent it might be worth it to add some annotations<br>
>> to the failure message, since it might<br>
>> come up more often and it is not immideately obvious why.<br>
><br>
><br>
> That's certainly an expectation of any sort of function that a type<br>
> overloads from an embedded type. If people are overriding SetUp and not<br>
> calling the embedded SetUp that's going to cause all sorts of bugs (we do<br>
> test suite isolation, logging changes, HOME directory setup in base types).<br>
> I'm actually surprised that things worked if people are doing so. I guess<br>
> some things like Isolation are things you don't notice until late, because<br>
> you end up with files littered where they shouldn't be.<br>
><br>
> John<br>
> =:-><br>
><br>
>><br>
>><br>
>> The bugs caused by this so far are:<br>
>> - <a href="https://bugs.launchpad.net/juju-core/+bug/1474382" rel="noreferrer" target="_blank">https://bugs.launchpad.net/juju-core/+bug/1474382</a><br>
>> - <a href="https://bugs.launchpad.net/juju-core/+bug/1471941" rel="noreferrer" target="_blank">https://bugs.launchpad.net/juju-core/+bug/1471941</a><br>
>><br>
>> Another issue is that a recent bugfix stopped CentOS completely from<br>
>> working.<br>
>> The series could not be detected anymore because the map was changed *and*<br>
>> the test that<br>
>> was using actual data from /etc/os-release was modified to mirror this<br>
>> change. Until we get the CI<br>
>> for CentOS up and running, but even as a general thing for that matter,<br>
>> please consider the old<br>
>> content of the tests and their intention before modyfing them to fit the<br>
>> changes in the code.<br>
>><br>
>> For more details on the CentOS bug:<br>
>> <a href="https://bugs.launchpad.net/juju-core/+bug/1470150" rel="noreferrer" target="_blank">https://bugs.launchpad.net/juju-core/+bug/1470150</a><br>
>><br>
>> And that would be all for now, I'll let you get back to the other hundred<br>
>> emails.<br>
>><br>
>> Thanks,<br>
>> Bogdan<br>
>><br>
>> --<br>
>> Juju-dev mailing list<br>
>> <a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a><br>
>> Modify settings or unsubscribe at:<br>
>> <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
>><br>
><br>
><br>
> --<br>
> Juju-dev mailing list<br>
> <a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a><br>
> Modify settings or unsubscribe at:<br>
> <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
><br>
<br>
--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
</blockquote></div>