Skip to content

Commit

Permalink
Integration test: use same time in all reports (#3238)
Browse files Browse the repository at this point in the history
  • Loading branch information
divergentdave committed Jun 14, 2024
1 parent 52097d7 commit 3a7a692
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
id: default-input-values
run: |
DIVVIUP_TS_INTEROP_CONTAINER= ${{ inputs.divviup_ts_interop_container }}
echo "divviup_ts_interop_container=${DIVVIUP_TS_INTEROP_CONTAINER:-us-west2-docker.pkg.dev/divviup-artifacts-public/divviup-ts/divviup_ts_interop_client:4e71c8b@sha256:61d1bf4cb731d0637b2c5489c45def0155ac22411c4e97607e6cff67cf135198}" >> $GITHUB_OUTPUT
echo "divviup_ts_interop_container=${DIVVIUP_TS_INTEROP_CONTAINER:-us-west2-docker.pkg.dev/divviup-artifacts-public/divviup-ts/divviup_ts_interop_client:e2bd57d@sha256:ea32ec6d1e6522d4282b644e9885aeb30a0a92877f73e27424e9e00844b9a80c}" >> $GITHUB_OUTPUT
- name: Get OS version
id: os-version
run: echo "release=$(lsb_release --release --short)" >> $GITHUB_OUTPUT
Expand Down
16 changes: 9 additions & 7 deletions integration_tests/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine};
use janus_client::Client;
use janus_core::vdaf::{Prio3SumVecField64MultiproofHmacSha256Aes128, VdafInstance};
use janus_interop_binaries::{get_rust_log_level, ContainerLogsDropGuard};
use janus_messages::{Duration, TaskId};
use janus_messages::{Duration, TaskId, Time};
use prio::{
codec::Encode,
field::Field64,
Expand Down Expand Up @@ -155,8 +155,8 @@ impl InteropClient {
name: "us-west2-docker.pkg.dev/divviup-artifacts-public/divviup-ts/\
divviup_ts_interop_client"
.to_string(),
tag: "4e71c8b@sha256:\
61d1bf4cb731d0637b2c5489c45def0155ac22411c4e97607e6cff67cf135198"
tag: "e2bd57d@sha256:\
ea32ec6d1e6522d4282b644e9885aeb30a0a92877f73e27424e9e00844b9a80c"
.to_string(),
}
}
Expand Down Expand Up @@ -314,11 +314,12 @@ where
}))
}

pub async fn upload(&self, measurement: &V::Measurement) -> anyhow::Result<()> {
pub async fn upload(&self, measurement: &V::Measurement, time: Time) -> anyhow::Result<()> {
match self {
ClientImplementation::InProcess { client } => {
client.upload(measurement).await.map_err(Into::into)
}
ClientImplementation::InProcess { client } => client
.upload_with_time(measurement, time)
.await
.map_err(Into::into),
ClientImplementation::Container(inner) => {
let task_id_encoded = URL_SAFE_NO_PAD.encode(inner.task_id.get_encoded().unwrap());
let upload_response = inner
Expand All @@ -333,6 +334,7 @@ where
"helper": inner.helper,
"vdaf": json_encode_vdaf(&inner.vdaf_instance),
"measurement": inner.vdaf.json_encode_measurement(measurement),
"time": time.as_seconds_since_epoch(),
"time_precision": inner.time_precision.as_seconds(),
}))
.send()
Expand Down
9 changes: 6 additions & 3 deletions integration_tests/tests/integration/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,15 @@ where
{
// Submit some measurements, recording a timestamp before measurement upload to allow us to
// determine the correct collect interval. (for time interval tasks)
let before_timestamp = RealClock::default().now();
let time = RealClock::default().now();
for measurement in measurements.iter() {
client_implementation.upload(measurement).await.unwrap();
client_implementation
.upload(measurement, time)
.await
.unwrap();
}

before_timestamp
time
}

pub async fn verify_aggregate_generic<V>(
Expand Down

0 comments on commit 3a7a692

Please sign in to comment.