-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Major Rewrite #6
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: main
Are you sure you want to change the base?
Conversation
larkinwc
commented
Jun 17, 2025
- Adds an extensive testing framework
- Fixes some execution issues that existed in the main logic
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.
Pull Request Overview
This PR implements a major rewrite of the integration testing framework and addresses execution issues in the core commands.
- Introduces a suite of Docker-based LXC integration test scripts (basic, mock, hybrid, advanced, etc.)
- Updates CI workflow to build and run integration tests in multiple environments
- Refactors
up/downcommands to use a default config file when none is specified
Reviewed Changes
Copilot reviewed 54 out of 54 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| integration-test/docker-lxc/run-integration-tests.sh | Adds a full end-to-end LXC integration test runner script |
| cmd/lxc-compose/up.go | Refactors up command to load default config and remove old compose conversion |
| cmd/lxc-compose/down.go | Refactors down command to accept --file flag and default config |
| .github/workflows/integration-test.yml | New CI job matrix to build, test, and publish binaries and Docker images |
Comments suppressed due to low confidence (5)
cmd/lxc-compose/up.go:33
- Remove the commented-out block that converts to
common.ComposeConfig, since it’s dead code andcfgis used directly now.
// Convert to compose config type
cmd/lxc-compose/down.go:15
- The
configFilevariable declared insideinitshadows the package-level flag. Consider renaming or hoisting it to avoid confusion.
var configFile string
integration-test/docker-lxc/run-integration-tests.sh:67
- On cleanup verification, the script only warns when containers remain but does not fail. Consider exiting with non-zero status if leftovers are detected to surface test failures.
if lxc-ls | grep -E "(web|db)"; then
integration-test/docker-lxc/mock-lxc-test.sh:41
- Piping output and using
|| truesuppresses errors. For critical workflows, capture and assert expected outputs or exit codes instead of always returning success.
LXC_MOCK_MODE=true /var/tmp/lxc-compose-mock --config lxc-compose.yml up web 2>&1 | head -10 || true
.github/workflows/integration-test.yml:5
- Pull requests against feature branches (e.g.
feat/*) won’t trigger CI becausepull_requestis only set formainanddevelop. Consider addingfix/*topull_request.branchesfor consistent testing.
branches: [ main, develop, fix/* ]
…n loading - Updated `down.go` and `up.go` to load configuration from the new `config` package instead of the deprecated `common` package. - Removed `types.go` and `device.go` from the `common` package, consolidating validation logic into the new `validation` package. - Adjusted related tests and container management code to reflect the new structure and ensure compatibility with the updated configuration handling.
- Added error logging for missing specified config files in `initConfig`. - Updated `ps` command to load and validate configuration from a specified file, defaulting to `lxc-compose.yml`. - Included configuration validation in the `up` command to ensure proper setup before container management. - Enhanced integration tests to check for invalid configuration handling. - Updated example `lxc-compose.yml` to include versioning for better compatibility.
- Introduced `test-init-fix.sh` for testing init system detection and container setup. - Added `test-simple.yml` for a simple container configuration. - Refactored container manager creation to support backend selection in `down.go`, `logs.go`, `pause.go`, `ps.go`, `unpause.go`, and `up.go`. - Implemented `manager_factory.go` to handle backend-specific container manager instantiation. - Added `pct_manager.go` as a placeholder for Proxmox `pct` commands, with basic container management functions. - Enhanced `LXCManager` with improved logging and configuration generation for better container initialization.
- Introduced `IMPLEMENTATION_STATUS.md` to document completed tasks and future priorities for Proxmox PCT integration. - Implemented `PCTManager` with full support for container management operations: Create, Remove, List, Start, Stop, etc. - Enhanced CLI with `--backend` flag for backend selection, maintaining backward compatibility with LXC. - Updated type system with new fields and extended `Manager` interface. - Established testing infrastructure for PCT manager, including basic tests for functionality and integration with CLI commands. - Refactored existing tests to accommodate changes in configuration handling and validation.