MCPcopy
hub / github.com/slimtoolkit/slim / TestSensorLogsGoToFile

Function TestSensorLogsGoToFile

pkg/app/sensor/app_test.go:190–208  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

188}
189
190func TestSensorLogsGoToFile(t *testing.T) {
191 runID := newTestRun(t)
192 ctx := context.Background()
193
194 sensor := testsensor.NewSensorOrFail(
195 t, ctx, t.TempDir(), runID, imageSimpleCLI,
196 testsensor.WithSensorLogsToFile(),
197 )
198 defer sensor.Cleanup(t, ctx)
199
200 sensor.StartStandaloneOrFail(t, ctx, []string{"echo", "123456879"})
201 sensor.WaitOrFail(t, ctx)
202
203 sensor.AssertTargetAppLogsEqualTo(t, ctx, "123456879")
204
205 // When WithSensorLogsToFile() is used, sensor's logs become part of artifacts.
206 sensor.DownloadArtifactsOrFail(t, ctx)
207 sensor.AssertSensorLogsContain(t, ctx, sensorFullLifecycleSequence...)
208}
209
210func TestAppStdoutToFile(t *testing.T) {
211 runID := newTestRun(t)

Callers

nothing calls this directly

Calls 7

newTestRunFunction · 0.85
StartStandaloneOrFailMethod · 0.80
WaitOrFailMethod · 0.80
CleanupMethod · 0.45

Tested by

no test coverage detected