Skip to content

Commit

Permalink
Add docker test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
heaths committed Feb 23, 2017
1 parent 4f027bb commit 47b26d9
Show file tree
Hide file tree
Showing 10 changed files with 515 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (C) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license. See LICENSE.txt in the project root for license information.

# Require .NET Framework
FROM microsoft/windowsservercore

# Download and install Remote Debugger
SHELL ["powershell.exe", "-ExecutionPolicy", "Bypass", "-Command"]
RUN $ErrorActionPreference = 'Stop' ; \
$VerbosePreference = 'Continue' ; \
New-Item -Path C:\Downloads -Type Directory | Out-Null ; \
Invoke-WebRequest -Uri 'https://go.microsoft.com/fwlink/?LinkId=615470&clcid=0x409' -OutFile C:\Downloads\rtools_setup_x64.exe ; \
Start-Process -Wait -FilePath C:\Downloads\rtools_setup_x64.exe -ArgumentList '-q'

# Configure Remote Debugger
EXPOSE 3702 4020 4021
RUN $ErrorActionPreference = 'Stop' ; \
$VerbosePreference = 'Continue' ; \
Start-Process -Wait -FilePath 'C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe' -ArgumentList '/prepcomputer', '/private', '/quiet'

# Download and register current query APIs
ENV API_VERSION="1.7.13-rc"
RUN $ErrorActionPreference = 'Stop' ; \
$VerbosePreference = 'Continue' ; \
Invoke-WebRequest -Uri "https://www.nuget.org/api/v2/package/Microsoft.VisualStudio.Setup.Configuration.Native/${env:API_VERSION}" -OutFile C:\Downloads\Microsoft.VisualStudio.Setup.Configuration.Native.zip ; \
Expand-Archive -Path C:\Downloads\Microsoft.VisualStudio.Setup.Configuration.Native.zip -DestinationPath C:\Downloads\Microsoft.VisualStudio.Setup.Configuration.Native ; \
C:\Windows\System32\regsvr32.exe /s C:\Downloads\Microsoft.VisualStudio.Setup.Configuration.Native\tools\x64\Microsoft.VisualStudio.Setup.Configuration.Native.dll ; \
C:\Windows\SysWOW64\regsvr32.exe /s C:\Downloads\Microsoft.VisualStudio.Setup.Configuration.Native\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Native.dll

# Install latest version of Pester for integration testing
RUN $ErrorActionPreference = 'Stop' ; \
$VerbosePreference = 'Continue' ; \
Install-PackageProvider -Name nuget -MinimumVersion 2.8.5.201 -Force ; \
Install-Module -Name Pester -Scope CurrentUser -SkipPublisherCheck -Force

