azure-sdk-tools/eng/common-tests
Wes Haggard 240c5e2551
Remove default sub config sub-config-azure-cloud-test-resources (#9229)
* Remove default sub config sub-config-azure-cloud-test-resources

We no longer want to default the configuration and instead
default from the service connection which had the info we need.

* Fix quoting
2024-10-21 20:10:26 -07:00
..
doc-automation/service-readme-generation Remove get-codeowners.ps1 from docs automation (#7040) 2023-10-02 14:59:40 -07:00
matrix-generator Remove default sub config sub-config-azure-cloud-test-resources (#9229) 2024-10-21 20:10:26 -07:00
psmodule-helpers [eng/common] Make helper function "Install-ModuleIfNotInstalled" threadsafe (#6521) 2023-07-14 17:21:26 -07:00
spelling Spelling: Remove deprecated --no-install, replace with --no (#9013) 2024-09-24 09:52:29 -07:00
README.md Move `get-codeowners.ps1` test mode to `common-tests` + related improvements & cleanup (#5608) 2023-03-31 06:57:23 +00:00
ci.yml Move `get-codeowners.ps1` test mode to `common-tests` + related improvements & cleanup (#5608) 2023-03-31 06:57:23 +00:00

README.md

About common-tests

Every PowerShell source that is complex enough to have unit tests should have these tests be written in the Pester framework and placed in eng/common-tests/**, i.e. this directory or one of its descendants.
By design, unlike eng/common, eng/common-tests is not subject to mirroring to repositories.

When tests in this directory are executed

The PowerShell Pester unit tests will be executed by the public tools - eng-common-tests pipeline upon a PR that makes changes to eng/common/scripts/** or eng/common-tests/**. The pipeline source is eng/common-tests/ci.yml.

In addition, specific tools might selectively run a subset of tests during their pipeline run, as e.g. done by tools/code-owners-parser/ci.yml.

How to ensure your PowerShell pester unit test is executed

By Pester's default convention, the tests are to be placed in files whose names ends with .tests.ps1, e.g. job-matrix-functions.tests.ps1.

Furthermore, each test needs to be tagged with UnitTest, e.g. as seen here: Describe "Matrix-Lookup" -Tag "UnitTest", "lookup".

Finally, as already mentioned, all such test files must be located in the path of eng/common-tests/**.

For more, see Invoke-Pester doc.