Skip to content

Commit 8ac5882

Browse files
Copilotjohlju
andcommitted
Fix integration test authentication and add README reference to copilot instructions
Co-authored-by: johlju <[email protected]>
1 parent 59d8ba4 commit 8ac5882

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/copilot-instructions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ or later, after the Database Engine installation tests).
311311
When integration tests need the computer name in CI environments, always use
312312
the Get-ComputerName command, which is available in the build pipeline.
313313

314+
For integration testing commands use the information in the
315+
tests/Integration/Commands/README.md, which describes the testing environment
316+
including available instances, users, credentials, and other configuration details.
317+
314318
All integration tests must use the below code block prior to the first
315319
`Describe`-block. The following code will set up the integration test
316320
environment and it will make sure the module being tested is available

tests/Integration/Commands/Assert-SqlLogin.Integration.Tests.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ Describe 'Assert-SqlLogin' -Tag @('Integration_SQL2016', 'Integration_SQL2017',
3737

3838
Context 'When connecting to SQL Server instance' {
3939
BeforeAll {
40-
$script:serverObject = Connect-SqlDscDatabaseEngine -InstanceName $script:instanceName
40+
$script:sqlAdminCredential = New-Object -TypeName 'System.Management.Automation.PSCredential' -ArgumentList @(
41+
'SqlAdmin',
42+
('P@ssw0rd1' | ConvertTo-SecureString -AsPlainText -Force)
43+
)
44+
$script:serverObject = Connect-SqlDscDatabaseEngine -InstanceName $script:instanceName -Credential $script:sqlAdminCredential
4145
}
4246

4347
Context 'When a login exists' {

0 commit comments

Comments
 (0)