From cced980387cfbd10fc6f56d12efbcbb46b0f8e23 Mon Sep 17 00:00:00 2001 From: DecFox <33030671+DecFox@users.noreply.github.com> Date: Wed, 18 May 2022 19:16:08 +0530 Subject: [PATCH] fix(webconnectivity): pass TestHelpers to measurement (#736) * Passed the TestHelpers field to RunAsyc and MeasureAsync. This reflects the test_helpers in the measurement. * Spec already contains the correct output. See https://github.com/ooni/probe/issues/2073 Co-authored-by: decfox --- internal/engine/experiment.go | 2 ++ internal/model/experiment.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/internal/engine/experiment.go b/internal/engine/experiment.go index 053eb0a..7f62c56 100644 --- a/internal/engine/experiment.go +++ b/internal/engine/experiment.go @@ -131,6 +131,7 @@ func (eaw *experimentAsyncWrapper) RunAsync( Input: measurement.Input, MeasurementRuntime: stop.Sub(start).Seconds(), TestKeys: measurement.TestKeys, + TestHelpers: measurement.TestHelpers, } }() return out, nil @@ -180,6 +181,7 @@ func (e *Experiment) MeasureAsync( measurement.Extensions = tk.Extensions measurement.Input = tk.Input measurement.MeasurementRuntime = tk.MeasurementRuntime + measurement.TestHelpers = tk.TestHelpers measurement.TestKeys = tk.TestKeys if err := measurement.Scrub(e.session.ProbeIP()); err != nil { // If we fail to scrub the measurement then we are not going to diff --git a/internal/model/experiment.go b/internal/model/experiment.go index 1e8a8a3..b21d1c5 100644 --- a/internal/model/experiment.go +++ b/internal/model/experiment.go @@ -39,6 +39,9 @@ type ExperimentAsyncTestKeys struct { // MeasurementRuntime is the total measurement runtime. MeasurementRuntime float64 + // TestHelpers contains the test helpers used in the experiment + TestHelpers map[string]interface{} + // TestKeys contains the actual test keys. TestKeys interface{} }