Add support for passing a PesterConfiguration object to PowerShellBuild
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- PowerShell
- Sterne
- 145
- Forks
- 27
- Ø Merge
- 10 Std. 16 Min.
- Gemergte PRs (30 T.)
- 34
Beschreibung
Currently PowerShellBuild accepts several options to control how Pester is invoked through the $PSBPreference variable. However, there are more Pester options available if you go the "advanced" route and pass in a [PesterConfiguration] object.
You can generate a configuration a few different ways...
$config = New-PesterConfiguration
$config = [PesterConfiguration]::Default
$config = [PesterConfiguration]::new()
We could support all Pester options in an easier way than implementing $PSBPreference settings for each of them individually by allowing users to provide their own Pester configuration like so...
# file: psakeFile.ps1
Properties {
$PSBPreference.Test.Configuration = New-PesterConfiguration -Hashtable @{
# Change defaults as needed. For example...
Run = @{
SkipRemainingOnFailure = 'Run'
}
}
}
There are some considerations though. For example, the advanced option allows providing multiple paths. Should PowerShellBuild be opinionated and aim to maintain the current test behavior by default? If PowerShellBuild overrides properties like Run.Path, should the user be allowed to change that? How so?
Maybe other values from $PSBPreference.Test should be used to override the user-supplied [PesterConfiguration] and if they want to override those defaults, they should do it by updating the corresponding $PSBPreference.Test.* property?
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit nachzuverfolgen, wie PowerShellBuild Pester aufruft und wie die vorhandenen $PSBPreference.Test-Optionen angewendet werden. Prüfe den vorgeschlagenen Wert $PSBPreference.Test.Configuration und die Beispiele für PesterConfiguration und kläre anschließend die Priorität für Pfade und andere Einstellungen. Erledigt ist die Aufgabe, wenn Benutzer eine Konfiguration angeben können und das beabsichtigte Standardtestverhalten weiterhin klar und abgedeckt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell
- Bereich
- testing
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Aktiv
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100