-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add integration tests for Docker client and update CI workflow #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,6 +10,17 @@ jobs: | |||||||||||||
| test: | ||||||||||||||
| name: Run tests and collect coverage | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| services: | ||||||||||||||
| docker: | ||||||||||||||
| image: docker:dind | ||||||||||||||
| options: >- | ||||||||||||||
| --privileged | ||||||||||||||
| --health-cmd="docker ps" | ||||||||||||||
| --health-interval=10s | ||||||||||||||
| --health-timeout=5s | ||||||||||||||
| --health-retries=5 | ||||||||||||||
| volumes: | ||||||||||||||
| - /var/run/docker.sock:/var/run/docker.sock | ||||||||||||||
Matios102 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout | ||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||
|
|
@@ -24,10 +35,22 @@ jobs: | |||||||||||||
| - name: Install dependencies | ||||||||||||||
| run: go mod download | ||||||||||||||
|
|
||||||||||||||
| - name: Run tests | ||||||||||||||
| run: go test -coverprofile=coverage.txt ./... | ||||||||||||||
| - name: Run unit tests with coverage | ||||||||||||||
| run: go test -coverprofile=coverage-unit.txt -covermode=atomic ./... | ||||||||||||||
Matios102 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
| run: go test -coverprofile=coverage-unit.txt -covermode=atomic ./... | |
| run: go test -short -coverprofile=coverage-unit.txt -covermode=atomic ./... |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The merge coverage reports step could fail silently if one of the coverage files doesn't exist. Consider adding error checking to ensure both coverage files were generated before attempting to merge them:
- name: Merge coverage reports
run: |
if [ ! -f coverage-unit.txt ] || [ ! -f coverage-integration.txt ]; then
echo "Error: One or more coverage files are missing"
exit 1
fi
go install github.com/wadey/gocovmerge@latest
gocovmerge coverage-unit.txt coverage-integration.txt > coverage.txt| run: | | |
| run: | | |
| if [ ! -f coverage-unit.txt ] || [ ! -f coverage-integration.txt ]; then | |
| echo "Error: One or more coverage files are missing" | |
| exit 1 | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The health check command
docker pswill not work correctly with the Docker-in-Docker setup as configured. Inside thedocker:dindcontainer, thedockerCLI client may not be available or properly configured to connect to the daemon. The default health check fordocker:dindis typicallydockerd-healthcheckor you can usewget -O- http://localhost:2375/_pingif exposing the Docker API. Consider using the image's built-in health check or a more appropriate command.