Skip to content

Commit

Permalink
Merge pull request #95 from PowerShell/dev
Browse files Browse the repository at this point in the history
Release of version 3.1.0.0 of xStorage
  • Loading branch information
kwirkykat authored Jun 1, 2017
2 parents e05fbd2 + 9f7a2cf commit 393cdf2
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 52 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

## 3.1.0.0

- Added integration test to test for conflicts with other common resource kit modules.
- Prevented ResourceHelper and Common module cmdlets from being exported to resolve
conflicts with other resource modules.

## 3.0.0.0

- Converted AppVeyor build process to use AppVeyor.psm1.
Expand Down
13 changes: 10 additions & 3 deletions Modules/xStorage/DSCResources/MSFT_xDisk/MSFT_xDisk.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')]
param ()

$script:ResourceRootPath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent)
$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules'

# Import the xNetworking Resource Module (to import the common modules)
Import-Module -Name (Join-Path -Path $script:ResourceRootPath -ChildPath 'xStorage.psd1')
# Import the Storage Common Modules
Import-Module -Name (Join-Path -Path $modulePath `
-ChildPath (Join-Path -Path 'StorageDsc.Common' `
-ChildPath 'StorageDsc.Common.psm1'))

# Import the Storage Resource Helper Module
Import-Module -Name (Join-Path -Path $modulePath `
-ChildPath (Join-Path -Path 'StorageDsc.ResourceHelper' `
-ChildPath 'StorageDsc.ResourceHelper.psm1'))

# Import Localization Strings
$localizedData = Get-LocalizedData `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')]
param ()

$script:ResourceRootPath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent)
$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules'

# Import the xNetworking Resource Module (to import the common modules)
Import-Module -Name (Join-Path -Path $script:ResourceRootPath -ChildPath 'xStorage.psd1')
# Import the Storage Common Modules
Import-Module -Name (Join-Path -Path $modulePath `
-ChildPath (Join-Path -Path 'StorageDsc.Common' `
-ChildPath 'StorageDsc.Common.psm1'))

# Import the Storage Resource Helper Module
Import-Module -Name (Join-Path -Path $modulePath `
-ChildPath (Join-Path -Path 'StorageDsc.ResourceHelper' `
-ChildPath 'StorageDsc.ResourceHelper.psm1'))

# Import Localization Strings
$localizedData = Get-LocalizedData `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')]
param ()

$script:ResourceRootPath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent)
$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules'

# Import the xNetworking Resource Module (to import the common modules)
Import-Module -Name (Join-Path -Path $script:ResourceRootPath -ChildPath 'xStorage.psd1')
$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules'

# Import the Storage Common Modules
Import-Module -Name (Join-Path -Path $modulePath `
-ChildPath (Join-Path -Path 'StorageDsc.Common' `
-ChildPath 'StorageDsc.Common.psm1'))

# Import the Storage Resource Helper Module
Import-Module -Name (Join-Path -Path $modulePath `
-ChildPath (Join-Path -Path 'StorageDsc.ResourceHelper' `
-ChildPath 'StorageDsc.ResourceHelper.psm1'))

# Import Localization Strings
$localizedData = Get-LocalizedData `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')]
param ()

$script:ResourceRootPath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent)
$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules'

# Import the xNetworking Resource Module (to import the common modules)
Import-Module -Name (Join-Path -Path $script:ResourceRootPath -ChildPath 'xStorage.psd1')
# Import the Storage Common Modules
Import-Module -Name (Join-Path -Path $modulePath `
-ChildPath (Join-Path -Path 'StorageDsc.Common' `
-ChildPath 'StorageDsc.Common.psm1'))

# Import the Storage Resource Helper Module
Import-Module -Name (Join-Path -Path $modulePath `
-ChildPath (Join-Path -Path 'StorageDsc.ResourceHelper' `
-ChildPath 'StorageDsc.ResourceHelper.psm1'))

# Import Localization Strings
$localizedData = Get-LocalizedData `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')]
param ()

$script:ResourceRootPath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent)
$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules'

# Import the xNetworking Resource Module (to import the common modules)
Import-Module -Name (Join-Path -Path $script:ResourceRootPath -ChildPath 'xStorage.psd1')
# Import the Storage Common Modules
Import-Module -Name (Join-Path -Path $modulePath `
-ChildPath (Join-Path -Path 'StorageDsc.Common' `
-ChildPath 'StorageDsc.Common.psm1'))

# Import the Storage Resource Helper Module
Import-Module -Name (Join-Path -Path $modulePath `
-ChildPath (Join-Path -Path 'StorageDsc.ResourceHelper' `
-ChildPath 'StorageDsc.ResourceHelper.psm1'))

