Skip to content

Commit

Permalink
Merge pull request #4134 from NikCharlebois/FixesInt
Browse files Browse the repository at this point in the history
Added AAD Update and Remove Tests
  • Loading branch information
NikCharlebois authored Jan 8, 2024
2 parents f442ec7 + 46f3a74 commit f6f4f9d
Showing 1 changed file with 117 additions and 0 deletions.
117 changes: 117 additions & 0 deletions .github/workflows/Global - Integration - AAD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,120 @@ jobs:
{
Write-Host "All resources in the Tenant are in the Desired State"
}
- name: Generate {Update} Integration Tests from Examples
shell: powershell
run: |
Import-Module './Tests/Integration/M365DSCTestEngine.psm1'
New-M365DSCIntegrationTest -Workload AAD -Step '2-Update'
- name: Commit {Update} Integration Tests
shell: powershell
run: |
git config --local user.email "[email protected]"
git config --local user.name "NikCharlebois"
git add D:/a/Microsoft365DSC/Microsoft365DSC/Tests/Integration/*
git pull
git commit -m "Updated {Update} AAD Integration Tests"
git push
$SHA = git rev-parse HEAD
echo "commitid=$SHA" >> $env:GITHUB_OUTPUT
- name: Run {Update} Integration Tests
shell: powershell
env:
INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }}
INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }}
run: |
$CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword)
try
{
& .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.AAD.Update.Tests.ps1 -Credential $Credential
}
catch
{
throw $_
}
try
{
$Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop
}
catch
{
throw $_
}
Write-Host ""
if ($Result.InDesiredState -eq $false)
{
Write-Host -Message "Resources below are not in the Desired State:"
foreach ($Resource in $Result.ResourcesNotInDesiredState)
{
Write-Host $Resource.InstanceName
}
throw "Could not validate that the Tenant is in the Desired State"
}
else
{
Write-Host "All resources in the Tenant are in the Desired State"
}
- name: Generate {Remove} Integration Tests from Examples
shell: powershell
run: |
Import-Module './Tests/Integration/M365DSCTestEngine.psm1'
New-M365DSCIntegrationTest -Workload AAD -Step '3-Remove'
- name: Commit {Remove} Integration Tests
shell: powershell
run: |
git config --local user.email "[email protected]"
git config --local user.name "NikCharlebois"
git add D:/a/Microsoft365DSC/Microsoft365DSC/Tests/Integration/*
git pull
git commit -m "Updated {Update} AAD Integration Tests"
git push
$SHA = git rev-parse HEAD
echo "commitid=$SHA" >> $env:GITHUB_OUTPUT
- name: Run {Remove} Integration Tests
shell: powershell
env:
INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }}
INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }}
run: |
$CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword)
try
{
& .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.AAD.Remove.Tests.ps1 -Credential $Credential
}
catch
{
throw $_
}
try
{
$Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop
}
catch
{
throw $_
}
Write-Host ""
if ($Result.InDesiredState -eq $false)
{
Write-Host -Message "Resources below are not in the Desired State:"
foreach ($Resource in $Result.ResourcesNotInDesiredState)
{
Write-Host $Resource.InstanceName
}
throw "Could not validate that the Tenant is in the Desired State"
}
else
{
Write-Host "All resources in the Tenant are in the Desired State"
}

0 comments on commit f6f4f9d

Please sign in to comment.