@@ -72,7 +72,7 @@ VERSIONED_CHARACTERIZATION_TEST(
72
72
73
73
VERSIONED_CHARACTERIZATION_TEST(
74
74
ServeProtoTest,
75
- drvOutput ,
75
+ drvOutput_2_8 ,
76
76
" drv-output-2.8" ,
77
77
2 << 8 | 8 ,
78
78
(std::tuple<DrvOutput, DrvOutput>{
@@ -90,7 +90,7 @@ VERSIONED_CHARACTERIZATION_TEST(
90
90
91
91
VERSIONED_CHARACTERIZATION_TEST (
92
92
ServeProtoTest,
93
- unkeyedRealisation ,
93
+ unkeyedRealisation_2_8 ,
94
94
" unkeyed-realisation-2.8" ,
95
95
2 << 8 | 8 ,
96
96
(UnkeyedRealisation{
@@ -100,7 +100,7 @@ VERSIONED_CHARACTERIZATION_TEST(
100
100
101
101
VERSIONED_CHARACTERIZATION_TEST (
102
102
ServeProtoTest,
103
- realisation ,
103
+ realisation_2_8 ,
104
104
" realisation-2.8" ,
105
105
2 << 8 | 8 ,
106
106
(Realisation{
@@ -156,8 +156,59 @@ VERSIONED_CHARACTERIZATION_TEST(ServeProtoTest, buildResult_2_3, "build-result-2
156
156
t;
157
157
}))
158
158
159
+ /* We now do a lossy read which does not allow us to faithfully right
160
+ back, since we changed the data type. We still however want to test
161
+ that this read works, and so for that we have a one-way test. */
162
+ VERSIONED_READ_CHARACTERIZATION_TEST (
163
+ ServeProtoTest, buildResult_2_6, " build-result-2.6" , 2 << 8 | 6 , ({
164
+ using namespace std ::literals::chrono_literals;
165
+ std::tuple<BuildResult, BuildResult, BuildResult> t{
166
+ BuildResult{
167
+ .status = BuildResult::OutputRejected,
168
+ .errorMsg = " no idea why" ,
169
+ },
170
+ BuildResult{
171
+ .status = BuildResult::NotDeterministic,
172
+ .errorMsg = " no idea why" ,
173
+ .timesBuilt = 3 ,
174
+ .isNonDeterministic = true ,
175
+ .startTime = 30 ,
176
+ .stopTime = 50 ,
177
+ },
178
+ BuildResult{
179
+ .status = BuildResult::Built,
180
+ .timesBuilt = 1 ,
181
+ .builtOutputs =
182
+ {
183
+ {
184
+ " foo" ,
185
+ {
186
+ .outPath = StorePath{" g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo" },
187
+ },
188
+ },
189
+ {
190
+ " bar" ,
191
+ {
192
+ .outPath = StorePath{" g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar" },
193
+ },
194
+ },
195
+ },
196
+ .startTime = 30 ,
197
+ .stopTime = 50 ,
198
+ #if 0
199
+ // These fields are not yet serialized.
200
+ // FIXME Include in next version of protocol or document
201
+ // why they are skipped.
202
+ .cpuUser = std::chrono::milliseconds(500s),
203
+ .cpuSystem = std::chrono::milliseconds(604s),
204
+ #endif
205
+ },
206
+ };
207
+ t;
208
+ }))
209
+
159
210
VERSIONED_CHARACTERIZATION_TEST (
160
- ServeProtoTest, buildResult_2_6 , " build-result-2.8" , 2 << 8 | 8 , ({
211
+ ServeProtoTest, buildResult_2_8 , " build-result-2.8" , 2 << 8 | 8 , ({
161
212
using namespace std ::literals::chrono_literals;
162
213
std::tuple<BuildResult, BuildResult, BuildResult> t{
163
214
BuildResult{
0 commit comments