Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit 54b0ea8

Browse files
author
Priya Wadhwa
committed
Integration test
1 parent ca66892 commit 54b0ea8

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"Image": "gcr.io/gcp-runtimes/diff-layer-base",
4+
"AnalyzeType": "FileLayer",
5+
"Analysis": [
6+
[
7+
{
8+
"Name": "/first",
9+
"Size": 6
10+
}
11+
],
12+
[
13+
{
14+
"Name": "/second",
15+
"Size": 7
16+
}
17+
],
18+
[
19+
{
20+
"Name": "/third",
21+
"Size": 6
22+
}
23+
]
24+
]
25+
}
26+
]

tests/file_layer_diff_expected.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[
2+
{
3+
"Image1": "gcr.io/gcp-runtimes/diff-layer-base",
4+
"Image2": "gcr.io/gcp-runtimes/diff-layer-modified",
5+
"DiffType": "FileLayer",
6+
"Diff": {
7+
"DirDiffs": [
8+
{
9+
"Adds": null,
10+
"Dels": null,
11+
"Mods": null
12+
},
13+
{
14+
"Adds": [
15+
{
16+
"Name": "/modified",
17+
"Size": 9
18+
}
19+
],
20+
"Dels": [
21+
{
22+
"Name": "/second",
23+
"Size": 7
24+
}
25+
],
26+
"Mods": null
27+
},
28+
{
29+
"Adds": null,
30+
"Dels": [
31+
{
32+
"Name": "/third",
33+
"Size": 6
34+
}
35+
],
36+
"Mods": null
37+
}
38+
]
39+
}
40+
}
41+
]

tests/integration_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ const (
3838
diffBase = "gcr.io/gcp-runtimes/diff-base"
3939
diffModified = "gcr.io/gcp-runtimes/diff-modified"
4040

41+
diffLayerBase = "gcr.io/gcp-runtimes/diff-layer-base"
42+
diffLayerModifed = "gcr.io/gcp-runtimes/diff-layer-modified"
43+
4144
metadataBase = "gcr.io/gcp-runtimes/metadata-base"
4245
metadataModified = "gcr.io/gcp-runtimes/metadata-modified"
4346

@@ -106,6 +109,14 @@ func TestDiffAndAnalysis(t *testing.T) {
106109
differFlags: []string{"--type=file"},
107110
expectedFile: "file_diff_expected.json",
108111
},
112+
{
113+
description: "file layer differ",
114+
subcommand: "diff",
115+
imageA: diffLayerBase,
116+
imageB: diffLayerModifed,
117+
differFlags: []string{"--type=file-layer"},
118+
expectedFile: "file_layer_diff_expected.json",
119+
},
109120
{
110121
description: "apt differ",
111122
subcommand: "diff",
@@ -191,6 +202,13 @@ func TestDiffAndAnalysis(t *testing.T) {
191202
differFlags: []string{"--type=file", "-o"},
192203
expectedFile: "file_sorted_analysis_expected.json",
193204
},
205+
{
206+
description: "file layer analysis",
207+
subcommand: "analyze",
208+
imageA: diffLayerBase,
209+
differFlags: []string{"--type=file-layer"},
210+
expectedFile: "file_layer_analysis_expected.json",
211+
},
194212
{
195213
description: "pip analysis",
196214
subcommand: "analyze",

0 commit comments

Comments
 (0)