Implement testing framework with local, Docker & GitHub Actions#1
Open
thanhph111 wants to merge 11 commits intochezmoifrom
Open
Implement testing framework with local, Docker & GitHub Actions#1thanhph111 wants to merge 11 commits intochezmoifrom
thanhph111 wants to merge 11 commits intochezmoifrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Python-first test framework for the dotfiles repo (pytest + uv) with Docker/native execution modes, and wires it into mise tasks and GitHub Actions. It also updates bootstrap/scripts and templates to support explicit “secrets-enabled” gating for safer first-run applies.
Changes:
- Introduce pytest suites + helpers (tier/platform/profile/driver filtering, Docker runners, fixtures, artifacts).
- Add
mise run testorchestration with JUnit/HTML reporting and a Markdown summary generator. - Add GitHub Actions workflows (smoke/full) plus updates to bootstrap scripts and template secret-gating.
Reviewed changes
Copilot reviewed 42 out of 46 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Locks pytest + pytest-html and transitive deps for the new test tooling. |
pyproject.toml |
Adds dev dependency group for pytest tooling. |
mise.toml |
Pins Python tool version and adds xtest alias. |
.mise/tasks/test |
Adds a test runner task with tiers/platform/profile/driver and report generation. |
.mise/tasks/test-build-summary.py |
Adds JUnit → Markdown summary generator for CI step summary. |
.github/workflows/_tests-job.yml |
Adds reusable workflow job to run tests and upload artifacts. |
.github/workflows/tests-smoke.yml |
Adds smoke-tier CI workflow (Linux Docker + Windows native). |
.github/workflows/tests-full.yml |
Adds full-tier CI workflow (Linux Docker matrix + macOS/Windows native). |
tests/pytest.ini |
Defines pytest markers and discovery paths for the new test suites. |
tests/conftest.py |
Implements CLI options, selection/filter logic, and Docker/native enforcement. |
tests/README.md |
Documents how to run tests locally/CI and where reports/artifacts go. |
tests/helpers/artifacts.py |
Adds artifact directory creation + artifact writing helpers. |
tests/helpers/chezmoi.py |
Adds template rendering helpers (execute vs managed), profile→data, platform matching. |
tests/helpers/docker_cli.py |
Adds a minimal Docker runner abstraction for container-based tests. |
tests/helpers/matrix.py |
Adds TOML-driven profile/scenario matrix loader used by parametrized tests. |
tests/helpers/os_native.py |
Adds native host helpers for PowerShell/Bash syntax checks. |
tests/helpers/scripts.py |
Adds fixture script loader with placeholder substitution validation. |
tests/suites/test_static.py |
Adds shell/PowerShell parsing and config compile smoke tests. |
tests/suites/test_bootstrap.py |
Adds bootstrap script tests (mock + integration + native parse checks). |
tests/suites/test_templates.py |
Adds render-matrix and secrets-gating tests for selected templates. |
tests/suites/test_hooks.py |
Adds hook template rendering/parse tests (Docker + native CI variants). |
tests/docker/linux.Dockerfile |
Adds a Debian-based test image with chezmoi for Linux renders. |
tests/docker/powershell.Dockerfile |
Adds a PowerShell-based test image with chezmoi for Windows-script renders. |
tests/fixtures/profiles.toml |
Adds consolidated profile fixtures for the test matrix. |
tests/fixtures/scenarios/bootstrap.toml |
Adds bootstrap scenario cases. |
tests/fixtures/scenarios/templates.toml |
Adds template render scenario cases. |
tests/fixtures/config/chezmoi.test.toml |
Adds a fixed chezmoi config fixture for test renders. |
tests/fixtures/config/template-skiplist.txt |
Adds a placeholder skiplist file for template compile smoke. |
tests/fixtures/scripts/bash/static_shell_syntax.sh |
Adds bash syntax checking fixture script. |
tests/fixtures/scripts/bash/bootstrap_unix_mock.sh |
Adds bash bootstrap mock fixture script. |
tests/fixtures/scripts/bash/bootstrap_unix_integration.sh |
Adds bash bootstrap integration fixture script. |
tests/fixtures/scripts/bash/hooks_darwin_guard.sh |
Adds Darwin hook guard test fixture script. |
tests/fixtures/scripts/pwsh/static_powershell_parse.ps1 |
Adds PowerShell parse checking fixture script. |
tests/fixtures/scripts/pwsh/bootstrap_powershell_mock.ps1 |
Adds PowerShell bootstrap mock fixture script. |
tests/artifacts/.gitignore |
Ensures per-run artifacts aren’t committed while keeping .gitkeep. |
dotfiles.code-workspace |
Hides pytest cache in VS Code workspace settings. |
.gitignore |
Adds a comprehensive ignore list, including pytest caches/venvs. |
README.md |
Updates onboarding + adds testing documentation and bootstrap guidance. |
script/bootstrap-first-run |
Adds/updates Unix bootstrap script with two-pass secrets gating. |
script/bootstrap-first-run.ps1 |
Adds/updates PowerShell bootstrap script with two-pass secrets gating. |
home/.chezmoi.toml.tmpl |
Adds explicit secretsEnabled + 1Password mode configuration. |
home/dot_ssh/config.tmpl |
Updates secret rendering gating logic in SSH config template. |
home/dot_openclaw/openclaw.json.tmpl |
Updates secret rendering gating logic in OpenClaw config template. |
home/.chezmoiscripts/darwin/run_onchange_after_1-openclaw-onboard.tmpl |
Tightens guards for Darwin hook execution. |
home/.chezmoitemplates/UserModules/AllAboutTree/PSScriptTools-ShowTree.ps1 |
Adds a PowerShell module script under templates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
Author
|
@copilot Please fix the failing test |
5 tasks
|
@thanhph111 I've opened a new pull request, #2, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: thanhph111 <60842560+thanhph111@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…test snippets in summary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.