Conversation
- Update TestValidateContainerImages to check Docker daemon status - Update TestValidateDockerImage to check Docker daemon status - Use isDockerDaemonRunning() function to match validation code behavior - Tests now properly skip when Docker daemon is not running (not just when binary is missing) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…-2e39-4864-a2cb-1717af641b03
There was a problem hiding this comment.
Pull request overview
This PR fixes failing integration tests in CI by adding Docker daemon status checks to test skip conditions. The tests were failing because Docker binary exists in CI but the daemon is not running, causing test execution to proceed and fail.
Changes:
- Added
isDockerDaemonRunning()checks toTestValidateContainerImagesandTestValidateDockerImagetest functions - Updated test skip logic to check both Docker binary availability AND daemon running status
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Also check if Docker daemon is running (not just if binary exists) | ||
| if !isDockerDaemonRunning() { | ||
| t.Skip("docker daemon not running, skipping test") |
There was a problem hiding this comment.
The same Docker daemon check should be applied to the tests in compiler_container_validation_test.go. The tests TestCompileWithInvalidContainerImage and TestCompileWithInvalidContainerValidationDisabled also check for Docker binary at lines 26-28 and 80-82 respectively, but don't verify the daemon is running. They will fail in CI with the same issue this PR fixes.
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| // Skip test if docker is not available | ||
| // Skip test if docker daemon is not running |
There was a problem hiding this comment.
The comment is slightly misleading. It says "Skip test if docker daemon is not running" but the code checks both Docker binary availability (line 68-70) AND daemon running status (line 72-74). Consider updating to "Skip test if docker is not available or daemon is not running" for accuracy.
| // Skip test if docker daemon is not running | |
| // Skip test if docker is not available or daemon is not running |
Fix TestValidateContainerImages integration test failure
The
TestValidateContainerImages/valid_container_imagetest is failing in CI because:exec.LookPath("docker"))isDockerDaemonRunning())Solution:
Updated both
TestValidateContainerImagesandTestValidateDockerImageto check if Docker daemon is running using the sameisDockerDaemonRunning()function that the validation code uses. This ensures consistent behavior between tests and production code.Changes:
pkg/workflow/validation_test.go: Added Docker daemon running check before executing container image validation testsPlan:
isDockerDaemonRunning()function from docker_validation.goOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.