[Libre-soc-bugs] [Bug 441] Avoid unit tests that depend on other unit tests being run first

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sun Jul 26 10:23:39 BST 2020


https://bugs.libre-soc.org/show_bug.cgi?id=441

--- Comment #1 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #0)
> In:
> https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/fu/div/test/
> test_pipe_caller.py;h=16f0939bc3e4ac18c0b2829035450f7c2995c9e2;
> hb=8bf37997d31250126a664aeb3bd67ac0cd72a70c#l102
> 
> I specifically changed the class creating .test_data to not be built on
> unittest's infrastructure since the functions that add entries to test_data
> need to be run before the actual Simulator test case.

i know.  however you didn't add a comment explaining why that had been done. 
consequently i looked at it, went, "this will run the test twice, particularly
when run with nosetests3!!" and removed it.

it was only *in passing* on one of the daily updates that i noticed a comment
(which should have been in the code) explaining what the evaluation of the
dictionary of functions was doing.

so.

a) the names of all of those unit tests (the ones that add entries) need to
be changed to no longer start with the name "test_"

b) we need a base class for all of them (so as not to duplicate the accumulator
code)

c) what we are doing needs explanatory code-comments at all times!  this is how
we communicate "intent" and not end up at cross-purposes.

d) you identified (hooray) the existence of subTest which, because it was not
being used, caused the execution of the list of tests to stop at the first
error (which is annoying).  so all test_pipe_caller.py and test_compunit.py
need to call subTest.

i'll start on some of that this morning.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list