PowerShell / PowerShell/DSC

DSC does not validate Test method returns _inDesiredState

Open
#962 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dev-UX Issue-Bug
Dominant language
Rust
Stars
523
Forks
75
Avg merge
3d 16h
Merged PRs (30d)
24

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Summary

In the documentation for Test method it states that the resource must return an object with a _inDesiredState property. However, if you return an object without that property DSC does not throw an error.

Steps to reproduce

Create resource with Test method and return object without _inDesiredState

Expected behavior
Error is thrown
Actual behavior
No error is thrown
Error details

Environment data
7.6-preview4
Version

dsc 3.2.0-preview.2

Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using DSC 3.2.0-preview.2 and a resource whose Test method returns an object without _inDesiredState. Trace the validation path for Test results and add or update a regression test; done means the invalid result raises an error while valid results continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, rust
Domain
devops, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.