Skip to content

Improve Docker test execution in CI workflow#3

Merged
Karib0u merged 4 commits intomainfrom
fix/ci-docker-test-improvements
Nov 11, 2025
Merged

Improve Docker test execution in CI workflow#3
Karib0u merged 4 commits intomainfrom
fix/ci-docker-test-improvements

Conversation

@Karib0u
Copy link
Copy Markdown
Owner

@Karib0u Karib0u commented Nov 11, 2025

Summary

  • Refactored Docker-based pytest execution to use docker create/start/stop lifecycle instead of docker run --rm
  • Added unique container naming using TEST_CONTAINER_NAME with GitHub run ID
  • Switched from volume mounts to docker cp for copying test files into container
  • Added cleanup step with always() condition to ensure container removal
  • Changed to python -m pytest for better module resolution

Benefits

  • Better control over container lifecycle
  • Guaranteed cleanup even on failure
  • Avoids potential volume mount permission issues
  • Unique container names prevent conflicts in concurrent runs

Test plan

  • Verify CI workflow runs successfully on this PR
  • Confirm pytest executes correctly inside Docker container
  • Check that container cleanup happens even on test failures

🤖 Generated with Claude Code

Karib0u and others added 4 commits November 11, 2025 14:50
Refactor the Docker-based pytest execution to use create/start/stop lifecycle
instead of run --rm. This approach provides better control and cleanup, and
uses docker cp to copy tests into the container rather than mounting volumes.

Changes:
- Add TEST_CONTAINER_NAME env variable with unique run ID
- Use docker create/start/stop pattern instead of docker run
- Copy tests with docker cp instead of read-only volume mounts
- Add always() cleanup step to ensure container removal
- Switch to python -m pytest for better module resolution

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add linux/amd64 and linux/arm64 platform support to the build-test job
to match the configuration used in build-release and build-develop jobs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Changed from multi-platform (linux/amd64,linux/arm64) to linux/amd64 only
for the build-test job because the docker exporter doesn't support loading
manifest lists locally. Since this job needs to run containers for testing,
it must use load: true, which is incompatible with multi-platform builds.

The build-release and build-develop jobs still build for both platforms.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added an empty entrypoint to the Docker container creation step in the CI workflow to ensure proper execution of pytest. This change enhances the control over the container's behavior during testing.
@Karib0u Karib0u merged commit 6939229 into main Nov 11, 2025
5 checks passed
@Karib0u Karib0u deleted the fix/ci-docker-test-improvements branch November 11, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant