-
Notifications
You must be signed in to change notification settings - Fork 369
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
feat: Added logic to find child modules when running Test-ModuleLocally -PesterTest
#3870
base: main
Are you sure you want to change the base?
feat: Added logic to find child modules when running Test-ModuleLocally -PesterTest
#3870
Conversation
Important The "Needs: Triage 🔍" label must be removed once the triage process is complete! Tip For additional guidance on how to triage this issue/PR, see the BRM Issue Triage documentation. |
Important If this is a module-related PR, being submitted by the sole owner of the module, the AVM core team must review and approve it (as module owners can't approve their own PRs). To indicate this PR needs the core team''s attention, apply the "Needs: Core Team 🧞" label! The core team will only review and approve PRs that have this label applied! |
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.
Good idea, thanks @anderseide,
the only thought that came to mind is whether we should provide a controlling parameter to tell the invocation whether you want to test the entire hierachy - or only the provided template.
Reason being: Modules like e.g. API Management or Storage Account are very big. And if you just want to work on a failing test, re-runs can become a bit painful time-wise (as some tests, e.g. the one for the readme, take a moment to execute).
Speaking of - but that may absolutely break the scope of this PR and should be a seperate one. If we merge this change in, I'd recommend to update the Set-ModuleReadMe
script should not apply any updatestest's logic to provide more
PreLoadedContentto the
Set-ModuleReadMeinvocation. Specifically the
CrossReferencedModuleList&
TelemetryFileContentas done in the
Set-AVMModule` script. This should then massively speed up these recursive tests added by this PR :)
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.
Added -PesterTestRecurse switch to the script as pr. first part of your comment.
I'm playing around with some Pester tests improvements in a separate branch. I'll have a look at speeding up the Set-ModuleReadMe test logic there
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.
Test single module file
Test-ModuleLocally -PesterTest -TemplateFilePath ./avm/res/web/site/main.bicep
Test module recursively, witch includes all child modules
Test-ModuleLocally -PesterTestRecurse -TemplateFilePath ./avm/res/web/site/main.bicep
Description
Changed logic in Test-ModuleLocally to detect child modules. Uses same code as in the GitHub Action at https://github.com/Azure/bicep-registry-modules/blob/main/.github/actions/templates/avm-validateModulePester/action.yml
Closes #3869
Pipeline Reference
Type of Change
version.json
:version.json
.version.json
.Checklist
Set-AVMModule
locally to generate the supporting module files.