-
Notifications
You must be signed in to change notification settings - Fork 90
Feature/windows smoke tests #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hpryce
wants to merge
22
commits into
master
Choose a base branch
from
feature/windows_smoke_tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
195d9af
Locate docker and docker-compose using the path variable.
ab078a6
Merge branch 'feature/use-path-to-find-executables' of https://github…
hpryce a12076d
Reintroduce support for explicitly setting docker-compose location.
hpryce 35ab870
Docker for Mac is not in the path when tests run from IDE.
hpryce 252a88e
Split out finding possible command locations from testing those locat…
hpryce 0a61921
Add jsr dep
hpryce d39fb31
Refactor to simply logic and improve test coverage by using Environme…
hpryce 19791dd
Add case for Windows path variable "Path"
hpryce a734f16
Process builder will look for command on the path
hpryce 215f427
Move integ tests into separate source set.
hpryce a8ce98b
Add very simple windows smoke test.
hpryce cc06e21
Wire up smoke test for Windows to appveyor.
hpryce 186aba0
Thread.sleep isn't accurate on Windows
hpryce ed0d9cf
Simply don't run the tes that relies upon Thread.sleep on Windows
hpryce 17a0b3b
Merge branch 'feature/look_in_path' into feature/windows_smoke_tests
hpryce bc6bdd9
Do we have the latest image?
hpryce 1df8a38
Use Windows Server 2016 image
hpryce e903dac
Install docker-compose before running tests that need it
hpryce 8c41711
Use image with more up to date docker
hpryce 479efca
Correct appveyor.yml syntax
hpryce 9492fb4
Try cinst
hpryce eafa3b0
Try installing both docker and docker-compose on old image
hpryce File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...junit4/src/integTest/java/com/palantir/docker/compose/windows/WindowsIntegrationTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2016 Palantir Technologies, Inc. All rights reserved. | ||
*/ | ||
|
||
package com.palantir.docker.compose.windows; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.core.Is.is; | ||
import static org.junit.Assume.assumeTrue; | ||
|
||
import com.palantir.docker.compose.DockerComposeRule; | ||
import com.palantir.docker.compose.configuration.DockerComposeFiles; | ||
import com.palantir.docker.compose.connection.State; | ||
import java.io.IOException; | ||
import org.apache.commons.lang3.SystemUtils; | ||
import org.junit.Test; | ||
|
||
public class WindowsIntegrationTest { | ||
|
||
@Test | ||
public void can_execute_docker_commands() throws IOException, InterruptedException { | ||
assumeTrue("Running on Windows", SystemUtils.IS_OS_WINDOWS); | ||
|
||
DockerComposeRule docker = DockerComposeRule.builder() | ||
.files(DockerComposeFiles.from("src/integTest/resources/windows-docker-compose.yaml")) | ||
.build(); | ||
docker.before(); | ||
|
||
try { | ||
assertThat(docker.containers().container("hello-world").state(), is(State.DOWN)); | ||
} finally { | ||
docker.after(); | ||
} | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
docker-compose-rule-junit4/src/integTest/resources/windows-docker-compose.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
hello-world: | ||
image: microsoft/windowsservercore | ||
command: echo "Server started" | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// From https://raw.githubusercontent.com/spring-io/sagan/master/gradle/integTest.gradle | ||
import org.gradle.api.tasks.testing.Test | ||
|
||
/** | ||
* This script adds a dedicated integration testing source set (src/integTest) and task | ||
* (integTest) when applied to any Java project. | ||
* | ||
* Configuration: | ||
* apply from: path/to/integTest.gradle | ||
* | ||
* Usage: | ||
* gradle integTest | ||
* - or - | ||
* gradle check | ||
*/ | ||
|
||
sourceSets { | ||
integTest { | ||
java.srcDir 'src/integTest/java' | ||
resources.srcDir 'src/integTest/resources' | ||
} | ||
} | ||
|
||
task integTest(type: Test) { | ||
description = "Runs integration tests." | ||
|
||
testClassesDir = sourceSets.integTest.output.classesDir | ||
classpath = sourceSets.integTest.runtimeClasspath | ||
|
||
maxHeapSize = '1024m' | ||
|
||
// ensure we don't overwrite default report directories used by 'test' task | ||
reports.html.destination = "${project.buildDir}/reports/integTest" | ||
reports.junitXml.destination = "${project.buildDir}/integTest-results" | ||
binResultsDir = file("${project.buildDir}/integTest-results/binary/integTest") | ||
|
||
// always run integration tests after unit tests in order to fail fast | ||
mustRunAfter test | ||
} | ||
|
||
dependencies { | ||
integTestCompile sourceSets.main.output | ||
integTestCompile sourceSets.test.output | ||
integTestCompile configurations.compile | ||
integTestCompile configurations.testCompile | ||
integTestRuntime configurations.runtime | ||
integTestRuntime configurations.testRuntime | ||
} | ||
|
||
// Ensure unit test tasks (named 'test') always run before integration tests in | ||
// order to fail as fast as possible | ||
gradle.projectsEvaluated { | ||
def unitTestTasks = [] | ||
gradle.rootProject.allprojects { project -> | ||
unitTestTasks.addAll(project.tasks.findAll { it.name == 'test' }) | ||
} | ||
unitTestTasks.each { unitTestTask -> | ||
project.integTest.mustRunAfter unitTestTask | ||
} | ||
} | ||
|
||
// Add integration test source directories to IDEA .iml files | ||
if (project.plugins.hasPlugin('idea')) { | ||
idea.module { | ||
testSourceDirs += (sourceSets.integTest.java.srcDirs + sourceSets.integTest.resources.srcDirs) | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hpryce Please use https://github.com/unbroken-dome/gradle-testsets-plugin instead of copying and pasting gradle!!
You shouldn't have to do any custom
reports.html.destination =
stuff