Comments (3)
Very interesting question. It's always a compromise between what you can test and what you should mock. In the spirit of discussion PowerShell/DscResources#9 I would recommend the following:
- Separate tests to Unit Tests and End-To-End tests.
- Mock all API calls that can harm user machine configuration in Unit Tests.
- Use
try { Setup ... } finally { Cleanup }
pattern in End-To-End, to make sure that End-To-End tests don't harm user machine configuration.
In our CI system we would run all the tests (machine would be blown away every time), but we also want enable local test runs, so it's important to cleanup everything.
from webadministrationdsc.
I decided for myself to do mostly real testing rather than mocking, because that doesn't prove anything. In huge projects mocking can be a real time saver, but I think we should really test the resources we are writing.
from webadministrationdsc.
My only suggestion here would be that you place this in the integration folder. This way people can avoid running the tests if they are worried about something breaking on their own dev machine (I run all tests every time I publish a change for example).
from webadministrationdsc.
Related Issues (20)
- xWebapppool will not compile using identitytype gMSA HOT 2
- xWebConfigProperty: Location is not supported HOT 2
- WebApplication: Physical path overwritten after desired state applied HOT 7
- xIisFeatureDelegation Failed to invoke DSC Set method: The request is not supported. HOT 7
- xWebApplication fails obtain desired state if multiple SSL flags are specified.
- xWebConfigPropertyCollection: Adding system.webServer/security/authorization fails Test-TargetResource HOT 3
- xWebAdministration: Rename master branch to main
- Parameter 'PhysicalPath' should point to existing path, on Azure File Share HOT 4
- Unable to configure IIS using PowerShell DSC Resource xWebAdministration v3.20 HOT 3
- Can you set multiple file extensions to allowed for request filtering? HOT 1
- Suported? - xWebSite - Windows Authentication - Advanced Settings/Providers HOT 2
- WebApplication: Integration test failing
- How to add credentials with empty password in xWebAppPool. HOT 2
- Confusing package names in PowerShell Gallery HOT 5
- Name will not take ".Net6 Core ", Net6 Core works but want the "." HOT 1
- WebAppPoolDefaults : Add Missing Configuration Items
- xWebAppPool and xWebApplication cannot delete entities in use and do nothing HOT 1
- Website: PowerShell DSC resource DSC_WebSite failed to execute Test-TargetResource functionality with error message: System.Exception: Please ensure that the PowerShell module 'WebAdministration' is installed.
- Website: unable to change advanced Authentication Settings HOT 1
- IisFeatureDelegation wipes out config 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 webadministrationdsc.