From abe92833b3fcb15626684e697c193d9db65194d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Sat, 5 Sep 2026 10:03:41 +0200 Subject: [PATCH 1/3] Apply Pester.BeforeContainer.ps1 when only discovery runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run.SkipRun returns the discovered tree without executing anything, which is the path the VS Code Test Explorer uses to populate. It goes through Discover-Test, a batch discovery over all containers, and that function never took the BeforeContainer map, so it called Invoke-ContainerDiscovery without -BeforeContainerFile. A file whose discovery depends on the setup discovered fine in a normal run and came back empty when only discovery was requested. Discover-Test now takes the same map the interleaved discover -> run path gets, and resolves it per container, because which files apply depends on where the container is after #2993. Find-Test forwards it too. The per container lookup was written inline in Invoke-Test and is now a function that both paths call, so they cannot drift apart again. That also removes the case-insensitive variable name trap the inline version needed a comment to explain. Fix #3008 🤖 --- docs/NEXT-RELEASE.md | 7 ++++- src/Pester.Runtime.ps1 | 47 +++++++++++++++++++++----------- tst/Pester.RSpec.Parallel.ts.ps1 | 40 +++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 17 deletions(-) diff --git a/docs/NEXT-RELEASE.md b/docs/NEXT-RELEASE.md index d7f02882f..7a8a69781 100644 --- a/docs/NEXT-RELEASE.md +++ b/docs/NEXT-RELEASE.md @@ -1,4 +1,4 @@ -