Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .vsts-ci/templates/nanoserver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
parameters:
vmImage: 'win1803'
jobName: 'Nanoserver_Tests'
continueOnError: false

jobs:

- job: ${{ parameters.jobName }}
variables:
scriptName: ${{ parameters.scriptName }}

pool:
vmImage: ${{ parameters.vmImage }}

displayName: ${{ parameters.jobName }}

steps:
- script: |
set
displayName: Capture environment
condition: succeededOrFailed()

- task: DownloadBuildArtifacts@0
displayName: 'Download build artifacts'
inputs:
downloadType: specific
itemPattern: |
build/**/*
downloadPath: '$(System.ArtifactsDirectory)'

- pwsh: |
Get-ChildItem "$(System.ArtifactsDirectory)\*" -Recurse
displayName: 'Capture artifacts directory'
continueOnError: true

- pwsh: |
Install-module pester -Scope CurrentUser -Force
displayName: 'Install Pester'
continueOnError: true

- pwsh: |
Import-Module .\tools\ci.psm1
Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json'
$options = (Get-PSOptions)
$path = split-path -path $options.Output
Write-Verbose "Path: '$path'" -Verbose
$rootPath = split-Path -path $path
Expand-Archive -Path '$(System.ArtifactsDirectory)\build\build.zip' -DestinationPath $rootPath -Force
Invoke-Pester -Path ./test/nanoserver -OutputFormat NUnitXml -OutputFile ./test-nanoserver.xml
displayName: Test
condition: succeeded()

- task: PublishTestResults@2
condition: succeededOrFailed()
displayName: Publish Nanoserver Test Results **\test*.xml
inputs:
testRunner: NUnit
testResultsFiles: '**\test*.xml'
testRunTitle: nanoserver
mergeTestResults: true
failTaskOnFailedTests: true
2 changes: 2 additions & 0 deletions .vsts-ci/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ stages:
parameters:
pool: 'Hosted VS2017'

- template: templates/nanoserver.yml

- stage: PackagingWin
displayName: Packaging for Windows
dependsOn: [] # by specifying an empty array, this stage doesn't depend on the stage before it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Diagnostics;
using System.Management.Automation;
using System.Reflection;
using System.Threading;

Expand All @@ -20,6 +21,13 @@ internal static class TaskbarJumpList
// not over-optimize this and always create the JumpList as a non-blocking background STA thread instead.
internal static void CreateRunAsAdministratorJumpList()
{
// The STA apartment state is not supported on NanoServer and Windows IoT.
// Plus, there is not need to create jump list in those environment anyways.
if (Platform.IsNanoServer || Platform.IsIoT)
{
return;
}

// Some COM APIs are implicitly STA only, therefore the executing thread must run in STA.
var thread = new Thread(() =>
{
Expand Down
15 changes: 15 additions & 0 deletions test/nanoserver/nanoserver.tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Describe "Verify PowerShell Runs" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

License header?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daxian-dbw or @iSazonov can you add this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted #10171

BeforeAll{
$options = (Get-PSOptions)
$path = split-path -path $options.Output
Write-Verbose "Path: '$path'" -Verbose
$rootPath = split-Path -path $path
$mount = 'C:\powershell'
$container = 'mcr.microsoft.com/powershell:nanoserver-1803'
}

it "Verify Version " {
$version = docker run --rm -v "${rootPath}:${mount}" ${container} "${mount}\publish\pwsh" -NoLogo -NoProfile -Command '$PSVersionTable.PSVersion.ToString()'
$version | Should -match '^7\.'
}
}