-
Notifications
You must be signed in to change notification settings - Fork 141
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
ActiveDirectoryDsc: Proof of Concept - Running local integration tests #592
base: main
Are you sure you want to change the base?
Conversation
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.
Reviewable status: 0 of 14 files reviewed, 12 unresolved discussions (waiting on @johlju)
Tests/README.md, line 21 at r1 (raw file):
>**Note:** All these steps are expected to be run in the same elevated >PowerShell prompt. It also expect that you have downloaded the appropriate
It also expects
Tests/README.md, line 27 at r1 (raw file):
<!-- markdownlint-disable MD031 - Fenced code blocks should be surrounded by blank lines --> 1. Create a Hyper-VM (Generation 2). In an elevated PowerShell prompt run this.
this:
Tests/README.md, line 68 at r1 (raw file):
C:\Windows\System32\SysPrep\sysprep.exe /quiet /generalize /oobe /shutdown
- Create the folder where we store the exported image. This folder can
where we will store
Tests/README.md, line 135 at r1 (raw file):
Get-VM -Name $vmNames | Start-VM -Verbose
- On each started VM finish the installation by configure the following
configuring
Tests/README.md, line 146 at r1 (raw file):
### Test prerequisites The host for the virtual machines must have access to Internet. The
the Internet.
Tests/README.md, line 148 at r1 (raw file):
The host for the virtual machines must have access to Internet. The below steps assumes the virtual machines that should run the integration test are only connect to a private virtual switch and does not have access
only connected to a private virtual switch and do not have access
Tests/README.md, line 151 at r1 (raw file):
to the Internet. The blow steps *must* be run in a elevated PowerShell console.
below steps
Tests/README.md, line 154 at r1 (raw file):
<!-- markdownlint-disable MD031 - Fenced code blocks should be surrounded by blank lines --> 1. Change to folder to root of your local working repository
Change directory to the root
Tests/README.md, line 297 at r1 (raw file):
several times. The integration tests that depend on an already existing domain can be run several times without reverting to the checkpoint. The resources that need a clean environment are the resources that configures
configure
Tests/README.md, line 300 at r1 (raw file):
the domain, e.g. `ADDomain` and `ADDomainController`. 1. Change to folder to root of your local working repository
Change directory to the root
Tests/TestHelpers/Prepare-DscLab-dc01.ps1, line 41 at r1 (raw file):
} }
Format to align hash table properties.
Tests/TestHelpers/Prepare-DscLab-dc02.ps1, line 41 at r1 (raw file):
} }
Format to align hash table properties
Hi @johlju, just a few grammar/typo fixes in reviewable. Unfortunately, I don't have a Hyper-V host to test it with (my home lab is ESXi). The way I have been running the integration tests is by git cloning the whole repo onto my test domain controller, then running |
Yes it will, but maybe we shouldn't break your scenario 🤔 I will figure out a way so both ways works. I tried to use the build process to initiate the tests but that is not 100% when the node reboots since the try
{
# ...
$DscConfigurationStatus = Get-DscConfigurationStatus
if ($DscConfigurationStatus.RebootRequested)
{
return
}
# ...
}
finally
{
if ($DscConfigurationStatus.RebootRequested)
{
Write-Warning 'A Reboot has been requested by the DSC. Please reboot then re-run the test'
}
else
{
Restore-TestEnvironment -TestEnvironment $script:testEnvironment
}
} |
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.
Reviewable status: 0 of 14 files reviewed, 12 unresolved discussions (waiting on @X-Guardian)
Tests/README.md, line 21 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
It also expects
Done.
Tests/README.md, line 27 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
this:
Done.
Tests/README.md, line 68 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
where we will store
Done.
Tests/README.md, line 135 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
configuring
Done.
Tests/README.md, line 146 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
the Internet.
Done.
Tests/README.md, line 148 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
only connected to a private virtual switch and do not have access
Done.
Tests/README.md, line 151 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
below steps
Done.
Tests/README.md, line 154 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
Change directory to the root
Done.
Tests/README.md, line 297 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
configure
Done.
Tests/README.md, line 300 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
Change directory to the root
Done.
Tests/TestHelpers/Prepare-DscLab-dc01.ps1, line 41 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
Format to align hash table properties.
Done.
Tests/TestHelpers/Prepare-DscLab-dc02.ps1, line 41 at r1 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
Format to align hash table properties
Done.
I added a section for VMware as you described it. I have VMware ESXi as well but it is not as easy as running remote scripts like Hyper-V is, but did see that PowerCLI has the In this Hyper-V scenario I want to look into:
|
I RDP onto the VM, and it is a very manual process. Agreed you should initially focus on Hyper-V and getting to an automated process. |
I will get back to this PR eventually. But need to give SqlServerDsc much needed love first. |
Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again. |
Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again. |
1714147
to
0a5ad32
Compare
Codecov Report
@@ Coverage Diff @@
## main #592 +/- ##
===================================
Coverage 98% 98%
===================================
Files 25 25
Lines 3471 3471
===================================
Hits 3402 3402
Misses 69 69 |
Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again. |
0a5ad32
to
6fdcf94
Compare
Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again. |
Pull Request (PR) description
The goal I had was to be able to run the integration tests on a VM in Hyper-V using Pester and get the Pester output in the console on the host. I had this laying around for a long time now, and spent the weekend converting it to handle the new pipeline which helped with a few steps, and then I wanted to finish this to a point where it is was working.
This is a PoC of that which now runs three of the integration tests in a Hyper-V VM. Comments appreciated! 😄
There are many manual steps to get to a point where we can run tests. I like to see if we can use any automation tool to help with this, all of this or parts of this. Tools like AutomatedLab, LabBuilder, Lability, or Test Kitchen might help.
The reason I focused on using Hyper-V is the seemless integration with PowerShell Direct.
I like to extend this PoC to all the integrations tests we have and also setting up child domain. I looking to have 4 nodes in the lab depending on the memory usage needed by the host.
README.md: https://github.com/dsccommunity/ActiveDirectoryDsc/blob/2d86b1767f3b8240744e9c73904e04be51a7a514/Tests/README.md
Todo:
This Pull Request (PR) fixes the following issues
Task list
file CHANGELOG.md. Entry should say what was changed and how that
affects users (if applicable), and reference the issue being resolved
(if applicable).
and comment-based help.
This change is