Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CI ¶
func CI() string
CI tries to detect if the test is being run on a CI server. If so, a string identifying the CI is returned. The current implementation reports as follows: - GitHub Actions: "github" - No CI: ""
func LogBuffer ¶
LogBuffer redirects output from the builtin logger to a new buffer and returns this buffer.
func MakeDirAccessible ¶
MakeDirAccessible is a noop except when running on Windows. On Windows, it makes the directory on the provided path fully accessible to the user running the test by invoking 'icacls'. This is necessary to allow the test to delete the temporary directory after having made it inaccessible using MakeDirInaccessible.
func MakeDirInaccessible ¶
MakeDirInaccessible makes the directory at the provided path non-readable to the user running the test. On Unix, this is done by zeroing the permission bits. On Windows, this method can only be used to control the "write" flag (https://golang.org/pkg/os/#Chmod), so we invoke 'icacls' to deny access. The function is only intended to be used on temporary directories that get deleted as part of cleaning up after the test. Use MakeDirAccessible to make the directory deletable.
func MakeFileInaccessible ¶
MakeFileInaccessible makes the provided file non-readable to the user running the test. On Unix, this is done by zeroing the permission bits. On Windows, this method can only be used to control the "write" flag (https://golang.org/pkg/os/#Chmod), so we invoke 'icacls' to deny access. The function is only intended to be used on temporary files that get deleted as part of cleaning up after the test. On none of the tested platforms does it prevent deletion of the file that it has been made inaccessible.
Types ¶
This section is empty.