Skip to content

Fixes for a lot of tests that outputed unwanted warnings #9764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 49 commits into from
Aug 10, 2025

Conversation

andreasjordan
Copy link
Contributor

@andreasjordan andreasjordan commented Aug 9, 2025

Mostly small changes like -WarningAction SilentlyContinue, but sometimes refactoring to help migrate this test to pester 5 later.

@andreasjordan andreasjordan changed the title Fix some tests that outputed unwanted warnings Fixes for a lot of tests that outputed unwanted warnings Aug 9, 2025
@andreasjordan
Copy link
Contributor Author

The original version of Set-DbaAgentJobStep.Tests.ps1 failes with:

Running C:\github\dbatools\tests\Set-DbaAgentJobStep.Tests.ps1
[15:48:08][New-DbaAgentJob] Something went wrong creating the job. 
 | Value cannot be null.
Parameter name: newParent
Running C:\github\dbatools\tests\Set-DbaAgentJobStep.Tests.ps1
[15:48:10][New-DbaAgentJob] Something went wrong creating the job. 
 | Value cannot be null.
Parameter name: newParent
Running C:\github\dbatools\tests\Set-DbaAgentJobStep.Tests.ps1
[15:48:11][New-DbaAgentJob] Something went wrong creating the job. 
 | Value cannot be null.
Parameter name: newParent
appveyor.pester: Running with Pester Version 5.6.1
Dumping message log into c:\github\dbatools\dbatools_messages.xml
Skipping dump of error log into c:\github\dbatools\dbatools_errors.xml
.\Tests\appveyor.pester.ps1 -Finalize -IncludeCoverage
Uploading artifact dbatools_messages_and_errors.xml.zip (20,778 bytes)...100%
Failed tests summary (pester 4):
Describe : Set-DbaAgentJobStep Integration Tests
Context  : 
Name     : It Error occurred in Describe block
Result   : Failed
Message  : Cannot bind argument to parameter 'SqlInstance' because it is null.

Probably because instance1 is an express edition. So I changed it to instance3.

But this failes with:

Running C:\github\dbatools\tests\Set-DbaAgentJobStep.Tests.ps1
[16:34:18][Set-DbaAgentJobStep] Something went wrong changing the job step | The specified '@server' is invalid (valid values are returned by sp_helpserver).
Running C:\github\dbatools\tests\Set-DbaAgentJobStep.Tests.ps1
[16:34:28][Set-DbaAgentJobStep] Something went wrong changing the job step | The specified '@server' is invalid (valid values are returned by sp_helpserver).
Running C:\github\dbatools\tests\Set-DbaAgentJobStep.Tests.ps1
[16:34:40][Set-DbaAgentJobStep] Something went wrong changing the job step | The specified '@server' is invalid (valid values are returned by sp_helpserver).
appveyor.pester: Running with Pester Version 5.6.1
Dumping message log into c:\github\dbatools\dbatools_messages.xml
Skipping dump of error log into c:\github\dbatools\dbatools_errors.xml
.\Tests\appveyor.pester.ps1 -Finalize -IncludeCoverage
Uploading artifact dbatools_messages_and_errors.xml.zip (28,542 bytes)...100%
Failed tests summary (pester 4):
Describe : Set-DbaAgentJobStep Integration Tests
Context  : command works
Name     : It set a step with all attributes for Subsystem=CmdExec
Result   : Failed
Message  : Expected 'CmdExec', but got TransactSql.

I just have no idea why. It works perfectly in my lab with SQL Server 2022.

@andreasjordan
Copy link
Contributor Author

This PR is finished and can be reviewed and merged.

@potatoqualitee

@potatoqualitee
Copy link
Member

yeah some commands are just confusing and hard. that one has always been a problem :/

@potatoqualitee potatoqualitee merged commit 072e653 into development Aug 10, 2025
14 checks passed
@potatoqualitee potatoqualitee deleted the fix_test_warnings branch August 10, 2025 04:55
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.

2 participants