Skip to content

Commit 8d90165

Browse files
chore(standards): sync from AzureLocal/platform (#43)
Auto-generated by .github/workflows/sync-standards.yml. Source: AzureLocal/platform/standards/ @ main Co-authored-by: kristopherjturner <13710532+kristopherjturner@users.noreply.github.com>
1 parent 1a87368 commit 8d90165

11 files changed

Lines changed: 160 additions & 37 deletions

standards/automation.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ flowchart TB
4040
| **PowerShell** |||||
4141
| **Ansible** |||||
4242

43-
:::warning[Delegates]
44-
"Delegates" means the IaC tool provisions Azure resources but does not configure the guest OS or application layer. A separate tool (PowerShell or Ansible) handles guest configuration.
45-
:::
43+
!!! warning "Delegates"
44+
"Delegates" means the IaC tool provisions Azure resources but does not configure the guest OS or application layer. A separate tool (PowerShell or Ansible) handles guest configuration.
4645

4746
---
4847

@@ -67,4 +66,4 @@ Scripts must use variable paths that exist in the schema. See the [Variable Stan
6766
- [Scripting Standards](scripting)
6867
- [Infrastructure Standards](infrastructure)
6968
- [Solution Standards](solutions)
70-
- [Variable Standards](variables)
69+
- [Variable Standards](variables)

standards/documentation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ All examples must use IIC. See the [Examples & IIC Policy](examples) page for th
7272

7373
- [Naming Conventions (full reference)](https://azurelocal.cloud/standards/documentation/naming-conventions)
7474
- [Badge Library](https://azurelocal.cloud/standards/documentation/badge-library)
75-
- [Scripting Standards](scripting)
75+
- [Scripting Standards](scripting)

standards/examples.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010

1111
All examples, sample configurations, and walkthroughs use **one** fictional company: **Infinite Improbability Corp (IIC)**.
1212

13-
:::warning[Mandatory]
14-
Never use `contoso`, `fabrikam`, `adventure-works`, `woodgrove`, `example.com`, or any real customer name.
13+
!!! warning "Mandatory"
14+
Never use `contoso`, `fabrikam`, `adventure-works`, `woodgrove`, `example.com`, or any real customer name.
1515
**IIC only** — in every repo, every example, every sample config.
16-
:::
1716

1817
---
1918

@@ -101,4 +100,4 @@ azure_local:
101100

102101
- **PR review**: Reviewers flag any use of `contoso`, `fabrikam`, or other non-IIC names
103102
- **Config validation**: `variables.example.yml` uses IIC naming in all placeholders
104-
- **CI**: Vale linting rules flag non-IIC fictional company names (when configured)
103+
- **CI**: Vale linting rules flag non-IIC fictional company names (when configured)

standards/index.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ description: "Standards and conventions"
99

1010
This repository follows the **org-wide AzureLocal standards** maintained on the central documentation site.
1111

12-
:::info[Central Standards]
13-
The full standards suite is at [azurelocal.cloud/standards](https://azurelocal.cloud/standards/).
12+
!!! info "Central Standards"
13+
The full standards suite is at [azurelocal.cloud/standards](https://azurelocal.cloud/standards/).
1414
This section provides the key rules adapted for this solution.
15-
:::
1615

1716
---
1817

@@ -44,4 +43,4 @@ The full standards suite is at [azurelocal.cloud/standards](https://azurelocal.c
4443

4544
- **IaC tooling**: Terraform, Bicep, ARM, PowerShell, Ansible
4645
- **Config contract**: runtime `config/variables/variables.yml`, template `config/variables/variables.example.yml`, schema `config/variables/schema/variables.schema.json`, bootstrap policy defined in [Variable Standards](variables)
47-
- **Fictional company**: Infinite Improbability Corp (IIC) — see [IIC Policy](examples)
46+
- **Fictional company**: Infinite Improbability Corp (IIC) — see [IIC Policy](examples)

standards/infrastructure.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ All tools must produce **identical infrastructure** when given the same configur
8181

8282
The `azurelocal-toolkit` repository is the reference implementation. All other repos follow the same top-level layout where applicable.
8383

84-
```
84+
```text
8585
azurelocal-toolkit/
8686
├── config/
8787
│ ├── azure/ # ARM templates, discovery, iDRAC, service principals, utilities
@@ -121,7 +121,7 @@ azurelocal-toolkit/
121121

122122
Every task folder under `scripts/deploy/` mirrors the path of its corresponding doc in `docs/implementation/` and contains exactly three subdirectories:
123123

124-
```
124+
```text
125125
scripts/deploy/<part>/<phase>/<task>/
126126
├── azurecli/ # Azure CLI scripts (.ps1 using az commands, or .sh)
127127
├── bash/ # Pure Bash scripts (.sh)
@@ -148,4 +148,4 @@ Top-level parts and their phases:
148148
- [State Management](https://azurelocal.cloud/standards/infrastructure/state-management)
149149
- [Solution Development Standard](solutions)
150150
- [Variable Standards](variables) — includes master registry and infrastructure type definitions
151-
- [Automation Interoperability](automation)
151+
- [Automation Interoperability](automation)

standards/naming.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
## Azure Resource Naming
2222

23-
All resources follow the [IIC naming patterns](examples). For comprehensive CAF-aligned naming patterns used in Azure Local deployments, see [Planning: Naming Standards](../planning/01-naming-standards.mdx):
23+
All resources follow the [IIC naming patterns](examples). For comprehensive CAF-aligned naming patterns used in Azure Local deployments, see [Planning: Naming Standards](https://azurelocal.cloud/standards/naming):
2424

2525
| Resource Type | Pattern | Example |
2626
|--------------|---------|---------|
@@ -58,8 +58,8 @@ All resources follow the [IIC naming patterns](examples). For comprehensive CAF-
5858

5959
## Related Standards
6060

61-
- [Planning: Naming Standards](../planning/01-naming-standards.mdx) — Full CAF-aligned naming conventions for Azure Local deployments
61+
- [Planning: Naming Standards](https://azurelocal.cloud/standards/naming) — Full CAF-aligned naming conventions for Azure Local deployments
6262
- [Full Naming Conventions](https://azurelocal.cloud/standards/documentation/naming-conventions)
6363
- [Repository Structure](https://azurelocal.cloud/standards/repo-structure)
6464
- [Documentation Standards](documentation)
65-
- [Examples & IIC](examples)
65+
- [Examples & IIC](examples)

standards/new-repo-setup.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# New Repository Setup Runbook
22

33
> **Applies to:** All AzureLocal repositories
4-
> **Companion reading:** [Repository Management Standard](./repository-management.mdx)
4+
> **Companion reading:** [Repository Management Standard](./repository-management.md)
55
66
This runbook walks through every step required to set up a new AzureLocal repository from scratch, in order. Complete each step before proceeding to the next.
77

@@ -54,7 +54,7 @@ Copy `CONTRIBUTING.md` and `LICENSE` from any existing AzureLocal repo, or use t
5454

5555
Minimum required directories:
5656

57-
```
57+
```text
5858
<repo>/
5959
├── docs/ # Documentation source
6060
├── .github/
@@ -66,7 +66,7 @@ Minimum required directories:
6666

6767
If the solution uses infrastructure configuration, also add:
6868

69-
```
69+
```text
7070
├── config/
7171
│ ├── variables.example.yml
7272
│ └── schema/
@@ -237,14 +237,14 @@ Paste the shared org PAT when prompted. This token is managed by org admins —
237237

238238
Open a PR on `azurelocal.github.io` to:
239239

240-
1. Add a row for the new repository in the [Repository Management Standard](./repository-management.mdx) portfolio table.
240+
1. Add a row for the new repository in the [Repository Management Standard](./repository-management.md) portfolio table.
241241
2. If the solution has a dedicated page on the docs site, add a navigation entry in `docusaurus.config.js`.
242242

243243
---
244244

245245
## Checklist
246246

247-
```
247+
```text
248248
[ ] Repository created under AzureLocal org
249249
[ ] Required root files present (README, CONTRIBUTING, LICENSE, CHANGELOG, .gitignore)
250250
[ ] docs/ and .github/workflows/ directories created
@@ -257,5 +257,5 @@ Open a PR on `azurelocal.github.io` to:
257257
[ ] Repository topics set (required + solution-specific)
258258
[ ] Branch protection configured for main
259259
[ ] ADD_TO_PROJECT_PAT secret set
260-
[ ] Repository listed in repository-management.mdx
260+
[ ] Repository listed in repository-management.md
261261
```

standards/scripting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ All `Invoke-` scripts must use `[CmdletBinding()]` to enable `-Verbose` and `-De
9797
- [PowerShell Organization Standard](https://azurelocal.cloud/standards/scripting/powershell-organization-standard)
9898
- [Scripting Framework](https://azurelocal.cloud/standards/scripting/scripting-framework)
9999
- [Bash Scripting Standards](https://azurelocal.cloud/standards/scripting/bash-scripting-standards)
100-
- [Automation Interoperability](automation)
100+
- [Automation Interoperability](automation)

standards/solutions.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ Each solution maps to an infrastructure type in the [master registry](./variable
2222
| AI-Assisted Operations | `copilot` | [`azurelocal-copilot`](https://github.com/AzureLocal/azurelocal-copilot) |
2323
| Azure Local Ranger | `ranger` | [`azurelocal-ranger`](https://github.com/AzureLocal/azurelocal-ranger) |
2424

25-
:::info[Non-IaC Solutions]
26-
Some solutions (e.g. Ranger, Copilot, Load Testing Tools) are operational or diagnostic tools rather than IaC deployment solutions. They follow the same repository management standards but the IaC tool support, parameter derivation, and multi-tool parity sections below do not apply. Their solution-specific architecture is documented in their own repos.
27-
:::
25+
!!! info "Non-IaC Solutions"
26+
Some solutions (e.g. Ranger, Copilot, Load Testing Tools) are operational or diagnostic tools rather than IaC deployment solutions. They follow the same repository management standards but the IaC tool support, parameter derivation, and multi-tool parity sections below do not apply. Their solution-specific architecture is documented in their own repos.
2827

2928
---
3029

@@ -40,9 +39,8 @@ Each tool must declare which deployment phases it supports:
4039
| **PowerShell** |||||
4140
| **Ansible** |||||
4241

43-
:::warning[Delegates]
44-
"Delegates" means the tool provisions Azure resources but does not configure the guest OS. A separate tool (PowerShell or Ansible) handles guest configuration.
45-
:::
42+
!!! warning "Delegates"
43+
"Delegates" means the tool provisions Azure resources but does not configure the guest OS. A separate tool (PowerShell or Ansible) handles guest configuration.
4644

4745
---
4846

@@ -89,4 +87,4 @@ All tools must produce **identical infrastructure** when given the same configur
8987

9088
- [Infrastructure Standards](https://azurelocal.cloud/standards/infrastructure/)
9189
- [Variable Reference](variables)
92-
- [Scripting Standards](scripting)
90+
- [Scripting Standards](scripting)

standards/testing.mdx

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
title: "Testing Standards"
3+
sidebar_label: "Testing"
4+
sidebar_position: 90
5+
description: "MAPROOM fixtures, TRAILHEAD scenarios, and IIC canon — how AzureLocal repos test."
6+
---
7+
8+
# Testing Standards
9+
10+
> **Canonical reference:** this document.
11+
> **Applies to:** All AzureLocal repositories that ship executable code or infrastructure.
12+
> **Last Updated:** 2026-04-12
13+
14+
Testing in AzureLocal is centralized. The frameworks, schemas, and canonical test data live in [`AzureLocal/platform/testing/`](https://github.com/AzureLocal/platform/tree/main/testing) and are consumed by every product repo. This standard defines **what each repo must test** and **which framework primitives it must use** — it does not re-describe the frameworks themselves (those have their own docs under [`docs/maproom/`](https://github.com/AzureLocal/platform/tree/main/docs/maproom) and [`docs/trailhead/`](https://github.com/AzureLocal/platform/tree/main/docs/trailhead) once Phase 2 ships).
15+
16+
!!! info "Phase status"
17+
Phase 1 (this document) establishes the **standard**. Phase 2 ships the **framework** (`AzureLocal.Maproom` PowerShell module, fixture + IIC schemas, TRAILHEAD harness). Until Phase 2 lands, repos continue to reference [`azurelocal-S2DCartographer/tests/maproom/`](https://github.com/AzureLocal/azurelocal-S2DCartographer/tree/main/tests/maproom) as the interim canonical implementation.
18+
19+
---
20+
21+
## Test classification
22+
23+
Every test in an AzureLocal repo falls into exactly one of these classes. The class determines where the test lives, what harness runs it, and what a failure means.
24+
25+
| Class | Purpose | Location | Harness |
26+
|-------|---------|----------|---------|
27+
| **unit** | Exercise a single function/cmdlet in isolation. No external state. | `tests/unit/` | Pester 5 (PowerShell) or pytest (Python) |
28+
| **contract** | Assert the shape of a cluster / tenant / fleet against a **MAPROOM fixture**. Fixture is authoritative; code conforms to it. | `tests/maproom/fixtures/` | `AzureLocal.Maproom` |
29+
| **integration** | Exercise module + live dependency (real cluster, real Azure tenant, real AD). Requires a provisioned lab. | `tests/integration/` | Pester 5 with lab config |
30+
| **scenario** (TRAILHEAD) | Scripted end-to-end walkthrough with pass/fail gates. User-journey shaped: "user does X, expects Y". | `tests/trailhead/` | TRAILHEAD harness (Phase 2) |
31+
| **drift-audit** | Assert a live environment still matches its MAPROOM fixture after time passes. Runs scheduled, not per-commit. | `tests/drift/` | `AzureLocal.Maproom` + scheduled workflow |
32+
33+
!!! warning "Classification under review"
34+
The five-class taxonomy above is the **current** rule. An open platform issue ([#3](https://github.com/AzureLocal/platform/issues/3)) is reviewing whether additional classes (compliance assertion, synthetic load, migration-inventory differ, repo conformance) should become first-class. Until that issue closes, treat anything outside the five classes as repo-local tooling — do not lift it into `platform/testing/` without ADR approval.
35+
36+
---
37+
38+
## MAPROOM — contract testing
39+
40+
MAPROOM fixtures are JSON documents describing the **expected shape** of a target (cluster, host pool, profile-container fleet, migration source inventory). Code-under-test reads the fixture, introspects the real target, and asserts conformance.
41+
42+
**Required for every repo that provisions or manages infrastructure.**
43+
44+
### Required files per repo
45+
46+
- `tests/maproom/fixtures/<target>.json` — one fixture per logical target. Filename = target identifier.
47+
- `tests/maproom/<target>.Tests.ps1` — Pester test that loads the fixture and runs conformance assertions.
48+
49+
### Fixture schema
50+
51+
Fixtures MUST validate against [`platform/testing/maproom/schema/fixture.schema.json`](https://github.com/AzureLocal/platform/tree/main/testing/maproom/schema) (ships in Phase 2). Until then, use the schema derived from `azurelocal-S2DCartographer/tests/maproom/schema/` and expect to migrate on Phase 2 cutover.
52+
53+
### IIC canon as fixture source
54+
55+
Cluster-shape fixtures that represent the canonical **Infinite Improbability Corp** environment (see [Examples & IIC Policy](examples)) live in [`platform/testing/iic-canon/`](https://github.com/AzureLocal/platform/tree/main/testing/iic-canon). Repos reference these by path; they do not copy them locally.
56+
57+
Canonical IIC fixtures today:
58+
59+
- `iic-org.json` — org-level identity, tenancy, domain structure
60+
- `iic-cluster-01.json` — primary HCI cluster shape
61+
- `iic-networks.json` — network topology (VLANs, subnets, NSGs)
62+
63+
Additional IIC canons (AVD host pools, FSLogix profile maps, Nutanix source fleets) are pending classification in issue [#3](https://github.com/AzureLocal/platform/issues/3).
64+
65+
---
66+
67+
## TRAILHEAD — scenario testing
68+
69+
TRAILHEAD scenarios are executable walkthroughs of a user journey end-to-end: **"a user does X in sequence, each step has an expected outcome, the scenario passes if every step's gate passes."**
70+
71+
**Required for every repo that ships a user-facing workflow** (AVD logon, VM conversion run, migration rehearsal, demo deployment, training lab).
72+
73+
### Required files per repo
74+
75+
- `tests/trailhead/<scenario>.trailhead.ps1` — one file per scenario. Parameterized, idempotent where possible.
76+
- `tests/trailhead/expected/<scenario>.expected.json` — the pass/fail gates the scenario asserts at each step.
77+
78+
### Naming
79+
80+
Scenario filenames describe the journey, not the implementation: `new-avd-host-pool-deploy.trailhead.ps1`, not `test-avd-deploy.ps1`. The filename is user-documentation-quality.
81+
82+
---
83+
84+
## What every repo MUST have
85+
86+
A conforming AzureLocal repo has, at minimum:
87+
88+
- [ ] `tests/` directory at repo root
89+
- [ ] `tests/unit/` with at least one Pester/pytest test per shipped module
90+
- [ ] `tests/maproom/fixtures/` with at least one fixture if the repo provisions or manages infrastructure
91+
- [ ] `tests/trailhead/` with at least one scenario if the repo ships a user-facing workflow
92+
- [ ] CI workflow invoking `platform/.github/workflows/run-tests.yml` (Phase 3) — executes unit + contract tests on every PR
93+
- [ ] Scheduled workflow invoking `platform/.github/workflows/drift-audit.yml` weekly for repos with live environments
94+
95+
Repos that are purely documentation (`azurelocal-training`, `azurelocal.github.io`, `demo-repository` when it stays demo-only) are exempt from the MAPROOM/TRAILHEAD requirements but still need unit tests for any embedded scripts.
96+
97+
---
98+
99+
## What does NOT belong in a product repo's `tests/`
100+
101+
- **Copies of MAPROOM framework code.** Reference the platform module; don't vendor it.
102+
- **Copies of IIC canon fixtures.** Reference [`platform/testing/iic-canon/`](https://github.com/AzureLocal/platform/tree/main/testing/iic-canon) by path.
103+
- **Shared assertion helpers.** If two repos need the same helper, it belongs in `AzureLocal.Maproom`. Open a platform PR.
104+
- **Secrets or live-environment credentials.** Integration test config lives in the CI environment, not in-repo.
105+
106+
---
107+
108+
## Enforcement
109+
110+
- **PR gate**`Validate Repo Structure` (Phase 0, shipped) asserts `tests/` exists and is non-empty.
111+
- **PR gate**`Run Tests` (Phase 3, pending) executes unit + contract tests on every PR.
112+
- **Weekly gate**`Drift Audit` (Phase 4, pending) re-runs contract tests against live environments and opens an issue on divergence.
113+
- **Onboarding gate**`New-AzureLocalRepo.ps1` (Phase 5, pending) scaffolds the required directories so no new repo ships without them.
114+
115+
---
116+
117+
## Changes to this standard
118+
119+
Non-trivial edits require an ADR in [`decisions/`](https://github.com/AzureLocal/platform/tree/main/decisions). Current relevant ADRs:
120+
121+
- [`0003-maproom-iic-canon.md`](https://github.com/AzureLocal/platform/blob/main/decisions/0003-maproom-iic-canon.md) — MAPROOM & IIC canon design (Proposed)
122+
- Classification rubric ADR — tracked in issue [#3](https://github.com/AzureLocal/platform/issues/3), number reserved for `0004-testing-toolset-classification.md`

0 commit comments

Comments
 (0)