Skip to content
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

Update tests to be able to run them outside of AppVeyor #9406

Merged
merged 21 commits into from
Jul 1, 2024

Conversation

andreasjordan
Copy link
Contributor

@andreasjordan andreasjordan commented Jun 24, 2024

I want to run all the tests on a local lab using "real world" sql server instances.

I started with Get-DbaDb*, but try to get all tests working. Current target: getting -DbaDb working.

I learned that some test only work if the instance is on localhost. I think this is not very realistic as we promote to run dbatools on a central admin server, but sometime we need to move files around. Will try to get an overwiew and document this in the tests.

Will update this PR in the next days.

@andreasjordan andreasjordan marked this pull request as draft June 25, 2024 10:33
@andreasjordan andreasjordan marked this pull request as ready for review June 26, 2024 17:42
Context "Gets compatibility for multiple databases" {
$results = Get-DbaDbCompatibility -SqlInstance $script:instance1
It "Gets results" {
$results | Should Not Be $null
}
Foreach ($row in $results) {
It "Should return Compatiblity level of Version100 for $($row.database)" {
$row.Compatibility | Should Be "Version100"
It "Should return correct compatiblity level for $($row.database)" {
Copy link
Contributor

@niphlod niphlod Jun 26, 2024

Choose a reason for hiding this comment

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

compatIbility here. may sound nitpicky, but given we're reviewing, we may fix "formalities" as well.

@@ -16,6 +16,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
BeforeAll {
$server = Connect-DbaInstance -SqlInstance $script:instance2
$versionName = $server.GetSqlServerVersionName()
Copy link
Contributor

Choose a reason for hiding this comment

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

didn't even know this existed, cool.

@@ -15,29 +15,47 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' {

Describe "$commandname Integration Tests" -Tag "IntegrationTests" {
BeforeAll {
$skip = $false
Copy link
Contributor

Choose a reason for hiding this comment

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

I never really got to use this function and I fear it spun up by potatoqualitee's period on working tirelessly on sharepoint farms. That being said I'm seeing multiple reports about either SQLPS loading DLLs that interfere with us and also DacFx-related issues (many cycling around core-noncore dilemma). That being said I trust you on this change, maybe @potatoqualitee can chime in.

Copy link
Member

Choose a reason for hiding this comment

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

i dont remember anything and also trust the change 😅

@@ -95,10 +95,14 @@ Describe "$CommandName Integration Tests for Async" -Tags "IntegrationTests" {
}
}

# TODO: I think I need some background on this. Was the intention to create the key or not to creeate the key?
Copy link
Contributor

Choose a reason for hiding this comment

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

I concur with the "I don't know" bit

Copy link
Contributor

@niphlod niphlod left a comment

Choose a reason for hiding this comment

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

added some comments here and there, in general, LGTM

@niphlod niphlod changed the title Update tests to be able to run them outside of AppVayor Update tests to be able to run them outside of AppVeyor Jun 26, 2024
@andreasjordan
Copy link
Contributor Author

Thanks for the comments. Will update the PR tomorrow.

@andreasjordan
Copy link
Contributor Author

Ok, I will stop here and not add any more commits to get this merged first.

But I can roll back individual files if the changes need more discussion.

@potatoqualitee
Copy link
Member

beautiful! thank you both 🙇🏼 i will work on that dacfx issue hopefully this week or next.

@potatoqualitee potatoqualitee merged commit 00e3f97 into development Jul 1, 2024
13 checks passed
@potatoqualitee potatoqualitee deleted the tests_refactoring branch July 1, 2024 09:43
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.

3 participants