Skip to content

Commit 0d7b16d

Browse files
committed
Split realisation protocol unit tests
This will allow us to more accurately test dropping support for dependent realisations, by separating the tests that should not change from the tests that should. I do that change in PR #14247, but even if for some reasons we don't end up doing this soon, I think it is still good to separate the test data this way so we have the option of doing that at some point.
1 parent f63bb5b commit 0d7b16d

File tree

9 files changed

+52
-3
lines changed

9 files changed

+52
-3
lines changed

src/libstore-tests/common-protocol.cc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,31 @@ CHARACTERIZATION_TEST(
111111
realisation,
112112
"realisation",
113113
(std::tuple<Realisation, Realisation>{
114+
Realisation{
115+
{
116+
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
117+
},
118+
{
119+
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
120+
.outputName = "baz",
121+
},
122+
},
114123
Realisation{
115124
{
116125
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
117126
.signatures = {"asdf", "qwer"},
118127
},
119-
DrvOutput{
128+
{
120129
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
121130
.outputName = "baz",
122131
},
123132
},
133+
}))
134+
135+
CHARACTERIZATION_TEST(
136+
realisation_with_deps,
137+
"realisation-with-deps",
138+
(std::tuple<Realisation>{
124139
Realisation{
125140
{
126141
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
320 Bytes
Binary file not shown.
-136 Bytes
Binary file not shown.
320 Bytes
Binary file not shown.
-136 Bytes
Binary file not shown.
320 Bytes
Binary file not shown.
-136 Bytes
Binary file not shown.

src/libstore-tests/serve-protocol.cc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ VERSIONED_CHARACTERIZATION_TEST(
9494
"realisation",
9595
defaultVersion,
9696
(std::tuple<Realisation, Realisation>{
97+
Realisation{
98+
{
99+
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
100+
},
101+
{
102+
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
103+
.outputName = "baz",
104+
},
105+
},
97106
Realisation{
98107
{
99108
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
@@ -104,6 +113,14 @@ VERSIONED_CHARACTERIZATION_TEST(
104113
.outputName = "baz",
105114
},
106115
},
116+
}))
117+
118+
VERSIONED_CHARACTERIZATION_TEST(
119+
ServeProtoTest,
120+
realisation_with_deps,
121+
"realisation-with-deps",
122+
defaultVersion,
123+
(std::tuple<Realisation>{
107124
Realisation{
108125
{
109126
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},

src/libstore-tests/worker-protocol.cc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,33 @@ VERSIONED_CHARACTERIZATION_TEST(
147147
"realisation",
148148
defaultVersion,
149149
(std::tuple<Realisation, Realisation>{
150+
Realisation{
151+
{
152+
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
153+
},
154+
{
155+
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
156+
.outputName = "baz",
157+
},
158+
},
150159
Realisation{
151160
{
152161
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
153162
.signatures = {"asdf", "qwer"},
154163
},
155-
DrvOutput{
164+
{
156165
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
157166
.outputName = "baz",
158167
},
159168
},
169+
}))
170+
171+
VERSIONED_CHARACTERIZATION_TEST(
172+
WorkerProtoTest,
173+
realisation_with_deps,
174+
"realisation-with-deps",
175+
defaultVersion,
176+
(std::tuple<Realisation>{
160177
Realisation{
161178
{
162179
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
@@ -172,7 +189,7 @@ VERSIONED_CHARACTERIZATION_TEST(
172189
},
173190
},
174191
},
175-
DrvOutput{
192+
{
176193
.drvHash = Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
177194
.outputName = "baz",
178195
},

0 commit comments

Comments
 (0)