Skip to content

Commit

Permalink
fix: accurately count copy dir statements (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
manusa authored Jan 9, 2025
1 parent ecbbe7a commit 97d70ee
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ void k8sBuild() throws Exception {
assertThat(imageFiles, hasItem("/deployments/org/springframework/boot/loader/JarLauncher.class"));
final List<String> imageHistory = getImageHistory(String.format("%s/%s", "integration-tests", getApplication()));
long dirCopyLayers = imageHistory.stream()
.filter(l -> !l.startsWith("<missing>"))
.filter(l -> l.contains("COPY dir:"))
.count();
assertThat(dirCopyLayers, equalTo(4L));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ void k8sBuild() throws Exception {
assertThat(imageFiles, hasItem("/deployments/org/springframework/boot/loader/JarLauncher.class"));
final List<String> imageHistory = getImageHistory(String.format("%s/%s", "gradle", getApplication()));
long dirCopyLayers = imageHistory.stream()
.filter(l -> !l.startsWith("<missing>"))
.filter(l -> l.contains("COPY dir:"))
.count();
assertThat(dirCopyLayers, equalTo(3L));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ void k8sBuild() throws Exception {
assertThat(imageFiles, hasItem("/deployments/org/springframework/boot/loader/JarLauncher.class"));
final List<String> imageHistory = getImageHistory(String.format("%s/%s", "integration-tests", getApplication()));
long dirCopyLayers = imageHistory.stream()
.filter(l -> !l.startsWith("<missing>"))
.filter(l -> l.contains("COPY dir:"))
.count();
assertThat(dirCopyLayers, equalTo(3L));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ void k8sBuild() throws Exception {
assertThat(imageFiles, hasItem("/deployments/spring-boot-zero-config-fatjar-0.0.0-SNAPSHOT.jar"));
final List<String> imageHistory = getImageHistory(String.format("%s/%s", "integration-tests", getApplication()));
long dirCopyLayers = imageHistory.stream()
.filter(l -> !l.startsWith("<missing>"))
.filter(l -> l.contains("COPY dir:"))
.count();
assertThat(dirCopyLayers, equalTo(1L));
Expand Down

0 comments on commit 97d70ee

Please sign in to comment.