Skip to content

Commit

Permalink
Enable some tests for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
altro3 committed Nov 17, 2024
1 parent 818d1f9 commit 221ec2c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package io.micronaut.gradle.crac
import groovy.json.JsonSlurper
import spock.lang.IgnoreIf

@IgnoreIf({ os.windows })
class CracCustomizationSpec extends BaseCracGradleBuildSpec {

@IgnoreIf({ os.windows })
void "run script is created"() {
given:
settingsFile << "rootProject.name = 'hello-world'"
Expand All @@ -19,6 +19,7 @@ class CracCustomizationSpec extends BaseCracGradleBuildSpec {
fileTextContents("build/docker/main/scripts/run.sh") == CracCustomizationSpec.getResourceAsStream("/run.sh").text
}

@IgnoreIf({ os.windows })
void "default warmup script is used by default"() {
given:
settingsFile << "rootProject.name = 'hello-world'"
Expand All @@ -32,6 +33,7 @@ class CracCustomizationSpec extends BaseCracGradleBuildSpec {
fileTextContents("build/docker/main/scripts/warmup.sh") == CracCustomizationSpec.getResourceAsStream("/warmup.sh").text
}

@IgnoreIf({ os.windows })
void "warmup script is customizable"() {
given:
settingsFile << "rootProject.name = 'hello-world'"
Expand All @@ -48,6 +50,7 @@ class CracCustomizationSpec extends BaseCracGradleBuildSpec {
fileTextContents("build/docker/main/scripts/warmup.sh") == "This is a test"
}

@IgnoreIf({ os.windows })
void "default checkpoint script is used by default"() {
given:
settingsFile << "rootProject.name = 'hello-world'"
Expand All @@ -62,6 +65,7 @@ class CracCustomizationSpec extends BaseCracGradleBuildSpec {
fileTextContents("build/docker/main/scripts/checkpoint.sh") == expected
}

@IgnoreIf({ os.windows })
void "checkpoint script is customizable"() {
given:
settingsFile << "rootProject.name = 'hello-world'"
Expand Down Expand Up @@ -180,7 +184,7 @@ class CracCustomizationSpec extends BaseCracGradleBuildSpec {
def result = fails('dockerfileCrac', 'checkpointDockerfile', '-s')

then:
result.output.contains('Caused by: java.lang.NumberFormatException: For input string: "tim"')
result.output.contains("Caused by: java.lang.IllegalArgumentException: JavaLanguageVersion must be a positive integer, not 'tim'")
}

void "dockerfiles can be customized"() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.micronaut.gradle


import org.gradle.testkit.runner.TaskOutcome

class BuildLayersSpec extends AbstractGradleBuildSpec {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import spock.lang.Issue
import static org.mockserver.model.HttpRequest.request
import static org.mockserver.model.HttpResponse.response

@IgnoreIf({ os.windows })
class DockerBuildTaskSpec extends AbstractGradleBuildSpec {
private final String today = new Date().format("yyyyMMdd")
private final String now = new Date().format("HHmmss")

@IgnoreIf({ os.windows })
def "test build docker image"() {
given:
settingsFile << "rootProject.name = 'hello-world'"
Expand Down Expand Up @@ -55,6 +55,7 @@ class Application {

}

@IgnoreIf({ os.windows })
def "test build docker image using custom Dockerfile"() {
given:
settingsFile << "rootProject.name = 'hello-world'"
Expand Down Expand Up @@ -148,6 +149,7 @@ class Application {
def dockerfile = new File(testProjectDir.root, 'build/docker/main/Dockerfile').readLines('UTF-8')
}

@IgnoreIf({ os.windows })
@Issue("https://github.com/micronaut-projects/micronaut-gradle-plugin/issues/402")
def "can override default working dir"() {
given:
Expand Down Expand Up @@ -204,6 +206,7 @@ ENTRYPOINT ["java", "-jar", "/home/alternate/application.jar"]
"""
}

@IgnoreIf({ os.windows })
def "can disable the use of the COPY --link option"() {
given:
settingsFile << "rootProject.name = 'hello-world'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import org.gradle.testkit.runner.TaskOutcome
import spock.lang.IgnoreIf
import spock.lang.Requires

@IgnoreIf({ os.windows })
class MicronautAOTDockerSpec extends AbstractAOTPluginSpec {

def "generates an optimized docker file"() {
Expand All @@ -29,6 +28,7 @@ ENTRYPOINT ["java", "-jar", "/home/app/application.jar"]

}

@IgnoreIf({ os.windows })
def "generates an optimized docker image"() {
withSample("aot/basic-app")

Expand Down

0 comments on commit 221ec2c

Please sign in to comment.