What the release gates' recording runs ask, shared by
tools/record-gates, which records them, and tests/gate_*.rs, which
replay them. A replay matches by the exact request bytes, so the rows,
the question and the SQL must be the ones recorded; they live here
once so the two cannot drift apart.
7use std::path::PathBuf;
The rows every run draws from, as people holds them.
A small occupational hierarchy for the label-tree run.
22pub const TREE_PATHS: [&str; 12] = [ 23 "Office > Engineering > Backend", 24 "Office > Engineering > Frontend", 25 "Office > Finance > Accounting", 26 "Office > Finance > Audit", 27 "Care > Hospital > Nursing", 28 "Care > Hospital > Surgery", 29 "Care > Community > Home care", 30 "Care > Community > Social work", 31 "Transport > Road > Bus", 32 "Transport > Road > Freight", 33 "Transport > Rail > Driver", 34 "Transport > Rail > Signalling", 35];
The label-tree run: $1 is [QUESTION], $2 is [TREE_PATHS].
The ranking run: $1 is [QUESTION].
Creates the extension (unless there) and people, holding [ROWS].
46pub async fn setup_people(client: &tokio_postgres::Client) -> Result<(), tokio_postgres::Error> { 47 let mut setup = String::from( 48 "SET statement_timeout = '120s'; CREATE EXTENSION IF NOT EXISTS postjevsql; \ 49 CREATE TABLE people (name text, role text, country text);", 50 ); 51 for row in ROWS { 52 let v: serde_json::Value = serde_json::from_str(row).unwrap(); 53 let quote = |k: &str| format!("'{}'", v[k].as_str().expect("the rows are text").replace('\'', "''")); 54 setup += &format!("INSERT INTO people VALUES ({}, {}, {});", quote("name"), quote("role"), quote("country")); 55 } 56 client.batch_execute(&setup).await 57}
The committed fixture of one gate, tests/fixtures/<gate>.json, found
through POSTJEVSQL_FIXTURES, which tests/BUCK sets.