Skip to content

Commit

Permalink
Merge pull request #4891 from NikCharlebois/Tests-Improvements
Browse files Browse the repository at this point in the history
Tests improvements for EXO
  • Loading branch information
NikCharlebois committed Jul 16, 2024
2 parents 2a960c2 + 1ad6d6d commit d450755
Show file tree
Hide file tree
Showing 174 changed files with 2,618 additions and 1,126 deletions.
127 changes: 0 additions & 127 deletions .github/workflows/Global - Integration - EXO.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,48 +46,6 @@ jobs:
git push
$SHA = git rev-parse HEAD
echo "commitid=$SHA" >> $env:GITHUB_OUTPUT
- name: Run {Create} 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.EXO.Create.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 {Update} Integration Tests from Examples
shell: powershell
run: |
Expand All @@ -104,48 +62,6 @@ jobs:
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.EXO.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: |
Expand All @@ -162,46 +78,3 @@ jobs:
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.EXO.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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,31 @@ It is not meant to use as a production baseline.
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$Credscredential
[Parameter()]
[System.String]
$ApplicationId,

[Parameter()]
[System.String]
$TenantId,

[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC

$Domain = $Credscredential.Username.Split('@')[1]
node localhost
{
EXOAcceptedDomain 'O365DSCDomain'
{
Identity = $Domain
Identity = $TenantId
DomainType = "Authoritative"
OutboundOnly = $false
Ensure = "Present"
Credential = $Credscredential
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,31 @@ It is not meant to use as a production baseline.
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$Credscredential
[Parameter()]
[System.String]
$ApplicationId,

[Parameter()]
[System.String]
$TenantId,

[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC

node localhost
{
EXOAcceptedDomain 'O365DSCDomain'
{
Identity = $Domain
Identity = $TenantId
DomainType = "Authoritative"
OutboundOnly = $true # Updated Property
Ensure = "Present"
Credential = $Credscredential
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,30 @@ It is not meant to use as a production baseline.
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$Credscredential
[Parameter()]
[System.String]
$ApplicationId,

[Parameter()]
[System.String]
$TenantId,

[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC

node localhost
{
EXOAcceptedDomain 'O365DSCDomain'
{
Identity = $Domain
Identity = $TenantId
DomainType = "Authoritative"
Ensure = "Absent"
Credential = $Credscredential
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ It is not meant to use as a production baseline.

Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$Credscredential
param(
[Parameter()]
[System.String]
$ApplicationId,

[Parameter()]
[System.String]
$TenantId,

[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC

Expand All @@ -22,7 +29,9 @@ Configuration Example
QueryString = "iOS 6.1 10B146"
AccessLevel = "Allow"
Ensure = "Present"
Credential = $Credscredential
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ It is not meant to use as a production baseline.

Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$Credscredential
param(
[Parameter()]
[System.String]
$ApplicationId,

[Parameter()]
[System.String]
$TenantId,

[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC

Expand All @@ -22,7 +29,9 @@ Configuration Example
QueryString = "iOS 6.1 10B145"
AccessLevel = "Allow"
Ensure = "Present"
Credential = $Credscredential
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ It is not meant to use as a production baseline.

Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$Credscredential
param(
[Parameter()]
[System.String]
$ApplicationId,

[Parameter()]
[System.String]
$TenantId,

[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC

Expand All @@ -22,7 +29,9 @@ Configuration Example
QueryString = "iOS 6.1 10B145"
AccessLevel = "Allow"
Ensure = "Present"
Credential = $Credscredential
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ It is not meant to use as a production baseline.

Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$Credscredential
param(
[Parameter()]
[System.String]
$ApplicationId,

[Parameter()]
[System.String]
$TenantId,

[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC

Expand All @@ -23,7 +30,9 @@ Configuration Example
OfflineAddressBook = "\Default Offline Address Book"
GlobalAddressList = "\Default Global Address List"
Ensure = "Present"
Credential = $Credscredential
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
}
}
Loading

0 comments on commit d450755

Please sign in to comment.