Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Remove default values of ExcludeTag parameter in favor of opt-in #274

Closed
johlju opened this issue Aug 8, 2018 · 1 comment
Closed

Remove default values of ExcludeTag parameter in favor of opt-in #274

johlju opened this issue Aug 8, 2018 · 1 comment
Labels
enhancement The issue is an enhancement request.

Comments

@johlju
Copy link
Contributor

johlju commented Aug 8, 2018

Since the parameter ExcludeTag on the function Invoke-AppveyorTestScriptTaskis not intuitive.
I wonder if we can make it obsolete, or rather remove the default values, by using opt-in.

It defaults to 'Examples' and 'Markdown'.

$ExcludeTag = @('Examples', 'Markdown'),

They are meant to exclude the meta tests (common tests) for examples and markdown.

if ($ExcludeTag.Count -gt 0)
{
$pesterParameters += @{
ExcludeTag = $ExcludeTag
}
}

But the tests with markdown has already an opt-in.

Describe 'Common Tests - Validate Markdown Files' -Tag 'Markdown' {
$optIn = Get-PesterDescribeOptInStatus -OptIns $optIns

Same with the example tests.

Describe 'Common Tests - Validate Example Files' -Tag 'Examples' {
$optIn = Get-PesterDescribeOptInStatus -OptIns $optIns

Describe 'Common Tests - Validate Example Files To Be Published' -Tag 'Examples' {
$optIn = Get-PesterDescribeOptInStatus -OptIns $optIns

So I think it is safe to remove the default values from this parameter, since all those thests must be opt-in by op-tin in the file .MetaTestOptIn.json.

[
"Common Tests - Validate Module Files",
"Common Tests - Validate Markdown Files",
"Common Tests - Validate Example Files",
"Common Tests - Validate Script Files"
]

@johlju
Copy link
Contributor Author

johlju commented Aug 8, 2018

With this change, each repo can use the parameter to correctly exclude tag they prefer.

@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Aug 8, 2018
johlju added a commit that referenced this issue Aug 11, 2018
…ing opt-in (#277)

- Removed the default values of the parameter `ExcludeTag` in favor of using
  opt-in. Default is that those tests are opt-out, and must be opt-in (issue #274).
- Excluding tag 'Examples' when calling `Invoke-AppveyorTestScriptTask` since
  this repository will never have examples.
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Aug 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement The issue is an enhancement request.
Projects
None yet
Development

No branches or pull requests

1 participant