Documentation ¶
Index ¶
- func AssertFileInTar(t testing.TB, tr *tar.Reader, expected ExpectedFile)
- func AssertFilesInTar(t testing.TB, tr *tar.Reader, expectedFiles []ExpectedFile, ...)
- func AssertIsNotExist(t *testing.T, err error)
- func CtxAndAnalyticsForTest() (context.Context, *analytics.MemoryAnalytics, *tiltanalytics.TiltAnalytics)
- func FailOnNonCanceledErr(t testing.TB, err error, message string)
- func ForkedCtxAndAnalyticsForTest(w io.Writer) (context.Context, *analytics.MemoryAnalytics, *tiltanalytics.TiltAnalytics)
- func ForkedCtxAndAnalyticsWithOpterForTest(w io.Writer, o tiltanalytics.AnalyticsOpter) (context.Context, *analytics.MemoryAnalytics, *tiltanalytics.TiltAnalytics)
- func IsNotExistMessage() string
- func Setenv(t testing.TB, key, value string)
- func Unsetenv(t testing.TB, key string)
- type Clock
- type ExpectedFile
- type FakeClock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertFileInTar ¶
func AssertFileInTar(t testing.TB, tr *tar.Reader, expected ExpectedFile)
Asserts whether or not this file is in the tar.
func AssertFilesInTar ¶
func AssertFilesInTar(t testing.TB, tr *tar.Reader, expectedFiles []ExpectedFile, msgAndArgs ...interface{})
Asserts whether or not these files are in the tar, but not that they are the only files in the tarball.
func AssertIsNotExist ¶ added in v0.14.0
Asserts the given error indicates a file doesn't exist. Uses string matching instead of type-checking, to workaround libraries that wrap the error.
func CtxAndAnalyticsForTest ¶ added in v0.9.5
func CtxAndAnalyticsForTest() (context.Context, *analytics.MemoryAnalytics, *tiltanalytics.TiltAnalytics)
CtxAndAnalyticsForTest returns a context.Context suitable for use in tests (i.e. with logger & analytics attached), and the analytics it contains.
func FailOnNonCanceledErr ¶ added in v0.14.0
func ForkedCtxAndAnalyticsForTest ¶ added in v0.9.5
func ForkedCtxAndAnalyticsForTest(w io.Writer) (context.Context, *analytics.MemoryAnalytics, *tiltanalytics.TiltAnalytics)
CtxForTest returns a context.Context suitable for use in tests (i.e. with logger attached), and with all output being copied to `w`
func ForkedCtxAndAnalyticsWithOpterForTest ¶ added in v0.9.5
func ForkedCtxAndAnalyticsWithOpterForTest(w io.Writer, o tiltanalytics.AnalyticsOpter) (context.Context, *analytics.MemoryAnalytics, *tiltanalytics.TiltAnalytics)
func IsNotExistMessage ¶ added in v0.14.0
func IsNotExistMessage() string
Types ¶
type ExpectedFile ¶
type ExpectedFile struct { Path string Contents string // If true, we will assert that the file is not in the tarball. Missing bool // If true, we will assert the file is a dir. IsDir bool // If true, we will assert that UID and GID are 0 AssertUidAndGidAreZero bool // If true, we will assert that this is a symlink with a linkname. Linkname string // If non-zero, assert that file permission and mode bits match this value Mode int64 // Windows filesystem APIs don't expose an executable bit. // So when we create docker images on windows, we set the executable // bit on all files, for consistency with Docker. HasExecBitWindows bool }
Click to show internal directories.
Click to hide internal directories.