# Start Remote Debugger if no other command is passed to PowerShell
ENTRYPOINT ["powershell.exe", "-ExecutionPolicy", "Unrestricted"]
CMD ["-NoExit", "-Command", "& 'C:\\Program Files\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Remote Debugger\\x64\\msvsmon.exe' /silent /noauth /anyuser"]
61 changes: 61 additions & 0 deletions docker/Instances/1/state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"channelId": "VisualStudio.15.Release/public.d15rel/15.0.26116.0",
"installationName": "VisualStudio/public.d15rel/15.0.26116.0",
"installationVersion": "15.0.26116",
"installationPath": "C:\\VS\\Community",
"installDate": "2017-01-17T03:00:00Z",
"product": {
"id": "Microsoft.VisualStudio.Product.Community",
"version": "15.0.26116.0",
"type": "Product"
},
"localizedResources": [
{
"language": "en-us",
"title": "Visual Studio Community 2017",
"description": "Free, fully-featured IDE for students, open-source and individual developers"
},
{
"language": "de-de",
"title": "Visual Studio Community 2017",
"description": "Kostenlose, voll funktionsfähige IDE für Studenten, Open Source- und einzelne Entwickler."
}
],
"launchParams": {
"fileName": "Common7\\IDE\\devenv.exe"
},
"enginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
"properties": {
"nickname": "Community"
},
"selectedPackages": [
{
"id": "Microsoft.VisualStudio.Product.Community",
"version": "15.0.26116.0",
"type": "Product",
"selectedState": "IndividuallySelected"
}
],
"packages": [
{
"id": "Microsoft.VisualStudio.Workload.ManagedDesktop",
"version": "15.0.26116.0",
"type": "Workload"
},
{
"id": "Microsoft.VisualStudio.Workload.CoreEditor",
"version": "15.0.26116.0",
"type": "Workload"
},
{
"id": "Microsoft.VisualStudio.Branding.Community",
"version": "15.0.26116.0",
"type": "Vsix"
},
{
"id": "Microsoft.VisualStudio.Product.Community",
"version": "15.0.26116.0",
"type": "Product"
}
]
}
85 changes: 85 additions & 0 deletions docker/Instances/2/state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"channelId": "VisualStudio.15.Release/public.d15rel/15.0.26117.0",
"installationName": "VisualStudio/public.d15rel/15.0.26117.0",
"installationVersion": "15.0.26117",
"installationPath": "C:\\VS\\Enterprise",
"installDate": "2017-01-18T03:15:00Z",
"product": {
"id": "Microsoft.VisualStudio.Product.Enterprise",
"version": "15.0.26117.0",
"type": "Product"
},
"localizedResources": [
{
"language": "en-us",
"title": "Visual Studio Enterprise 2017",
"description": "Microsoft DevOps solution for productivity and coordination across teams of any size"
},
{
"language": "de-de",
"title": "Visual Studio Enterprise 2017",
"description": "Microsoft DevOps-Lösung für Produktivität und Koordination von Teams beliebiger Größe"
}
],
"launchParams": {
"fileName": "Common7\\IDE\\devenv.exe"
},
"enginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
"properties": {
"nickname": "Enterprise"
},
"selectedPackages": [
{
"id": "Microsoft.VisualStudio.Product.Enterprise",
"version": "15.0.26117.0",
"type": "Product",
"selectedState": "IndividuallySelected"
}
],
"packages": [
{
"id": "Microsoft.VisualStudio.Workload.ManagedDesktop",
"version": "15.0.26117.0",
"type": "Workload"
},
{
"id": "Microsoft.VisualStudio.Workload.NativeDesktop",
"version": "15.0.26117.0",
"type": "Workload"
},
{
"id": "Microsoft.VisualStudio.Workload.CoreEditor",
"version": "15.0.26117.0",
"type": "Workload"
},
{
"id": "Microsoft.VisualStudio.Branding.Enterprise",
"version": "15.0.26117.0",
"type": "Vsix"
},
{
"id": "Microsoft.VisualStudio.Product.Enterprise",
"version": "15.0.26117.0",
"type": "Product"
}
],
"errors": {
"errorLogFilePath": "C:\\TEMP\\dd_setup_201601180315_errors.log",
"failedPackages": [
{
"id": "Microsoft.VisualStudio.Workload.Office",
"version": "15.0.26009.0",
"type": "Workload",
"logFilePath": "C:\\TEMP\\dd_setup_201601180315_003_Microsoft.VisualStudio.Workload.Office_errors.log",
"description": "Failed to install Microsoft.VisualStudio.Workload.Office"
}
],
"skippedPackages": [
{
"id": "Microsoft.VisualStudio.Component.Sharepoint.Tools",
"version": "15.0.260009.0",
"type": "Component"
}
]
}
}
Empty file added docker/Instances/3/reboot.sem
Empty file.
61 changes: 61 additions & 0 deletions docker/Instances/3/state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"channelId": "VisualStudio.15.Release/public.d15rel/15.0.26117.0",
"installationName": "VisualStudio/public.d15rel/15.0.26117.0",
"installationVersion": "15.0.26117",
"installationPath": "C:\\VS\\Professional",
"installDate": "2017-01-18T03:30:00Z",
"product": {
"id": "Microsoft.VisualStudio.Product.Professional",
"version": "15.0.26117.0",
"type": "Product"
},
"localizedResources": [
{
"language": "en-us",
"title": "Visual Studio Professional 2017",
"description": "Professional developer tools and services for small teams"
},
{
"language": "de-de",
"title": "Visual Studio Professional 2017",
"description": "Professionelle Entwicklertools und -dienste für kleine Teams"
}
],
"launchParams": {
"fileName": "Common7\\IDE\\devenv.exe"
},
"enginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
"properties": {
"nickname": "Professional"
},
"selectedPackages": [
{
"id": "Microsoft.VisualStudio.Product.Professional",
"version": "15.0.26117.0",
"type": "Product",
"selectedState": "IndividuallySelected"
}
],
"packages": [
{
"id": "Microsoft.VisualStudio.Workload.ManagedDesktop",
"version": "15.0.26117.0",
"type": "Workload"
},
{
"id": "Microsoft.VisualStudio.Workload.CoreEditor",
"version": "15.0.26117.0",
"type": "Workload"
},
{
"id": "Microsoft.VisualStudio.Branding.Professional",
"version": "15.0.26117.0",
"type": "Vsix"
},
{
"id": "Microsoft.VisualStudio.Product.Professional",
"version": "15.0.26117.0",
"type": "Product"
}
]
}
45 changes: 45 additions & 0 deletions docker/Instances/4/state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"channelId": "VisualStudio.15.Release/public.d15rel/15.0.26117.0",
"installationName": "VisualStudio/public.d15rel/15.0.26117.0",
"installationVersion": "15.0.26117",
"installationPath": "C:\\BuildTools",
"installDate": "2017-01-18T03:45:00Z",
"product": {
"id": "Microsoft.VisualStudio.Product.BuildTools",
"version": "15.0.26117.0",
"type": "Product"
},
"localizedResources": [
{
"language": "en-us",
"title": "Visual Studio Build Tools 2017",
"description": "The Visual Studio Build Tools allows you to build native and managed MSBuild-based applications without requiring the Visual Studio IDE. There are options to install the Visual C++ compilers and libraries, MFC, ATL, and C++/CLI support."
},
{
"language": "de-de",
"title": "Visual Studio-Buildtools 2017",
"description": "Die Visual Studio-Buildtools ermöglichen Ihnen die Erstellung nativer und verwalteter MSBuild-basierter Anwendungen, ohne dass die Visual Studio-IDE erforderlich ist. Es stehen Optionen zur Installation von Visual C++-Compilern und -Bibliotheken, MFC, ATL sowie C++/CLI-Unterstützung zur Verfügung."
}
],
"enginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
"selectedPackages": [
{
"id": "Microsoft.VisualStudio.Product.BuildTools",
"version": "15.0.26117.0",
"type": "Product",
"selectedState": "IndividuallySelected"
}
],
"packages": [
{
"id": "Microsoft.VisualStudio.Workload.MSBuildTools",
"version": "15.0.26117.0",
"type": "Workload"
},
{
"id": "Microsoft.VisualStudio.Product.BuildTools",
"version": "15.0.26117.0",
"type": "Product"
}
]
}
58 changes: 58 additions & 0 deletions docker/Tests/vswhere.tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright (C) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license. See LICENSE.txt in the project root for license information.

