From 671cf51d6d0b08c216a99696aa30f17faff5e653 Mon Sep 17 00:00:00 2001 From: Filip Tehlar Date: Tue, 31 Jan 2023 10:34:18 +0100 Subject: hs-test: improve test infra - add support for building/running debug/release images - have one point of control (Makefile) - list all test cases Type: test Signed-off-by: Filip Tehlar Change-Id: I97949abc2fff85d7a2b3784122be159aeec72b52 --- extras/hs-test/README.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'extras/hs-test/README.rst') diff --git a/extras/hs-test/README.rst b/extras/hs-test/README.rst index 47d3a53ecbf..8d1ee3537b8 100644 --- a/extras/hs-test/README.rst +++ b/extras/hs-test/README.rst @@ -16,14 +16,16 @@ Anatomy of a test case **Prerequisites**: -* Tests use *hs-test*'s own docker image, so building it before starting tests is a prerequisite. Run ``sudo make`` to do so +* Install hs-test dependencies with ``make install-deps`` +* Tests use *hs-test*'s own docker image, so building it before starting tests is a prerequisite. Run ``make build[-debug]`` to do so * Docker has to be installed and Go has to be in path of both the running user and root * Root privileges are required to run tests as it uses Linux ``ip`` command for configuring topology **Action flow when running a test case**: -#. It starts with running ``./test``. This script is basically a wrapper for ``go test`` and accepts its parameters, - for example following runs a specific test: ``./test -run TestNs/TestHttpTps`` +#. It starts with running ``make test``. Optional arguments are VERBOSE, PERSIST (topology configuration isn't cleaned up after test run), + and TEST= to run specific test. +#. ``make list-tests`` (or ``make help``) shows all test names. #. ``go test`` compiles package ``main`` along with any files with names matching the file pattern ``*_test.go`` and then runs the resulting test binaries #. The go test framework runs each function matching :ref:`naming convention`. Each of these corresponds to a `test suite`_ -- cgit 1.2.3-korg