Skip to content

Commit

Permalink
tests: Update checks
Browse files Browse the repository at this point in the history
  • Loading branch information
khalifaa55 committed Nov 15, 2024
1 parent 1c27d6d commit 81476f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions e2e/sedge/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,18 @@ func checkContainerRunning(t *testing.T, containerNames ...string) {

for _, containerName := range containerNames {
t.Logf("Checking %s container is running", containerName)
isRunning, err := dockerServiceManager.IsRunning(containerName)
require.NoError(t, err)
assert.True(t, isRunning, "%s container should be running", containerName)
if containerName == "oncall_db_migration" {
// For DB migration, we just check if it exists and completed
status, err := dockerServiceManager.ContainerStatus(containerName)
require.NoError(t, err)
assert.Contains(t, []int{1, 6}, int(status),
"%s container should be exited or created", containerName)
} else {
// For all other containers, check if they're running
isRunning, err := dockerServiceManager.IsRunning(containerName)
require.NoError(t, err)
assert.True(t, isRunning, "%s container should be running", containerName)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion e2e/sedge/monitoring_stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func skipIfNotAMD64(t *testing.T) {
}
}

var grafanaOnCallContainers = []string{"engine", "celery", "redis"}
var grafanaOnCallContainers = []string{"engine", "celery", "redis", "oncall_db_migration"}

// TestMonitoringStack_Init tests that the monitoring stack is not initialized if the user does not run the init-monitoring command
func TestE2E_MonitoringStack_NotInitialized(t *testing.T) {
Expand Down

0 comments on commit 81476f6

Please sign in to comment.