-
Notifications
You must be signed in to change notification settings - Fork 1
🚀[Feature]: Add support for running setup and teardown scripts during tests #177
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
Co-authored-by: MariusStorhaug <[email protected]>
Co-authored-by: MariusStorhaug <[email protected]>
Co-authored-by: MariusStorhaug <[email protected]>
Rework so that it runs PowerShell based steps. |
Co-authored-by: MariusStorhaug <[email protected]>
Reworked the implementation to use PowerShell-based steps as requested. The new approach removes the separate bash-based BeforeAll-ModuleLocal and AfterAll-ModuleLocal jobs and instead adds simple PowerShell steps directly to the Test-ModuleLocal.yml workflow that check for and execute BeforeAll.ps1/AfterAll.ps1 scripts. This is now fully PowerShell-based and consistent with the existing testing infrastructure. (2027a0b) |
…tation Co-authored-by: MariusStorhaug <[email protected]>
This PR implements support for BeforeAll.ps1 and AfterAll.ps1 setup and teardown scripts during the Test-ModuleLocal workflow, as requested in issue #169.
Changes Made
Workflow Enhancements
BeforeAll-ModuleLocal
job: Runs once before all Test-ModuleLocal matrix jobs to execute setup scriptsAfterAll-ModuleLocal
job: Runs once after all Test-ModuleLocal matrix jobs complete to execute teardown scriptsScript Detection and Execution
Example Usage
Place BeforeAll.ps1 and/or AfterAll.ps1 scripts in your test directories:
Documentation
Test Coverage
Workflow Execution Order
This implementation provides exactly the functionality requested in the issue, allowing users to run setup scripts before tests (for deploying infrastructure, downloading data, etc.) and teardown scripts after tests (for cleanup, removing resources, etc.).
Fixes #169.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.