Skip to content

chore: fix integ test - #2467

Merged
johlju merged 2 commits into
mainfrom
fix/integ-test_test-result-value
Jul 11, 2026
Merged

chore: fix integ test#2467
johlju merged 2 commits into
mainfrom
fix/integ-test_test-result-value

Conversation

@johlju

@johlju johlju commented Jul 11, 2026

Copy link
Copy Markdown
Member

Pull Request (PR) description

  • SqlServerDsc
    • Several integration tests wrongly said that the command Test-DscConfiguration
      return $true when it is in fact return the string value 'True'.

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation updated in the resource's README.md.
  • Resource parameter descriptions updated in schema.mof.
  • Comment-based help updated, including parameter descriptions.
  • Localization strings updated.
  • Examples updated.
  • Unit tests updated. See DSC Community Testing Guidelines.
  • Integration tests updated (where possible). See DSC Community Testing Guidelines.
  • Code changes adheres to DSC Community Style Guidelines.

This change is Reviewable

@johlju
johlju requested a review from a team as a code owner July 11, 2026 14:22
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a0f4432c-8762-45a3-bcd2-df3466305cc4

📥 Commits

Reviewing files that changed from the base of the PR and between 80a7d9c and 795ffe0.

📒 Files selected for processing (1)
  • tests/Unit/Public/Update-SqlDscServerEdition.Tests.ps1

Walkthrough

The PR updates SQL Server DSC integration test descriptions and selected assertions to represent Test-DscConfiguration results as 'True', documents the correction, and changes edition-update unit tests to match required argument fragments.

Changes

Test-DscConfiguration result normalization

Layer / File(s) Summary
Changelog clarification
CHANGELOG.md
Documents the corrected 'True' representation for Test-DscConfiguration results.
Integration test descriptions and assertions
tests/Integration/Resources/DSC_Sql*.Integration.Tests.ps1
Updates affected Pester descriptions and selected assertions from $true to True or 'True'; SQL role checks also use -ErrorAction 'Stop'.
Edition update argument matching
tests/Unit/Public/Update-SqlDscServerEdition.Tests.ps1
Changes setup-process argument checks from exact matching to case-sensitive substring matching.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related but too generic to identify the main change in the PR. Use a concise title that mentions the integration test fixes and the Test-DscConfiguration True/$true wording change.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description matches the changeset and summarizes the integration test and changelog updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Around line 15-17: Update the SqlServerDsc changelog entry so both clauses use
“returns” instead of “return,” while preserving the existing wording and
formatting.

In `@tests/Integration/Resources/DSC_SqlAgentAlert.Integration.Tests.ps1`:
- Line 114: Update the affected It descriptions so every description starts with
“Should” and removes “when”, while preserving each test’s intended behavior.
Apply this to all listed descriptions in
tests/Integration/Resources/DSC_SqlAgentAlert.Integration.Tests.ps1 (114, 166),
DSC_SqlAgentFailsafe.Integration.Tests.ps1 (105, 157),
DSC_SqlAgentOperator.Integration.Tests.ps1 (105, 157, 209, 261),
DSC_SqlAlwaysOnService.Integration.Tests.ps1 (156, 206),
DSC_SqlScriptQuery.Integration.Tests.ps1 (146-148, 201-203, 294-296), and
DSC_SqlWindowsFirewall.Integration.Tests.ps1 (143-144).

In `@tests/Integration/Resources/DSC_SqlRSSetup.Integration.Tests.ps1`:
- Line 186: Update every affected Pester It description so it starts with
“Should” and contains no “when”; use outcome-focused wording such as “Should
return True from Test-DscConfiguration.” Apply this to
tests/Integration/Resources/DSC_SqlRSSetup.Integration.Tests.ps1:186-186;
DSC_SqlRS_Default.Integration.Tests.ps1:169-169, 343-343, 413-413;
DSC_SqlReplication.Integration.Tests.ps1:141-141, 196-196, 251-251, 306-306;
DSC_SqlScript.Integration.Tests.ps1:184-186, 239-241, 332-334, 425-427;
DSC_SqlSecureConnection.Integration.Tests.ps1:119-119, 171-171;
DSC_SqlServiceAccount.Integration.Tests.ps1:146-146, 197-197, 248-248, 299-299,
383-383, 434-434, 485-485, 536-536; and
DSC_SqlSetup.Integration.Tests.ps1:253-253, 390-390, 544-544, 704-704, 864-864.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3f0bc365-6099-4176-b64c-2c638821820a

📥 Commits

Reviewing files that changed from the base of the PR and between b7c9be7 and 80a7d9c.

📒 Files selected for processing (28)
  • CHANGELOG.md
  • tests/Integration/Resources/DSC_SqlAgentAlert.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlAgentFailsafe.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlAgentOperator.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlAlwaysOnService.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlAudit.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlDatabase.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlDatabaseMail.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlDatabasePermission.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlDatabaseUser.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlEndpoint.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlLogin.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlPermission.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlProtocol.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlProtocolTcpIp.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlRS.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlRSSetup.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlRS_Default.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlReplication.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlRole.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlScript.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlScriptQuery.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlSecureConnection.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlServiceAccount.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1
  • tests/Integration/Resources/DSC_SqlWindowsFirewall.Integration.Tests.ps1

Comment thread CHANGELOG.md
Comment thread tests/Integration/Resources/DSC_SqlAgentAlert.Integration.Tests.ps1
Comment thread tests/Integration/Resources/DSC_SqlRSSetup.Integration.Tests.ps1
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94%. Comparing base (b7c9be7) to head (795ffe0).

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2467   +/-   ##
=====================================
  Coverage     94%     94%           
=====================================
  Files        227     227           
  Lines      10871   10871           
=====================================
+ Hits       10234   10235    +1     
+ Misses       637     636    -1     
Flag Coverage Δ
unit 94% <ø> (+<1%) ⬆️
see 1 file with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@johlju
johlju merged commit 846fbeb into main Jul 11, 2026
40 of 41 checks passed
@johlju
johlju deleted the fix/integ-test_test-result-value branch July 11, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant