From 12c731a89d0ccfb4fedfb770004922dfcc17f928 Mon Sep 17 00:00:00 2001 From: Caroline Date: Fri, 31 Mar 2023 10:38:04 -0700 Subject: [PATCH] update readme and correct typo --- assets/demos/AspNetCore.Docs | 1 - assets/demos/DemoApp.Tests.ps1 | 18 +++++++----- assets/demos/README.md | 54 +++++++++++++++++++--------------- 3 files changed, 40 insertions(+), 33 deletions(-) delete mode 160000 assets/demos/AspNetCore.Docs diff --git a/assets/demos/AspNetCore.Docs b/assets/demos/AspNetCore.Docs deleted file mode 160000 index d8b029a..0000000 --- a/assets/demos/AspNetCore.Docs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d8b029a127d7b220e056c799c7324979b5990937 diff --git a/assets/demos/DemoApp.Tests.ps1 b/assets/demos/DemoApp.Tests.ps1 index bd69854..0a21b41 100644 --- a/assets/demos/DemoApp.Tests.ps1 +++ b/assets/demos/DemoApp.Tests.ps1 @@ -1,5 +1,7 @@ BeforeAll { - Import-Module "../../bin/BenchPress.Azure.psd1" + # Navigate to ../../docs/installation.md to build BenchPress module" + + #Import-Module "../../bin/BenchPress.Azure.psd1" $Script:rgName = "benchpress-rg-${env:ENVIRONMENT_SUFFIX}" $Script:webAppName = "benchpress-web-${env:ENVIRONMENT_SUFFIX}" @@ -17,7 +19,7 @@ Describe 'Resource Group Tests' { $resourceGroup = Confirm-AzBPResource @params #assert - $resourceGroup.Success | Should -BeDeployed + $resourceGroup | Should -BeDeployed } } @@ -36,7 +38,7 @@ Describe 'Service Plan Tests' { $servicePlan = Confirm-AzBPResource @params #assert - $servicePlan.Success | Should -BeDeployed + $servicePlan | Should -BeDeployed } } @@ -55,7 +57,7 @@ Describe 'Action Group Tests' { $ag = Confirm-AzBPResource @params #assert - $ag.Success | Should -BeDeployed + $ag | Should -BeDeployed } } @@ -72,7 +74,7 @@ Describe 'Web Apps Tests' { $webApp = Confirm-AzBPResource @params #assert - $webApp.Success | Should -BeDeployed + $webApp | Should -BeDeployed } it 'Should have the web app availability state as normal' { @@ -89,7 +91,7 @@ Describe 'Web Apps Tests' { $webApp = Confirm-AzBPResource @params #assert - $webApp.Success | Should -BeDeployed + $webApp | Should -BeDeployed } it 'Should have the web app works https only' { @@ -105,7 +107,7 @@ Describe 'Web Apps Tests' { $webApp = Confirm-AzBPResource @params #assert - $webApp.Success | Should -BeDeployed + $webApp | Should -BeDeployed } it 'Should contain application insights configuration in the web app' { @@ -122,7 +124,7 @@ Describe 'Web Apps Tests' { $webApp = Confirm-AzBPResource @params #assert - $webApp.Success | Should -BeDeployed + $webApp | Should -BeDeployed } } diff --git a/assets/demos/README.md b/assets/demos/README.md index b5e4ad3..ea7860b 100644 --- a/assets/demos/README.md +++ b/assets/demos/README.md @@ -4,6 +4,13 @@ This demo application is used to demonstrate the capabilities of Benchpress. It is a simple ASP.NET Core application that has been instrumented with Benchpress. The application is deployed to Azure and then Benchpress is used to run the tests against the application. +The demo includes the following deployed resources: + +* [Application Insights](https://learn.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview?tabs=net) +* [Action Group](https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/action-groups) +* [App Service Plan](https://learn.microsoft.com/en-us/azure/app-service/overview) +* [Web App](https://azure.microsoft.com/en-us/products/app-service/web) + ## Demo App Files * [main.bicep](main.bicep) - Bicep module used to deploy the demo application infrastructure @@ -13,43 +20,42 @@ This demo application is used to demonstrate the capabilities of Benchpress. It ## Guidelines for creating and testing a demo application -* Run the [deploy-demoapp.ps1](deploy-demoapp.ps1) script to deploy the demo application infrastructure and the demo application +1. Navigate to demo directory: - * [Application Insights](https://learn.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview?tabs=net) - * [Action Group](https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/action-groups) - * [App Service Plan](https://learn.microsoft.com/en-us/azure/app-service/overview) - * [Web App](https://azure.microsoft.com/en-us/products/app-service/web) + ```Powershell + cd assets\demo\ + ``` -```powershell -./deploy-demoapp.ps1 -``` +1. Run the [deploy-demoapp.ps1](deploy-demoapp.ps1) script to deploy the demo application infrastructure and the demo application. + + ```Powershell + ./deploy-demoapp.ps1 + ``` ## Running the tests * Run the tests by calling the test script file, or, `Invoke-Pester` command -```powershell -./DemoApp.Tests.ps1 -``` + ```Powershell + ./DemoApp.Tests.ps1 + ``` -```powershell -Invoke-Pester -``` + ```Powershell + Invoke-Pester -Path .\DemoApp.Tests.ps1 + ``` ## Cleaning up the demo application * Delete the resource group -```powershell -az group delete --name "benchpress-rg-${env:ENVIRONMENT_SUFFIX}" --yes -``` + ```Powershell + az group delete --name "benchpress-rg-${env:ENVIRONMENT_SUFFIX}" --yes + ``` ## Running the deployment, tests, and cleanup together -```powershell -./deploy-demoapp.ps1 - -./DemoApp.Tests.ps1 - -az group delete --name "benchpress-rg-${env:ENVIRONMENT_SUFFIX}" --yes -``` + ```Powershell + ./deploy-demoapp.ps1 + ./DemoApp.Tests.ps1 + az group delete --name "benchpress-rg-${env:ENVIRONMENT_SUFFIX}" --yes + ```