postjevsql.git / tests / gate_label_tree.rs

Release gate "label tree", replayed: the whole best-first search over the recorded live answers (tests/fixtures/label_tree.json, from tools/record-gates --send). Every round, lookahead and the "does any label fit" Noul must be asked exactly as recorded.

6use support::gates::{LABEL_TREE_SQL, QUESTION, TREE_PATHS, fixture, setup_people};
7use support::mock_jev::MockJev;
8use support::mock_jev::replay::Replay;
10#[tokio::test(flavor = "multi_thread")]
11async fn searches_the_recorded_answers() {
12    let fixture = fixture("label_tree");
13    let replay = Replay::new(&fixture);
14    let mock = MockJev::start(replay.responder()).await;
15    let (_pg, client) = support::jev_instance(&mock).await;
16    setup_people(&client).await.expect("setup");
17
18    let paths: Vec<&str> = TREE_PATHS.to_vec();
19    let path: String = client.query_one(LABEL_TREE_SQL, &[&QUESTION, &paths]).await.expect("replayed").get(0);
20    assert_eq!(path, "Office > Engineering > Backend");
21    assert_eq!(mock.requests().len(), fixture.exchanges.len());
22    replay.assert_complete();
23}