Skip to content

Commit 13b0219

Browse files
committed
fix test compile
Signed-off-by: clux <[email protected]>
1 parent 3c48778 commit 13b0219

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/controller.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ mod test {
304304
#[ignore = "uses k8s current-context"]
305305
async fn integration_reconcile_should_set_status_and_send_event() {
306306
let client = kube::Client::try_default().await.unwrap();
307-
let ctx = super::State::default().to_context(client.clone());
307+
let ctx = super::State::default().to_context(client.clone()).await;
308308

309309
// create a test doc
310310
let doc = Document::test().finalized().needs_hide();

src/fixtures.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use crate::{Context, Document, DocumentSpec, DocumentStatus, Result, DOCUMENT_FINALIZER};
33
use assert_json_diff::assert_json_include;
44
use http::{Request, Response};
5-
use kube::{client::Body, Client, Resource, ResourceExt};
5+
use kube::{client::Body, runtime::events::Recorder, Client, Resource, ResourceExt};
66
use std::sync::Arc;
77

88
impl Document {
@@ -210,10 +210,12 @@ impl Context {
210210
pub fn test() -> (Arc<Self>, ApiServerVerifier) {
211211
let (mock_service, handle) = tower_test::mock::pair::<Request<Body>, Response<Body>>();
212212
let mock_client = Client::new(mock_service, "default");
213+
let mock_recorder = Recorder::new(mock_client.clone(), "doc-ctrl-test".into());
213214
let ctx = Self {
214215
client: mock_client,
215216
metrics: Arc::default(),
216217
diagnostics: Arc::default(),
218+
recorder: mock_recorder,
217219
};
218220
(Arc::new(ctx), ApiServerVerifier(handle))
219221
}

0 commit comments

Comments
 (0)