Describe 'vswhere' {
Context 'format: text (default)' {
It 'returns 2 instances' {
$instanceIds = C:\bin\vswhere.exe | Select-String 'instanceId: \w+'
$instanceIds.Count | Should Be 2
}

It '-all returns 3 instances' {
$instanceIds = C:\bin\vswhere.exe -all | Select-String 'instanceId: \w+'
$instanceIds.Count | Should Be 3
}

It '-products returns 1 instance' {
$instanceIds = C:\bin\vswhere.exe -products microsoft.visualstudio.product.buildtools | Select-String 'instanceId: \w+'
$instanceIds.Count | Should Be 1
}

It '-requires returns 1 instance' {
$instanceIds = C:\bin\vswhere.exe -requires microsoft.visualstudio.workload.nativedesktop | Select-String 'instanceId: \w+'
$instanceIds.Count | Should Be 1
}

It '-version returns 1 instance' {
$instanceIds = C:\bin\vswhere.exe -version '(15.0.26116,]' | Select-String 'instanceId: \w+'
$instanceIds.Count | Should Be 1
}
}

Context 'format: json' {
It 'returns 2 instances' {
$instances = C:\bin\vswhere.exe -format json | ConvertFrom-Json
$instances.Count | Should Be 2
}

It '-all returns 3 instances' {
$instances = C:\bin\vswhere.exe -all -format json | ConvertFrom-Json
$instances.Count | Should Be 3
}

It '-products returns 1 instance' {
$instance = C:\bin\vswhere.exe -products microsoft.visualstudio.product.buildtools -format json | ConvertFrom-Json
$instance.Count | Should Be 1
}

It '-requires returns 1 instance' {
$instances = C:\bin\vswhere.exe -requires microsoft.visualstudio.workload.nativedesktop -format json | ConvertFrom-Json
$instances.Count | Should Be 1
}

It '-version returns 1 instance' {
$instances = C:\bin\vswhere.exe -version '(15.0.26116,]' -format json | ConvertFrom-Json
$instances.Count | Should Be 1
}
}
}
Loading

0 comments on commit 47b26d9

Please sign in to comment.