I like the theory, but untangling VppTestCase seems like too much effort, which I will spend elsewhere.
This is a quick and usable solution which doesn’t disrupt it too much. Klement > On 18 Mar 2021, at 20:20, Paul Vinciguerra <pvi...@vinciconsulting.com> wrote: > > Hi Klement, > > I disagree with the implementation. Naveen proposed similar functionality a > while back. I objected to that for the same reason. > > It does not make sense to use a testcase written to popen an instance of vpp, > then mock out the vpp instance with dummy values and conditionally check and > skip the logic distributed across the class. > > To accomplish your goal, the baseclass should be refactored from the popen > code/logic. Your change would then use the baseclass and the CI would use > the subclass, or a mixin. > > If you look at the csit python code, they use a papi executor class. The test > cases depend on the vppapiclient and the stats client. They should be the > only dependencies in the base class, anything else is a concrete > implementation detail. > > Paul > > > > On Tue, Mar 16, 2021 at 12:35 PM Klement Sekera via lists.fd.io > <ksekera=cisco....@lists.fd.io> wrote: > Hi all, > > I implemented a new debug option for make test called ‘attach’. This has been > requested a couple of times over the last few months and while it has some > drawbacks, it also has advantages. > > It’s not merged yet. > > https://gerrit.fd.io/r/c/vpp/+/31663 > > As always make test-help is full of clues on how to use it. > > TLDR: > > window 1: make test-start-vpp-debug-in-gdb (set breakpoints, … whatever and > then run vpp from within gdb) > window 2: make test > TEST=test_nat44_ed.TestNAT44ED.test_outside_address_distribution > > NOTE: a lot of tests rely on having a fresh VPP, so repeat test runs without > restarting vpp are questionable at best. Running more than one test class > will most probably work only by accident. > NOTE #2: it doesn’t matter if it’s make test or make test-debug in window 2 > as the binary is selected in window 1. Use test-start-vpp-in-gdb to debug > release binary. > > Feedback is much appreciated. > > Regards, > Klement > >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#18972): https://lists.fd.io/g/vpp-dev/message/18972 Mute This Topic: https://lists.fd.io/mt/81380736/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-