benchpress/examples/ContainerApp/ContainerApp_Example.md

1.5 KiB

How To Run ContainerApp.Tests.ps1

ContainerApp.Tests.ps1 contains examples of using the Confirm-AzBPContainerApp and the Confirm-AzBPContainerAppManagedEnv cmdlet.

Pre-Requisites

Steps

  1. Navigate to ContainerApp directory:

    cd examples\ContainerApp\
    
  2. Deploy the Container Registry to your resource group:

     New-AzResourceGroupDeployment -ResourceGroupName "<your-resource-group-name>"`
     -TemplateFile ".\containerApp.bicep"
    
  3. Update ContainerApp.Tests.ps1 variables to point to your expected resources:

    • rg-test -> your-resource-group-name
    • containerAppBenchPressTest -> your-container-application-name
    • managedenvbenchpresstest -> your-container-application-managed-environment-name
    • westus3 -> your-resource-group-location-name
  4. If using a local copy of BenchPress.Azure, replace Import-Module BenchPress.Azure with Import-Module "../../bin/BenchPress.Azure.psd1". Note that the final AfterAll step will properly remove the module regardless of which method is chosen to load the module.

  5. Run ContainerApp.Tests.ps1:

    Invoke-Pester -Path .\ContainerApp.Tests.ps1
    
  6. Success!

     Tests completed in 5.02s
     Tests Passed: 7, Failed: 0, Skipped: 0 NotRun: 0
    
  7. Don't forget to delete any deployed resources that are no longer needed.