Skip to content

Commit

Permalink
Remove duplicated test code from test_dm
Browse files Browse the repository at this point in the history
The TestDM and TestDMParallel classes were almost identical copies of
each other (with the former being the "source" of the latter, since it
was the one that existed first), with two main differences: firstly,
TestDM has an additional test_run_invalid_shmem_graph test; and
secondly, the number of threads they use to start the NMs in their tests
is different, with TestDM always using the default (0), and
TestDMParallel using the number of available CPUs, with some small
alterations.

Instead of copying the whole body of the tests, it's better from
a maintainability point of view if we avoid this code duplication, and
instead reuse the same code for both tests. This commit does exactly
that: it creates a NodeManagerTestsBase class with all the common test
definitions, and relying on self.nm_threads being defined later on, and
then subclass it with TestDM and TestDMParallel, each of which provides
its own self.nm_threads definition. In addition, TestDM contains its own
additional test.

This work is part of YAN-974.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed May 6, 2022
1 parent 020be3a commit 91d6c28
Showing 1 changed file with 15 additions and 448 deletions.
Loading

0 comments on commit 91d6c28

Please sign in to comment.