dsccommunity / HyperVDsc

This module contains DSC resources for deployment and configuration of Microsoft Hyper-V.
MIT License
114 stars 65 forks source link

VMNetworkAdapter: Device Naming and MAC Address Spoofing #208

Open nyanhp opened 1 year ago

nyanhp commented 1 year ago

Pull Request (PR) description

This PR implements the additional parameters DeviceNaming and MacAddressSpoofing to expose more virtual NIC settings.

This Pull Request (PR) fixes the following issues

Task list


This change is Reviewable

nyanhp commented 1 year ago

Build fails due to https://github.com/dsccommunity/DscResource.DocGenerator/issues/131

nyanhp commented 1 year ago

To whoever owns this module, the build will not work on an Ubuntu worker due to this line: https://github.com/dsccommunity/HyperVDsc/blob/6c0e58362fe9a670d010c2bbeb1983486867e4ec/tests/Unit/Stubs/Hyper-V.stubs.psm1#L4

The error that occurs with every test is similar to this one:

Executing script /home/jhp/HyperVDsc/tests/Unit/HyperVDsc.Common.Tests.ps1
  [-] Error occurred in test script '/home/jhp/HyperVDsc/tests/Unit/HyperVDsc.Common.Tests.ps1' 0ms
    DriveNotFoundException: Cannot find drive. A drive with the name 'C' does not exist.
    at <ScriptBlock>, /home/jhp/HyperVDsc/tests/Unit/Stubs/Hyper-V.stubs.psm1: line 4
    at <ScriptBlock>, /home/jhp/HyperVDsc/tests/Unit/HyperVDsc.Common.Tests.ps1: line 27
    at <ScriptBlock>, /home/jhp/HyperVDsc/output/RequiredModules/Pester/4.10.1/Pester.psm1: line 1111
    at Invoke-Pester<End>, /home/jhp/HyperVDsc/output/RequiredModules/Pester/4.10.1/Pester.psm1: line 1137
    at <ScriptBlock>, /home/jhp/HyperVDsc/output/RequiredModules/Sampler/0.116.1/tasks/Invoke-Pester.pester.build.ps1: line 351
    at *Task, /home/jhp/HyperVDsc/output/RequiredModules/InvokeBuild/5.10.1/Invoke-Build.ps1: line 590
    at *Task, /home/jhp/HyperVDsc/output/RequiredModules/InvokeBuild/5.10.1/Invoke-Build.ps1: line 562
    at *Task, /home/jhp/HyperVDsc/output/RequiredModules/InvokeBuild/5.10.1/Invoke-Build.ps1: line 562
    at *Task, /home/jhp/HyperVDsc/output/RequiredModules/InvokeBuild/5.10.1/Invoke-Build.ps1: line 562
    at <ScriptBlock><End>, /home/jhp/HyperVDsc/output/RequiredModules/InvokeBuild/5.10.1/Invoke-Build.ps1: line 748
    at <ScriptBlock><Begin>, /home/jhp/HyperVDsc/build.ps1: line 506

Can we use a Windows build worker for this repository?

nyanhp commented 1 year ago

All tests were successful, code coverage could not be uploaded.

codecov[bot] commented 1 year ago

Codecov Report

Merging #208 (517cf60) into main (6c0e583) will increase coverage by 2%. The diff coverage is 100%.

Impacted file tree graph

@@         Coverage Diff         @@
##           main   #208   +/-   ##
===================================
+ Coverage    83%    85%   +2%     
===================================
  Files        11     11           
  Lines      1441   1455   +14     
===================================
+ Hits       1203   1245   +42     
+ Misses      238    210   -28     
Impacted Files Coverage Δ
source/DSCResources/DSC_VMHyperV/DSC_VMHyperV.psm1 85% <100%> (ø)
...ces/DSC_VMNetworkAdapter/DSC_VMNetworkAdapter.psm1 61% <100%> (+14%) :arrow_up:
nyanhp commented 1 year ago

Apologies in advance for multiple pushes to update my tests, but the local builds fail 8 out of 10 times.