Open DexterPOSH opened 7 years ago
Thinking aloud. Should PSRemotely support passing tags at two different scopes?
This would capability to organize tests targeting the same nodes.
PSRemotely {
Node AD -Tag ServiceValidation {
# Service tests
}
Node AD -Tag DomainGroupsValidation {
# tests run on domain groups
}
}
This would give capability to organize tests using Pester Describe blocks.
PSRemotely {
Node AD {
# Service tests
Describe 'Service test' -tag Service {
# tests
}
# Domain group tests
Describe 'DomainGroups test' -tag domaingroup {
# tests
}
}
}
Now the default would be passing tags to test scope. For example -
Invoke-PSRemotely -Tag Service
Now the above would only run Pester tests (Describe blocks) marked with the specified tag.
To support more flexibility to the DSL by allowing tags at the node scope, thinking of adding -Tag parameter supports a hash table as an alternative like below:-
Invoke-PSRemotely -Tag @{Scope='Node';Name=@('ServiceValidation','DomainGroupsValidation')}
Or we can add a parameter named -PesterSplatHash which takes a hashtable and splats that to the Invoke-Pester on the PSRemotely node while running the tests. This is much cleaner and less amount of work.
This requires some unit and integration tests coverage before it can be merged.
This one is not completely ready. Want the ability to specify tags to PSRemotely while invoking it.
Now the above should flow down the tag to the remote nodes and only run ops validation tests marked with the same tag.