Azure / Azure/azure-sdk-tools

Testing framework for powershell scripts

Open
#4,882 6 comments 1 reaction 1 assignee Assigned to @konrad-jamrozik View on GitHub
Central-EngSys
Dominant language
C#
Stars
135
Forks
260
Avg merge
1d 22h
Merged PRs (30d)
115

Description

## Background
No test coverage for our powershell scripts is long existing issue. We currently work on adding pester tests and testing in local. Several drawbacks for the local tests:
1. It is not a convention for team member to add test coverage for everything they added.
2. Forgot running the tests in local for new changes might introduce errors in tests, then the efforts of writing tests will be in vain.
## Goals
We can have DevOps pipeline triggered every time we change the scripts.
The tests coverage plan:
1. We can cover modularized function tests first.
1. Better to have integration tests on single script file.
2. Have integration tests across multiple files.
## Proposals
Running tests in pipeline would be the best choices.
### Proposal 1(Optimal)
**Test structure**
image
**Triggers**
Every time we touch scripts under `eng/`, the devOps testing pipeline would run.
### Proposal 2
**Test structure**
image

**Triggers**
Every time we touch single scripts under `eng/`, the individual testing pipeline would run. If pipeline doesn't exist, then we use `pipeline-generation` create one.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.