Comments (9)
Can you provide more details about your proposition? Perhaps including scenario where you need to target particular set of tests.
from dscresource.tests.
A small example (please don't put too much in to this specific case though) would be separating the script analyzer tests from project-specific unit tests. A larger example in the future would be separating unit tests that can be run in persistent VM's from integration tests that require ephemeral VM's. This very well might just be 'planning ahead'.
from dscresource.tests.
If it's common tests vs unit tests vs integration, those are all in separate directories, so all you need to do is to call invoke-pester inside of it. I was wondering if you meant some more granular distinction, but if it's just that, I think we don't need tags, as it's very easy to target any of those currently.
from dscresource.tests.
That being said, looks like pester has tag support implemented already, so if we come up with need for targeting more specific sets of tests, that'd be very easy to do:
https://github.com/pester/Pester/wiki/Describe#tags
from dscresource.tests.
I think I understand the reason for this - and agree the pester tags would be useful here.
An example:
With Distributed File System (DFS) DSC resources the integration test currently only cover testing a replication group with a single node. Ideally a proper integration test would create a rep group with two or more nodes. But clearly this isn't possible on Appveyor, but may be possible when testing locally.
Currently I have these tests defined, but they are commented out and you have to uncomment them for them to run. A better way to handle them would be to have define them with a tag say "NoAppVeyorRun" (or something similar) and change the AppVeyor.yml so that when it runs pester it passes the parameter -ExcludeTag "NoAppVeyorRun".
@mgreenegit - is this sort of what you had in mind? If so, @KarolKaczmarek is right, I don't think it needs any changes to implement.
from dscresource.tests.
I have started to add tags on some of the tests, those tests that are opt-in. But the tags are more for debugging purposes. So I don't have to run all the tests when changing a particular test, but instead can run that specific group of tests. We could add tags on the rest of the describe blocks as well. for debugging purposes.
Adding tags for bigger scenarios without have an actual use case seems unnecessary?
@PlagueHO We have started to use if ($env:APPVEYOR -eq $true)
for those tests that should not run in AppVeyor. Is that enough? That could be used for both the common tests and tests for each repository.
To close this issue, should we add tags on the rest of the common tests describe blocks (for debugging purposes), or should we just close this issue, because it is not relevant anymore?
from dscresource.tests.
@johlju - I think this issue is still relevant - but it has been a while? It would be good to get a user story together for this to figure out what is best.
Perhaps what @mgreenegit might have been talking about was defining a list of common tags like:
- Full
- Smoke
And then specifying which groups each of the core test should be included in?
But I'm not 100% sure. This was over a year ago after all (I can barely remember last week) 😁
from dscresource.tests.
Today we have ExcludeTag
parameter on Invoke-AppveyorTestScriptTask
. it would be easy enough to add a Tag
parameter as [System.String[]] that is also added to the Pester arguments. While we are at it we could add TestName
as [System.String[]] to, then there are options to run whatever you would like depending how the AppVeyor environment is configured.
from dscresource.tests.
The unit test template has -Tag
added to each Describe
-block. Since there are no clear scenario to cover above that, I'm closing this as 'not fixed'.
from dscresource.tests.
Related Issues (20)
- Nuget Spec Generated by AppVeyor invalid for PS Module Repository HOT 1
- Additional localization tests
- When opt-in to markdown links check, the cloned DscResource.Tests is also checked HOT 1
- Remove manual step in auto-documentation HOT 1
- Auto-documentation should document helper functions inside the Modules folder HOT 4
- Refactor DscResource.DocumentationHelper/PowerShellHelp.psm1/New-DscResourcePowerShellHelp
- New-DscResourcePowerShellHelp: Should output the help keyword .EXAMPLE in upper-case HOT 1
- Test-PublishMetadata: Exception Raised If the Example being tested has an invalid GUID
- Invoke-AppveyorAfterTestTask: Exception Calling New-DscResourcePowerShellHelp when Type is 'Wiki' HOT 2
- Wikik documentation should separate read-only parameters from the parameters table
- Wiki documentation should create code quotes for variables in parameter descriptions
- New-DscResourcePowerShellHelp: Generates white space on blank rows in the .DESCRIPTION section
- New-DscResourcePowerShellHelp: Files are generated as UTF-8 with BOM
- The custom rules should be listed and reference the style guideline rule it belongs to HOT 1
- Code formatting: newlines before and after if statement block HOT 1
- Add Tests to Ensure DSC Resource Names are added to DSCResourcesToExport in Manifest
- Generation of Wikipages throws an error HOT 3
- New-DscResourceWikiSite: Array DataTypes Have Changed Format HOT 3
- Get-MofSchemaObject: Credential Attribute Output DataType has Changed
- Common Tests - File Formatting: References missing cmdlets HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dscresource.tests.