This document outlines the testing framework for the Scripts repository.
This repository uses pre-commit to run a suite of linters and formatters before each commit.
Installation:
-
Install Python 3.9 or newer (Python 3.11 recommended, as used in CI) and pip.
-
Install
pre-commit:pip install pre-commit
-
Set up the git hooks:
pre-commit install
Usage:
The hooks will run automatically on git commit. To run them manually across all files:
pre-commit run --all-filesPowerShell tests are written using the Pester framework.
Prerequisites:
- PowerShell 7+
- Pester module
Installation (from PowerShell):
Install-Module -Name Pester -Force -SkipPublisherCheckRunning Tests:
To run all PowerShell unit tests:
Invoke-Pester -Path 'tests/unit/PowerShell'The CI pipeline is defined in .github/workflows/ci.yml and runs automatically on pushes and pull requests to the
main branch.
It performs two main jobs:
lint: Runs allpre-commithooks on an Ubuntu runner.test-powershell: Runs all Pester tests on a Windows runner.