help

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

README

Testing singularity help content

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

Contributing new help tests

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

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

Updating existing help tests

For this example, we're going to update an existing test for singularity 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.

singularity 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.

SINGULARITY_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