Skip to content

Commit 5fff7bb

Browse files
Add integration tests for 'tiger service logs'
1 parent 84bef1d commit 5fff7bb

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

internal/tiger/cmd/integration_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,33 @@ func TestServiceLifecycleIntegration(t *testing.T) {
272272
t.Logf("Service status: %v", service.Status)
273273
})
274274

275+
t.Run("ServiceLogs", func(t *testing.T) {
276+
if serviceID == "" {
277+
t.Skip("No service ID available from create test")
278+
}
279+
280+
t.Logf("Fetching logs for service: %s", serviceID)
281+
282+
output, err := executeIntegrationCommand(
283+
t.Context(),
284+
"service", "logs", serviceID,
285+
)
286+
287+
if err != nil {
288+
t.Fatalf("Service logs failed: %v\nOutput: %s", err, output)
289+
}
290+
291+
// Verify at least one expected log line is present
292+
// PostgreSQL services should have logs about starting the database
293+
if !strings.Contains(output, "starting PostgreSQL") &&
294+
!strings.Contains(output, "database system is ready") &&
295+
!strings.Contains(output, "PostgreSQL") {
296+
t.Errorf("Expected to see PostgreSQL-related log lines in output: %s", output)
297+
}
298+
299+
t.Logf("✅ Service logs fetched successfully")
300+
})
301+
275302
t.Run("DatabasePsqlCommand_OriginalPassword", func(t *testing.T) {
276303
if serviceID == "" {
277304
t.Skip("No service ID available from create test")

0 commit comments

Comments
 (0)