From ec55e36b35f95b747275261cb5400ae6a5d1504b Mon Sep 17 00:00:00 2001 From: Frode Flaten <3436158+fflaten@users.noreply.github.com> Date: Mon, 17 Jun 2024 21:47:52 +0200 Subject: [PATCH] Improve descriptions for PesterConfiguration sections (#2505) * Remove false explicit excludeline debug log * Improve descriptions for PesterConfiguration sections --- src/Pester.Runtime.ps1 | 7 ------- src/csharp/Pester/CodeCoverageConfiguration.cs | 2 +- src/csharp/Pester/FilterConfiguration.cs | 4 ++-- src/csharp/Pester/OutputConfiguration.cs | 2 +- src/csharp/Pester/RunConfiguration.cs | 2 +- src/csharp/Pester/ShouldConfiguration.cs | 2 +- src/csharp/Pester/TestDriveConfiguration.cs | 2 +- src/csharp/Pester/TestRegistryConfiguration.cs | 2 +- src/csharp/Pester/TestResultConfiguration.cs | 2 +- 9 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/Pester.Runtime.ps1 b/src/Pester.Runtime.ps1 index 4074ba1d9..8ed98e58c 100644 --- a/src/Pester.Runtime.ps1 +++ b/src/Pester.Runtime.ps1 @@ -1765,7 +1765,6 @@ function Test-ShouldRun { if ($l -eq $line) { if ($PesterPreference.Debug.WriteDebugMessages.Value) { Write-PesterDebugMessage -Scope Filter "($fullDottedPath) $($Item.ItemType) is excluded, because its path:line '$line' matches line filter '$excludeLineFilter'." - Write-PesterDebugMessage -Scope Filter "($fullDottedPath) $($Item.ItemType) is explicitly excluded, because it matched line filter, and will run even if -Skip is specified on it. Any skipped children will still be skipped." } $result.Exclude = $true $result.Explicit = $true @@ -1790,16 +1789,10 @@ function Test-ShouldRun { if ($l -eq $line) { if ($PesterPreference.Debug.WriteDebugMessages.Value) { Write-PesterDebugMessage -Scope Filter "($fullDottedPath) $($Item.ItemType) is included, because its path:line '$line' matches line filter '$lineFilter'." - } - - # if ('Test' -eq $Item.ItemType ) { - if ($PesterPreference.Debug.WriteDebugMessages.Value) { Write-PesterDebugMessage -Scope Filter "($fullDottedPath) $($Item.ItemType) is explicitly included, because it matched line filter, and will run even if -Skip is specified on it. Any skipped children will still be skipped." } $result.Explicit = $true - # } - $result.Include = $true return $result } diff --git a/src/csharp/Pester/CodeCoverageConfiguration.cs b/src/csharp/Pester/CodeCoverageConfiguration.cs index 04ccb6078..b43d7ece3 100644 --- a/src/csharp/Pester/CodeCoverageConfiguration.cs +++ b/src/csharp/Pester/CodeCoverageConfiguration.cs @@ -38,7 +38,7 @@ public static CodeCoverageConfiguration ShallowClone(CodeCoverageConfiguration c { return Cloner.ShallowClone(configuration); } - public CodeCoverageConfiguration() : base("CodeCoverage configuration.") + public CodeCoverageConfiguration() : base("Options to enable and configure Pester's code coverage feature.") { Enabled = new BoolOption("Enable CodeCoverage.", false); OutputFormat = new StringOption("Format to use for code coverage report. Possible values: JaCoCo, CoverageGutters", "JaCoCo"); diff --git a/src/csharp/Pester/FilterConfiguration.cs b/src/csharp/Pester/FilterConfiguration.cs index bea6470bc..ec09c052b 100644 --- a/src/csharp/Pester/FilterConfiguration.cs +++ b/src/csharp/Pester/FilterConfiguration.cs @@ -44,11 +44,11 @@ public FilterConfiguration(IDictionary configuration) : this() configuration.AssignArrayIfNotNull(nameof(FullName), v => FullName = v); } } - public FilterConfiguration() : base("Filter configuration") + public FilterConfiguration() : base("Filter options to include/exclude tests and blocks in the targeted containers using tags, name or location. Include by default when no include filters are provided. Exclude filters take precedence.") { Tag = new StringArrayOption("Tags of Describe, Context or It to be run.", new string[0]); ExcludeTag = new StringArrayOption("Tags of Describe, Context or It to be excluded from the run.", new string[0]); - Line = new StringArrayOption(@"Filter by file and scriptblock start line, useful to run parsed tests programmatically to avoid problems with expanded names. Example: 'C:\tests\file1.Tests.ps1:37'", new string[0]); + Line = new StringArrayOption(@"Filter by file and scriptblock start line, useful to run parsed tests programmatically to avoid problems with expanded names. Explicit filter that overrides -Skip. Example: 'C:\tests\file1.Tests.ps1:37'", new string[0]); ExcludeLine = new StringArrayOption("Exclude by file and scriptblock start line, takes precedence over Line.", new string[0]); FullName = new StringArrayOption("Full name of test with -like wildcards, joined by dot. Example: '*.describe Get-Item.test1'", new string[0]); } diff --git a/src/csharp/Pester/OutputConfiguration.cs b/src/csharp/Pester/OutputConfiguration.cs index b13cb74d5..550ee5080 100644 --- a/src/csharp/Pester/OutputConfiguration.cs +++ b/src/csharp/Pester/OutputConfiguration.cs @@ -46,7 +46,7 @@ public OutputConfiguration(IDictionary configuration) : this() } } - public OutputConfiguration() : base("Output configuration") + public OutputConfiguration() : base("Options to customize the console output generated by Pester.") { Verbosity = new StringOption("The verbosity of output, options are None, Normal, Detailed and Diagnostic.", "Normal"); StackTraceVerbosity = new StringOption("The verbosity of stacktrace output, options are None, FirstLine, Filtered and Full.", "Filtered"); diff --git a/src/csharp/Pester/RunConfiguration.cs b/src/csharp/Pester/RunConfiguration.cs index 8e67d28f1..31eb1ffc4 100644 --- a/src/csharp/Pester/RunConfiguration.cs +++ b/src/csharp/Pester/RunConfiguration.cs @@ -56,7 +56,7 @@ public RunConfiguration(IDictionary configuration) : this() } } - public RunConfiguration() : base("Run configuration.") + public RunConfiguration() : base("General runtime options for Pester including tests containers to execute.") { Path = new StringArrayOption("Directories to be searched for tests, paths directly to test files, or combination of both.", new string[] { "." }); ExcludePath = new StringArrayOption("Directories or files to be excluded from the run.", new string[0]); diff --git a/src/csharp/Pester/ShouldConfiguration.cs b/src/csharp/Pester/ShouldConfiguration.cs index bd658190f..bcdc4de45 100644 --- a/src/csharp/Pester/ShouldConfiguration.cs +++ b/src/csharp/Pester/ShouldConfiguration.cs @@ -31,7 +31,7 @@ public static ShouldConfiguration ShallowClone(ShouldConfiguration configuration return Cloner.ShallowClone(configuration); } - public ShouldConfiguration() : base("Should configuration.") + public ShouldConfiguration() : base("Options to control the behavior of the Pester's Should assertions.") { ErrorAction = new StringOption("Controls if Should throws on error. Use 'Stop' to throw on error, or 'Continue' to fail at the end of the test.", "Stop"); DisableV5 = new BoolOption("Disables usage of Should -Be assertions, that are replaced by Should-Be in version 6.", false); diff --git a/src/csharp/Pester/TestDriveConfiguration.cs b/src/csharp/Pester/TestDriveConfiguration.cs index 55c8cf72c..df4a0061a 100644 --- a/src/csharp/Pester/TestDriveConfiguration.cs +++ b/src/csharp/Pester/TestDriveConfiguration.cs @@ -12,7 +12,7 @@ public static TestDriveConfiguration ShallowClone(TestDriveConfiguration configu { return Cloner.ShallowClone(configuration); } - public TestDriveConfiguration() : base("TestDrive configuration.") + public TestDriveConfiguration() : base("Options to configure the TestDrive feature.") { Enabled = new BoolOption("Enable TestDrive.", true); } diff --git a/src/csharp/Pester/TestRegistryConfiguration.cs b/src/csharp/Pester/TestRegistryConfiguration.cs index 54cddf28d..0b64b9c5c 100644 --- a/src/csharp/Pester/TestRegistryConfiguration.cs +++ b/src/csharp/Pester/TestRegistryConfiguration.cs @@ -12,7 +12,7 @@ public static TestRegistryConfiguration ShallowClone(TestRegistryConfiguration c { return Cloner.ShallowClone(configuration); } - public TestRegistryConfiguration() : base("TestRegistry configuration.") + public TestRegistryConfiguration() : base("Options to configure the TestRegistry feature. TestRegistry is only available on Windows-systems.") { Enabled = new BoolOption("Enable TestRegistry.", true); } diff --git a/src/csharp/Pester/TestResultConfiguration.cs b/src/csharp/Pester/TestResultConfiguration.cs index 869b2e217..16295da46 100644 --- a/src/csharp/Pester/TestResultConfiguration.cs +++ b/src/csharp/Pester/TestResultConfiguration.cs @@ -34,7 +34,7 @@ public static TestResultConfiguration ShallowClone(TestResultConfiguration confi return Cloner.ShallowClone(configuration); } - public TestResultConfiguration() : base("TestResult configuration.") + public TestResultConfiguration() : base("Export options to output Pester's testresult to knwon file formats like NUnit and JUnit XML.") { Enabled = new BoolOption("Enable TestResult.", false); OutputFormat = new StringOption("Format to use for test result report. Possible values: NUnitXml, NUnit2.5, NUnit3 or JUnitXml", "NUnitXml");