diff --git a/docs/StandardsDecisions.md b/docs/StandardsDecisions.md index 5b3d79d..407a2fc 100644 --- a/docs/StandardsDecisions.md +++ b/docs/StandardsDecisions.md @@ -29,6 +29,7 @@ Each decision is one of three: | MOD-20, static data under `Data` | Build, as [#134](https://github.com/fadwen/IntuneScriptLab/issues/134) | The rule order, the inbox module table, the Windows release builds and the map of agent log events are `.psd1` files under `Data`. The root module reads each into a `$script:` variable when it is imported, and a file that is missing or does not parse fails the import. A data file holds constants only, so an agent log pattern too long for one line is an array of parts that `Get-IslAgentLogEvent` joins. | | MOD-21, a cache with an expiry | Does not fit | The module caches what it fetches within one run, and that run is the expiry that fits. `Get-IslAssignmentFilter` and `Test-IslDeviceGroup` keep a filter and a group's answer in the run's `Cache`, so a filter or group that several policies share is fetched once. Across runs a cache would be wrong: a tenant pre-flight has to read the tenant as it is now. The index of a parsed syntax tree is kept in a `ConditionalWeakTable` for as long as that tree exists. | | TST-43, performance and security tests | Build, as [#135](https://github.com/fadwen/IntuneScriptLab/issues/135) | `Tests/Performance/AgentLogReader.Tests.ps1` measures `Get-IntuneAgentLog` and `Get-IntuneAgentTimeline` on a generated log of 10,000 lines, time and memory against limits and the growth from 2,500 lines, and runs as `-TestType Performance` in the tests job. `Tests/Unit/Module.Credential.Tests.ps1`, tagged `Security`, shows that a `-Credential` password reaches the task registration and no stream, error, result or file; the input-length and pre-flight path tests carry the tag too. | +| TST-47, unit tests in less than 30 seconds | Does not fit | The unit run takes 69 to 86 seconds locally and 72 seconds on the ARM runner, for 2,211 tests in 164 files. In the 86-second run that was 9 seconds of discovery, 16 of Pester's own work and 61 in the tests; in the 69-second run, 4, 14 and 50. It took 157 seconds, and 206 on the ARM runner, until the tests that start processes, read the real machine or run a script as a caller were tagged `Integration` ([#70](https://github.com/fadwen/IntuneScriptLab/issues/70)). The build and the ARM job run those in a second run; the tests and 5.1 jobs run every suite in one. What is left is spread out: no file takes more than 7 seconds. The slowest are the pre-flight, which mocks Graph and analyzes the scripts it returns, the diagnostic package, which writes real zip files from fixture logs, and the module contract, which imports the module anew and reads the help of every command. Pester's `Run.Parallel` brought the run to 50 seconds at best, at four or eight workers and never below, because each worker imports the module again, in about a second, for each file; and the workers share `$env:ProgramData` and the other variables the harness tests set, which failed 7 to 38 tests a run. Under 30 seconds would take fewer tests, not faster ones. | | CIC-13, performance gate | Build after TST-43, as [#136](https://github.com/fadwen/IntuneScriptLab/issues/136) | `Build/Test-PerformanceBaseline.ps1` compares the median of three runs of `Tests/Performance` with the baselines in `Tests/Performance/Baselines.psd1`, recorded for each hosted runner image, PowerShell version and architecture, and fails a median above its margin. A runner without a baseline, such as a new image, is reported and not gated. | | CIC-14, documentation gate for the README | Build, as [#137](https://github.com/fadwen/IntuneScriptLab/issues/137) | `Build/Test-MarkdownLink.ps1`, run by the `help` job, checks the anchors and relative links of the README and the other Markdown, as `docs/` is checked by `Build-Help.ps1 -ValidateOnly`. | | CIC-12, credential and dependency scanning | Build, as [#127](https://github.com/fadwen/IntuneScriptLab/issues/127) | No workflow scans for credentials. The standards installer adds a scan with `-IncludeCredentialScan`; the module has no dependencies to scan. |