help

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

README

Testing apptainer help content

This package contains the end-to-end tests for apptainer help.

Contributing new help tests

For this example, we're going to create a new test for apptainer help inspect.

  • Add the help text to the testdata/help directory.
apptainer help inspect > e2e/testdata/help/help-inspect.txt
  • Add the help command to the helpContentTests struct in help.go
var helpContentTests = []struct {
        cmds []string
}{
	...
	// apptainer inspect
	{[]string{"help", "inspect"}},
	...
}	

Updating existing help tests

For this example, we're going to update an existing test for apptainer help inspect.

  • When a help test fails, we need to check why it failed.

    • Was the failure a result of an unintended change? If so, we open an issue.
    • Was the failure a result of an intended change? If so, we update the help text.
  • Update the help text in the testdata/help directory.

apptainer help inspect > e2e/testdata/help/help-inspect.txt

Running the help tests

To verify this test, modify the Makefile to add both a verbose flag and a filter flag (go test -v -r helpContentTests) and then run the tests.

APPTAINER_E2E=1 make -C builddir e2e-test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func E2ETests

func E2ETests(env e2e.TestEnv) testhelper.Tests

E2ETests is the main func to trigger the test suite

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL