Skip to content

Commit 3d9be5f

Browse files
authored
Fixes BuildImageMojoIT to use only project-level cache. (#178)
1 parent ec8c96d commit 3d9be5f

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/BuildImageMojoIT.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@ private String buildAndRun(Path projectRoot, String imageReference)
7070

7171
verifier.verifyErrorFreeLog();
7272

73-
Assert.assertTrue(timeOne > timeTwo);
73+
Assert.assertTrue(
74+
"First build time ("
75+
+ timeOne
76+
+ ") is not greater than second build time ("
77+
+ timeTwo
78+
+ ")",
79+
timeOne > timeTwo);
7480

7581
new Command("docker", "pull", imageReference).run();
7682
return new Command("docker", "run", imageReference).run();

jib-maven-plugin/src/test/resources/projects/empty/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
<credHelpers>
3535
<credHelper>gcr</credHelper>
3636
</credHelpers>
37+
<!-- Does not have tests use user-level cache for base image layers. -->
38+
<useOnlyProjectCache>true</useOnlyProjectCache>
3739
</configuration>
3840
</plugin>
3941
</plugins>

jib-maven-plugin/src/test/resources/projects/simple/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
<credHelper>gcr</credHelper>
4646
</credHelpers>
4747
<mainClass>com.test.HelloWorld</mainClass>
48+
<!-- Does not have tests use user-level cache for base image layers. -->
49+
<useOnlyProjectCache>true</useOnlyProjectCache>
4850
</configuration>
4951
</plugin>
5052
</plugins>

0 commit comments

Comments
 (0)