You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For each test case in the `e2e` folder, you can optionally add post-deployment Pester tests that are executed once the corresponding deployment completed and before the removal logic kicks in.
531
+
532
+
To leverage the feature you must
533
+
- Use Pester as a test framework in each test file
534
+
- Name the file with the suffix `"*.tests.ps1"`
535
+
- Place each test file the `e2e` test's folder or any subfolder (e.g., `e2e/max/myTest.tests.ps1` or `e2e/max/tests/myTest.tests.ps1`)
536
+
- Implement an input parameter `TestInputData` in the following way:
537
+
```pwsh
538
+
param (
539
+
[Parameter(Mandatory = $false)]
540
+
[hashtable] $TestInputData = @{}
541
+
)
542
+
```
543
+
Through this parameter you can make use of every output the `main.test.bicep` file returns, as well as the path to the test template file in case you want to extract data from it directly.
544
+
545
+
For example, with an output such as `output resourceId string = testDeployment[1].outputs.resourceId` defined in the `main.test.bicep` file, the `$TestInputData` would look like
546
+
```pwsh
547
+
$TestInputData = @{
548
+
DeploymentOutputs = @{
549
+
resourceId = @{
550
+
Type = "String"
551
+
Value = "/subscriptions/***/resourceGroups/dep-***-keyvault.vaults-kvvpe-rg/providers/Microsoft.KeyVault/vaults/***kvvpe001"
0 commit comments