Skip to content

Implement testing framework with local, Docker & GitHub Actions#1

Open
thanhph111 wants to merge 11 commits intochezmoifrom
testing
Open

Implement testing framework with local, Docker & GitHub Actions#1
thanhph111 wants to merge 11 commits intochezmoifrom
testing

Conversation

@thanhph111
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 26, 2026 12:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 test orchestration 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.

@thanhph111
Copy link
Owner Author

@copilot Please fix the failing test

Copy link

Copilot AI commented Feb 26, 2026

@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.

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.

3 participants