-
-
Notifications
You must be signed in to change notification settings - Fork 860
Install-DbaMaintenanceSolution.Tests: make the additional backup parameters tests run #10145
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
base: development
Are you sure you want to change the base?
Conversation
…me suspect they do not.
|
Tests now pass locally but fail in AppVeyor. Not sure how to fix that yet, but it's progress!
|
|
Adding I'll try some stupid ideas just in case anything works. |
|
Progress! It appears that appending |
|
Thank you, @ReeceGoding ! @andreasjordan has made a lot of progress in the tests arena and I will let him approve this as I have not been following along as much. |
|
Root cause might be these messages: We see them just on AppVeyor and I still don't know why. Let me do some tests in my lab... |
|
You might want to test on my branch, @andreasjordan . I think that if you use the current dev branch, you'll run into the skipping and tempdb issues I've mentioned. |
|
I think we should try to find the root cause for the the message "Log entry string is too long." Some process inside of dbatools write a lot of stuff to the eventlog. That happens in other tests as well. It does not happen in my lab, so it is hard to test. The error is thrown here: $sql is one of the scripts from Ola Hallengren. So I think ".Invoke" does something special on the AppVeyor platform. |
|
We have another case in another test that calls Get-DbaUserPermission. There this code failes: If I look at the verbose messages I can see that it fails between the second and third message. As |
|
Also effected: But there is no string manipulation taking place. Most likely |
|
I made some progress! I changed some code in From: To: And the errror message on AppVeyor changed. So we have two problems:
Maybe we should change all catch blocks followed by And I would love to know why very big batches fail on the AppVeyor platform and work just fine everywhere else. |
|
I've done a lot of tests but have not managed to get to the root cause. I hope that using Invoke-DbaQuery for big batches will help. I just opened a new pull request to see if that helps. |
|
I opened #10149 to change the usage from |
|
it is merged 👍🏼 |
c8b5896 to
ad2eb1f
Compare
|
Thanks all! I've rebased and pushed. The tests continue to work locally with my edits, except for when I deliberately make the skip conditions trigger. This is now just a matter of waiting on AppVeyor. It will also be interesting to see if new branches unrelated to this one still have the Install-DbaMaintenanceSolution tests fail. Until this is merged, they should. |
|
|
||
| # Verify installation succeeded before running tests | ||
| # Skip tests if installation failed (eg. due to event log limitations on AppVeyor or SQL Agent not running) | ||
| $script:installationSucceeded = $false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prefix script: should not be needed and should be removed everywhere in the code. This is a legacy issue.
andreasjordan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even without removing the script:, this PR is ready to be merged. We can remove the script: later in all of the tests.

Type of Change
Invoke-ManualPester)Purpose
As mentioned in passing in #10144, I'm struggling to convince myself that the "Additional backup parameters" in
Install-DbaMaintenanceSolution.Tests.ps1run. I can see warnings in appveyorand
Invoke-ManualPester -Path tests/Install-DbaMaintenanceSolution.Tests.ps1 -ScriptAnalyzer -Show Detailed -TestIntegrationskipped them on my machine as well.These tests were introduced in this commit and the PR suggests some difficulty with appveyor at the time. That said, I can believe that this is all just me being confused. Today is the first day that I've had to get serious about
Invoke-ManualPester.Once this has been looked at, I'll be able to approach #10133 with more confidence. #10133 will require me adding more tests to this file, so I would like to be confident in this file's code before I start copy and pasting it.
Approach
I'm really not a Pester expert, but my assessment is that
-Skip:(-not $script:installationSucceeded)in the original code runs before$script:installationSucceededis defined, so these tests are always skipped. Refactoring to useSet-ItResultis, as far as I know, idiomatic Pester.I also made the tempdb block match the earlier one. All signs are that
DROP PROCEDUREdoes not work with 3-part names.Commands to test
Run
Invoke-ManualPester -Path tests/Install-DbaMaintenanceSolution.Tests.ps1 -Show Diagnostic -TestIntegrationon this branch and on the current development branch. If I'm right, only my branch will run this test.