зеркало из https://github.com/Azure/benchpress.git
1.5 KiB
1.5 KiB
How To Run EventHub.Tests.ps1
EventHub.Tests.ps1
contains examples of using the Confirm-AzBPEventHub
, Confirm-AzBPEventHubConsumerGroup
,
and Confirm-AzBPEventHubNamespace
cmdlet.
Pre-Requisites
- Follow the setup instructions
Steps
-
Navigate to EventHub directory:
cd examples\EventHub\
-
Deploy the EventHub to your resource group:
New-AzResourceGroupDeployment -ResourceGroupName "<your-resource-group-name>"` -TemplateFile ".\eventHub.bicep"
-
Update
EventHub.Tests.ps1
variables to point to your expected resources:rg-test
->your-resource-group-name
eventhub
->your-eventhub-name
eventhubamespace
->your-eventhub-namespace-name
eventhubconsumergroup
->your-eventhub-consumer-group-name
westus3
->your-eventhub-location
-
If using a local copy of
BenchPress.Azure
, replaceImport-Module BenchPress.Azure
withImport-Module "../../bin/BenchPress.Azure.psd1"
. Note that the finalAfterAll
step will properly remove the module regardless of which method is chosen to load the module. -
Run
EventHub.Tests.ps1
:Invoke-Pester -Path .\EventHub.Tests.ps1
-
Success!
Tests completed in 952ms Tests Passed: 4, Failed: 0, Skipped: 0 NotRun: 0
-
Don't forget to delete any deployed resources that are no longer needed.