Git Product home page Git Product logo

Comments (5)

tysonjhayes avatar tysonjhayes commented on June 14, 2024

Fortunately this is an easy fix, unfortunately we don't have much in the way of unit testing on this module so it'll take more time to bootstrap up the test infastructure then it will to actually correct the problem. šŸ˜€

What we should decide on is if it should be required or not.

If we change the mof file to Required (which would remove the warning) we'd have to add it to the Get-TargetResource which personally I find a bit gross as we don't actually use the physical path.

If we actually remove the required parameter on the file we then have no way of enforcing (short of checking that the variable is null and throwing, which makes me think it should just be required. So I guess adding it to Get-TargetResource is the "better" option?

from webadministrationdsc.

TravisEz13 avatar TravisEz13 commented on June 14, 2024

I agree with @tysonjhayes final analysis. Physical-Path should be required. Perhaps it's an issue in DSC that anything other than the key properties are required for Get-TargetResource. Theoretically, only the key properties should be needed to get the resources.

from webadministrationdsc.

tysonjhayes avatar tysonjhayes commented on June 14, 2024

@TravisEz13 I've got a fix for this already and can copy/paste some of my tests from xNetworking to get this going pretty quickly. Should have something I can give back by tomorrow or so (assuming appveyor plays nice with me).

from webadministrationdsc.

tysonjhayes avatar tysonjhayes commented on June 14, 2024

OK so this is actually blocked on xDSCResourceDesigner having a bug in the embedded classes. This is fixed in the cDSCResourceDesigner. So I won't be able to test this until the bug in xDSCResourceDesigner is fixed. @TravisEz13 do we want to wait until xDSCResourceDesigner is fixed for me to submit this or should I go ahead?

from webadministrationdsc.

TravisEz13 avatar TravisEz13 commented on June 14, 2024

blocked because you cannot write proper tests?

How about we add placeholder tests for the resource designer tests and add a test that tries to calls a configuration without the parameter, and verify it throws. Example with the Registry Resource, and the ValueName parameter missing:

Describe -Name 'Example' -Fixture {
    it -name 'ExampleIt' -test {

           configuration ExampleConfig
            {
                Import-DscResource ā€“ModuleName ā€™PSDesiredStateConfigurationā€™
                Registry ExampleFile
                {
                    Key = 'keyExample'
                }
            }

        {
            ExampleConfig

        } | should throw "Errors occurred while processing configuration 'ExampleConfig'."
    }
}

from webadministrationdsc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.