# Import Localization Strings
$localizedData = Get-LocalizedData `
Expand Down
43 changes: 6 additions & 37 deletions Modules/xStorage/xStorage.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# RootModule = ''

# Version number of this module.
ModuleVersion = '3.0.0.0'
ModuleVersion = '3.1.0.0'

# ID used to uniquely identify this module
GUID = '00d73ca1-58b5-46b7-ac1a-5bfcf5814faf'
Expand Down Expand Up @@ -61,7 +61,7 @@ PowerShellVersion = '4.0'
# FormatsToProcess = @()

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
NestedModules = @('Modules\StorageDsc.Common\StorageDsc.Common.psm1','Modules\StorageDsc.ResourceHelper\StorageDsc.ResourceHelper.psm1')
# NestedModules = @()

# Functions to export from this module
FunctionsToExport = '*'
Expand Down Expand Up @@ -102,41 +102,9 @@ PrivateData = @{
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '- Converted AppVeyor build process to use AppVeyor.psm1.
- Added support for auto generating wiki, help files, markdown linting
and checking examples.
- Correct name of MSFT_xDiskAccessPath.tests.ps1.
- Move shared modules into Modules folder.
- Fixed unit tests.
- Removed support for WMI cmdlets.
- Opted in to Markdown and Example tests.
- Added CodeCov.io support.
- Removed requirement on using Pester 3.4.6 because Pester bug fixed in 4.0.3.
- Fixed unit tests for MSFT_xDiskAccessPath resource to be compatible with
Pester 4.0.3.
- xDisk:
- BREAKING CHANGE: Renamed parameter DiskNumber to DiskId to enable it to
contain either DiskNumber or UniqueId - See [Issue 81](https://github.com/PowerShell/xStorage/issues/81).
- Added DiskIdType parameter to enable specifying the type of identifer
the DiskId parameter contains - See [Issue 81](https://github.com/PowerShell/xStorage/issues/81).
- Changed to use xDiskAccessPath pattern to fix issue with Windows Server
2016 - See [Issue 80](https://github.com/PowerShell/xStorage/issues/80).
- Fixed style violations in xDisk.
- Fixed issue when creating multiple partitions on a single disk with no size
specified - See [Issue 86](https://github.com/PowerShell/xStorage/issues/86).
- xDiskAccessPath:
- BREAKING CHANGE: Renamed parameter DiskNumber to DiskId to
enable it to contain either DiskNumber or UniqueId - See [Issue 81](https://github.com/PowerShell/xStorage/issues/81).
- Added DiskIdType parameter to enable specifying the type
of identifer the DiskId parameter contains - See [Issue 81](https://github.com/PowerShell/xStorage/issues/81).
- Fixed incorrect logging messages when changing volume label.
- Fixed issue when creating multiple partitions on a single disk with no size
specified - See [Issue 86](https://github.com/PowerShell/xStorage/issues/86).
- xWaitForDisk:
- BREAKING CHANGE: Renamed parameter DiskNumber to DiskId to
enable it to contain either DiskNumber or UniqueId - See [Issue 81](https://github.com/PowerShell/xStorage/issues/81).
- Added DiskIdType parameter to enable specifying the type
of identifer the DiskId parameter contains - See [Issue 81](https://github.com/PowerShell/xStorage/issues/81).
ReleaseNotes = '- Added integration test to test for conflicts with other common resource kit modules.
- Prevented ResourceHelper and Common module cmdlets from being exported to resolve
conflicts with other resource modules.
'

Expand All @@ -156,3 +124,4 @@ PrivateData = @{




47 changes: 47 additions & 0 deletions Tests/Integration/ModuleConflict.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
$script:DSCModuleName = 'xStorage'
<#
These integration tests ensure that exported cmdlets names do not conflict
with any other names that are exposed by other common resource kit modules.
#>
$script:ModulesToTest = @( 'xNetworking','xComputerManagement','xDFS' )

#region HEADER
# Integration Test Template Version: 1.1.0
[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\xStorage'

if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or `
(-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) )
{
& git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\'))
}

Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force
Import-Module (Join-Path -Path $script:moduleRoot -ChildPath "$($script:DSCModuleName).psd1") -Force
$TestEnvironment = Initialize-TestEnvironment `
-DSCModuleName $script:DSCModuleName `
-DSCResourceName 'All' `
-TestType Integration

#endregion

# Using try/finally to always cleanup even if something awful happens.
try
{
Describe "$($script:DSCModuleName)_CommonModuleConflict" {

foreach ($moduleToTest in $script:ModulesToTest)
{
It "Should be able to install DSC Resource module '$moduleToTest'" {
{
Install-Module -Name $moduleToTest -ErrorAction Stop
} | Should Not Throw
}
}
}
}
finally
{
#region FOOTER
Restore-TestEnvironment -TestEnvironment $TestEnvironment
#endregion
}

0 comments on commit 393cdf2

Please sign in to comment.