From ce719e409350f656fe320661580d5a6440b1fedf Mon Sep 17 00:00:00 2001 From: Phil Date: Thu, 7 Nov 2024 04:54:08 -0800 Subject: [PATCH] session 8 updates --- exercises/tests.md | 29 ++++++++++++++++++++------ notes.md | 34 ++++++++++++++++++++----------- presentations/containers-101.pdf | Bin 0 -> 132 bytes presentations/session-7.pdf | Bin 0 -> 131 bytes presentations/session-8.pdf | Bin 0 -> 132 bytes schedule.md | 9 ++++++-- 6 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 presentations/containers-101.pdf create mode 100644 presentations/session-7.pdf create mode 100644 presentations/session-8.pdf diff --git a/exercises/tests.md b/exercises/tests.md index 1bf999d..5a4f107 100644 --- a/exercises/tests.md +++ b/exercises/tests.md @@ -5,17 +5,34 @@ Exercises below will use a Coalesce gnerated app. What the app does is not impor If you already have an application deployed that can be used you can save yourself some time. However, we do want to keep the solution small in order to focus on the testing topic. -## Unit Tests +## Unit Tests and Code Coverage +By default, executing tests with dotnet test will fail a build if a build fails. Unit tests can also be used to generate code coverage results. Unit tests are - Small, fast, cheap to execute - do not require a deployed environment +- Fail build if unit tests fail -1. E +Add code coverage to an existing dotnet project by following https://learn.microsoft.com/en-us/training/modules/run-quality-tests-build-pipeline/6-perform-code-coverage + +- Exercise is dotnet, coverage can be generated for other stacks +- Once running locally, verify code coverage and results in Azure Pipelines + +https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-code-coverage ## Integration Tests -Hit api endpoints that exercise +Integration tests test 2 or more services of an application. This typically requires a deployment. Containers including service containers are an approach for executing integration tests without a deployment. +Integration tests can be written in any testing framework +API endpoints + +1. Call api endpoints provided by the application +1. Containers to exeucte without deploying +1. Deployment environmnet + +Be sure to fail a build if tests fail. If using "dotnet test" style exeuction this will happen by default. + +## Automated Functional Tests +1. Add Playwright tests to existing web application -## Functional Tests -Playwright -Executing manual tests with Azure Tests +## Manual Functional Tests +1. Create and execute manual tests with Azure Test Plans diff --git a/notes.md b/notes.md index 9ac88a6..733557b 100644 --- a/notes.md +++ b/notes.md @@ -201,7 +201,7 @@ https://learn.microsoft.com/en-us/training/modules/monitor-app-performance/ * Using Azure App Configuration Feature Flags * Requirements Traceability Matrix * use KeyVault during deployment -* test executiong tren +* test execution trend * SAFe and boards * Remove large binary with git rebase and git push --force * JMeter @@ -210,7 +210,7 @@ https://learn.microsoft.com/en-us/training/modules/monitor-app-performance/ * PowerShell DSC sample configuration * Pipeline retention policies and leases * Deployment groups -* DevOps Service Hooks and notifications +* DevOps Service Hooks and notifications https://learn.microsoft.com/en-us/azure/devops/service-hooks/overview?view=azure-devops * Bicep * Azure Deployment Environments * Azure Automation State Configuration @@ -245,9 +245,11 @@ https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azur - Ansible: https://www.ansible.com/how-ansible-works/ - az repos: https://learn.microsoft.com/en-us/cli/azure/repos/policy/approver-count?view=azure-cli-latest - pipeline reports: https://learn.microsoft.com/en-us/azure/devops/pipelines/reports/pipelinereport?view=azure-devops -- test analytics: https://learn.microsoft.com/en-us/azure/devops/pipelines/test/test-analytics?view=azure-devops + - status checks: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks - env locks in pipelines: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass#exclusive-lock + + - snyk and dbot: https://janaka.dev/devsecops-aking-snyk-github-dependabot-test-drive/ - code scan: https://docs.github.com/en/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning-with-codeql - static analyzers: https://dev.to/dbalikhin/a-quick-comparison-of-security-static-code-analyzers-for-c-2l5h @@ -268,27 +270,24 @@ https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azur - ghd auth: https://docs.github.com/en/desktop/installing-and-authenticating-to-github-desktop/authenticating-to-github-in-github-desktop - log analytics workspace arch: https://learn.microsoft.com/en-us/azure/azure-monitor/logs/workspace-design - otel sampling: https://learn.microsoft.com/en-us/previous-versions/azure/azure-monitor/app/sampling -- owasp dependency chec: https://owasp.org/www-project-dependency-check/ -- devops security: https://learn.microsoft.com/en-us/azure/defender-for-cloud/devops-support -- Microsoft Security DevOps Azure DevOps https://learn.microsoft.com/en-us/azure/defender-for-cloud/azure-devops-extension + + - Cloud devosp security https://learn.microsoft.com/en-us/azure/defender-for-cloud/defender-for-devops-introduction - release notes generator https://github.com/azure-samples/azure-devops-release-notes/tree/main - remove a large binary: https://learn.microsoft.com/en-us/azure/devops/repos/git/remove-binaries?view=azure-devops - SAFe and Boards: https://learn.microsoft.com/en-us/azure/devops/boards/plans/safe-concepts?view=azure-devops&tabs=agile-process -- test execution trend: https://learn.microsoft.com/en-us/azure/devops/report/powerbi/sample-test-plans-execution-trend?view=azure-devops&tabs=powerbi -- test execution trend report: https://learn.microsoft.com/en-us/azure/devops/report/powerbi/sample-test-plans-execution-trend?view=azure-devops&tabs=powerbi - metric widgets: https://marketplace.visualstudio.com/items?itemName=solidify.devops-metrics - keyvault secure deployment: https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/key-vault-parameter?tabs=azure-cli - Requirements Traceability Matrix: https://www.wrike.com/blog/what-is-requirements-traceability-matrix/ - ADO Requirements Traceability: https://learn.microsoft.com/en-us/azure/devops/pipelines/test/requirements-traceability?view=azure-devops + - feature flags: https://learn.microsoft.com/en-us/azure/azure-app-configuration/quickstart-feature-flag-dotnet-background-service - app config feature flags: https://learn.microsoft.com/en-us/azure/azure-app-configuration/manage-feature-flags?tabs=azure-portal + - DevOps Task for Azure Data Explorer: https://learn.microsoft.com/en-us/azure/data-explorer/devops - Rate and usage limits: https://learn.microsoft.com/en-us/azure/devops/integrate/concepts/rate-limits?view=azure-devops&source=docs - Azure DevOps Task for Azure Data Explorer: https://learn.microsoft.com/en-us/azure/data-explorer/devops - Locking and git-lfs: https://github.com/git-lfs/git-lfs/wiki/File-Locking -- runsettings for unit tests: https://learn.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022 -- flaky tests: https://learn.microsoft.com/en-us/azure/devops/pipelines/test/flaky-test-management?view=azure-devops - mermaid * add badges @@ -307,10 +306,21 @@ https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azur * Deployment groups ## tests -https://microsoftlearning.github.io/AZ400-DesigningandImplementingMicrosoftDevOpsSolutions/Instructions/Labs/AZ400_M03_L09_Set_Up_and_Run_Functional_Tests.html +- https://microsoftlearning.github.io/AZ400-DesigningandImplementingMicrosoftDevOpsSolutions/Instructions/Labs/AZ400_M03_L09_Set_Up_and_Run_Functional_Tests.html +- runsettings for unit tests: https://learn.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022 +- flaky tests: https://learn.microsoft.com/en-us/azure/devops/pipelines/test/flaky-test-management?view=azure-devops +- test execution trend: https://learn.microsoft.com/en-us/azure/devops/report/powerbi/sample-test-plans-execution-trend?view=azure-devops&tabs=powerbi +- test execution trend report: https://learn.microsoft.com/en-us/azure/devops/report/powerbi/sample-test-plans-execution-trend?view=azure-devops&tabs=powerbi +- test analytics: https://learn.microsoft.com/en-us/azure/devops/pipelines/test/test-analytics?view=azure-devops + + ## Security -https://learn.microsoft.com/en-us/training/paths/implement-security-through-pipeline-using-devops/ +- https://learn.microsoft.com/en-us/training/paths/implement-security-through-pipeline-using-devops/ +- owasp dependency chec: https://owasp.org/www-project-dependency-check/ +- devops security: https://learn.microsoft.com/en-us/azure/defender-for-cloud/devops-support +- Microsoft Security DevOps Azure DevOps https://learn.microsoft.com/en-us/azure/defender-for-cloud/azure-devops-extension + ## Monitoring and Metrics https://learn.microsoft.com/en-us/training/modules/automate-inspection-health/ diff --git a/presentations/containers-101.pdf b/presentations/containers-101.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f2532307ceb5693d31c3b4e88d00213340f44a4f GIT binary patch literal 132 zcmWNIITFJl3;=sx!3Sb25QqI6BOox71W$xrar<<>v4j&bs?)U%DptMD>g zueeZuD?T%+8$@qOay_(lJ6S{PMx|tc2$&qL6OUUwO!7APY4kQG7ZG(%AsRq8pAuZM Ongq9BmJmD|2;vV)Z72i) literal 0 HcmV?d00001 diff --git a/presentations/session-7.pdf b/presentations/session-7.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ec8dee2c8710e300e10923f3b594ff1b14c3bc1e GIT binary patch literal 131 zcmWN?K@!3s3;@78uiyigLP~)C1_BXgR63^i;OliSd$qTW`O^J757~{mkMs6mS^oD= zS!h0u9F5Fn)f`nz&(7nX5bL%fq-V*wZ NMalR!?V?W>)DH{^Cs688X#ghw%M;9DZS~IX@v{I7Kxd5Of6tsyYWiJ6D+rX>a;s!*# O5vtL?tZf2-9Mlg_(kNm8 literal 0 HcmV?d00001 diff --git a/schedule.md b/schedule.md index 85f9d6b..07cb29e 100644 --- a/schedule.md +++ b/schedule.md @@ -158,27 +158,32 @@ You can take as many assessments as you'd like. ## Session 7, Containers and Testing in pipelines

Oct 29, 2024 -draft +

1. Containers 101 1. Container Exercises +
+ ## Session 8, Package management

Oct 22, 2024 +draft + 1. test pyramid 1. running unit tests 1. integration tests 1. end to end tests -1. Zaproxy ## Session 9, Infrastructure as Code

Nov 12, 2024 ## Session 10, Security and compliance

Nov 19, 2024

+https://learn.microsoft.com/en-us/credentials/applied-skills/implement-security-through-pipeline-using-devops/ 1. https://learn.microsoft.com/en-us/azure/defender-for-cloud/defender-for-devops-introduction 1. connect ADO to Defender: https://learn.microsoft.com/en-us/azure/defender-for-cloud/quickstart-onboard-devops 1. GitHub Advanced Security +1. ZAProxy
## Session 11, Monitoring and metrics

Nov 26, 2024