Skip to content

Commit

Permalink
Changes to xFailOverCluster
Browse files Browse the repository at this point in the history
- Added CodeCov and opt-in for all common tests (issue dsccommunity#41).
- Fixed typo in README.md.
  • Loading branch information
johlju committed Jun 17, 2017
1 parent 71849b1 commit bb2e9df
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 51 deletions.
24 changes: 24 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
codecov:
notify:
require_ci_to_pass: no

comment:
layout: "reach, diff"
behavior: default

coverage:
range: 50..80
round: down
precision: 0

status:
project:
default:
# Set the overall project code coverage requirement to 70%
target: 70
patch:
default:
# Set the pull request requirement to not regress overall coverage by more than 5%
# and let codecov.io set the goal for the code changed in the patch.
target: auto
threshold: 5
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DSCResource.Tests
.vs
.vscode
node_modules
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
- Removed 'Unreleased' "tag" from the resources xClusterQuorum and xClusterDisk (issue #36)
- Added new sections to each resource (Requirements, Parameters and Examples) in the README.md. Some does not yet have any examples, so they are set to 'None.'.
- Added GitHub templates PULL\_REQUEST\_TEMPLATE, ISSUE_TEMPLATE and CONTRIBUTING.md (issue #45).
- Split the change log from README.md to a seperate file CHANGELOG.md (issue #48).
- Split the change log from README.md to a separate file CHANGELOG.md (issue #48).
- Added the resource xClusterPreferredOwner to README.md (issue #51).
- Added the resource xClusterNetwork to README.md (issue #56).
- Removed Credential parameter from parameter list for xWaitForCluster. Parameter Credential does not exist in the schema.mof of the resource (issue #62).
- Now all parameters in the README.md list their data type and type qualifier (issue #58.)
- Added Import-DscResource to example in README.md.
- Added CodeCov and opt-in for all common tests (issue #41).

### 1.6.0.0

Expand Down
74 changes: 24 additions & 50 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,37 @@
#---------------------------------#
# environment configuration #
#---------------------------------#
#---------------------------------#
# environment configuration #
#---------------------------------#
version: 1.6.{build}.0
install:
install:
- git clone https://github.com/PowerShell/DscResource.Tests

- ps: |
Import-Module -Name .\DscResource.Tests\TestHelper.psm1 -Force
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module -Name Pester -Repository PSGallery -Force
Import-Module -Name "$env:APPVEYOR_BUILD_FOLDER\DscResource.Tests\AppVeyor.psm1"
Invoke-AppveyorInstallTask
#---------------------------------#
# build configuration #
#---------------------------------#
#---------------------------------#
# build configuration #
#---------------------------------#

build: false

#---------------------------------#
# test configuration #
#---------------------------------#
#---------------------------------#
# test configuration #
#---------------------------------#

test_script:
- ps: |
$testResultsFile = ".\TestsResults.xml"
$res = Invoke-Pester -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile))
if ($res.FailedCount -gt 0) {
throw "$($res.FailedCount) tests failed."
}
#---------------------------------#
# deployment configuration #
#---------------------------------#

# scripts to run before deployment
deploy_script:
Invoke-AppveyorTestScriptTask -CodeCoverage -CodeCovIo -ExcludeTag @()
#---------------------------------#
# deployment configuration #
#---------------------------------#

# scripts to run before deployment
deploy_script:
- ps: |
# Creating project artifact
$stagingDirectory = (Resolve-Path ..).Path
$manifest = Join-Path $pwd "xFailOverCluster.psd1"
(Get-Content $manifest -Raw).Replace("1.6.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest
$zipFilePath = Join-Path $stagingDirectory "$(Split-Path $pwd -Leaf).zip"
Add-Type -assemblyname System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::CreateFromDirectory($pwd, $zipFilePath)
# Creating NuGet package artifact
New-Nuspec -packageName $env:APPVEYOR_PROJECT_NAME -version $env:APPVEYOR_BUILD_VERSION -author "Microsoft" -owners "Microsoft" -licenseUrl "https://github.com/PowerShell/DscResources/blob/master/LICENSE" -projectUrl "https://github.com/$($env:APPVEYOR_REPO_NAME)" -packageDescription $env:APPVEYOR_PROJECT_NAME -tags "DesiredStateConfiguration DSC DSCResourceKit" -destinationPath .
nuget pack ".\$($env:APPVEYOR_PROJECT_NAME).nuspec" -outputdirectory .
$nuGetPackageName = $env:APPVEYOR_PROJECT_NAME + "." + $env:APPVEYOR_BUILD_VERSION + ".nupkg"
$nuGetPackagePath = (Get-ChildItem $nuGetPackageName).FullName
@(
# You can add other artifacts here
$zipFilePath,
$nuGetPackagePath
) | % {
Write-Host "Pushing package $_ as Appveyor artifact"
Push-AppveyorArtifact $_
}
Invoke-AppveyorAfterTestTask

0 comments on commit bb2e9df

Please sign in to comment.