[Libre-soc-bugs] [Bug 441] New: 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 06:42:13 BST 2020


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

            Bug ID: 441
           Summary: Avoid unit tests that depend on other unit tests being
                    run first
           Product: Libre-SOC's first SoC
           Version: unspecified
          Hardware: Other
                OS: Linux
            Status: CONFIRMED
          Severity: enhancement
          Priority: ---
         Component: Source Code
          Assignee: lkcl at lkcl.net
          Reporter: programmerjake at gmail.com
                CC: libre-soc-bugs at lists.libre-soc.org,
                    programmerjake at gmail.com
   NLnet milestone: ---

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.

unittest (and testing infrastructure built to use it, such as nose3)
fundamentally assumes that all unit tests are independent of each other, which
allows them to be run in parallel, on different computers, or not even at all.

We should change the code back to not having the code constructing the list of
instructions to test be submitted to unittest.

This also should be done for all the other places the subtly incorrect code
that I tried to fix was copied to.

Basically, if the code which invokes unittest needs to be something more than
just:
if __name__ == "__main__":
    unittest.main()
then you're probably doing something wrong

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


More information about the libre-soc-bugs mailing list