psake / psake/PowerShellBuild

Add support for passing a PesterConfiguration object to PowerShellBuild

Aperta
#83 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement
Lingua principale
PowerShell
Stelle
145
Fork
27
Merge medio
10h 16m
PR unite (30g)
34

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia tracciando il modo in cui PowerShellBuild invoca Pester e come vengono applicate le opzioni $PSBPreference.Test esistenti. Esamina il valore proposto $PSBPreference.Test.Configuration e gli esempi di PesterConfiguration, quindi stabilisci la precedenza per i percorsi e le altre impostazioni. Il lavoro è completato quando gli utenti possono fornire una configurazione e il comportamento di test predefinito previsto rimane chiaro e coperto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
powershell
Ambito
testing
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Attiva
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.