Skip to content

Commit 40e5eba

Browse files
committed
[bfops/rust-smoketests-lib]: revert
1 parent 033fc8f commit 40e5eba

17 files changed

Lines changed: 292 additions & 326 deletions

File tree

crates/bindings/tests/ui/views.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ fn sched_table_view(_: &ViewContext, _args: ScheduledTable) -> Vec<PlayerInfo> {
144144
vec![]
145145
}
146146

147+
147148
#[table(accessor = player_info)]
148149
struct PlayerInfo {
149150
#[unique]

crates/bindings/tests/ui/views.stderr

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,20 @@ error[E0425]: cannot find type `ScheduledTable` in this scope
6161
| ^^^^^^^^^^^^^^ not found in this scope
6262

6363
error[E0425]: cannot find type `T` in this scope
64-
--> tests/ui/views.rs:201:60
64+
--> tests/ui/views.rs:202:60
6565
|
66-
201 | fn view_nonexistent_table(ctx: &ViewContext) -> impl Query<T> {
66+
202 | fn view_nonexistent_table(ctx: &ViewContext) -> impl Query<T> {
6767
| ^ not found in this scope
6868
|
6969
help: you might be missing a type parameter
7070
|
71-
201 | fn view_nonexistent_table<T>(ctx: &ViewContext) -> impl Query<T> {
71+
202 | fn view_nonexistent_table<T>(ctx: &ViewContext) -> impl Query<T> {
7272
| +++
7373

7474
error[E0425]: cannot find type `T` in this scope
75-
--> tests/ui/views.rs:201:60
75+
--> tests/ui/views.rs:202:60
7676
|
77-
201 | fn view_nonexistent_table(ctx: &ViewContext) -> impl Query<T> {
77+
202 | fn view_nonexistent_table(ctx: &ViewContext) -> impl Query<T> {
7878
| ^ not found in this scope
7979

8080
error[E0277]: the trait bound `ViewKind<ReducerContext>: ViewKindTrait` is not satisfied
@@ -411,9 +411,9 @@ help: the trait `SpacetimeType` is not implemented for `NotSpacetimeType`
411411
= note: required for `Option<NotSpacetimeType>` to implement `SpacetimeType`
412412

413413
error[E0277]: the trait bound `{integer}: RHS<Player, spacetimedb::Identity>` is not satisfied
414-
--> tests/ui/views.rs:159:49
414+
--> tests/ui/views.rs:160:49
415415
|
416-
159 | ctx.from.player().r#where(|a| a.identity.eq(42)).build()
416+
160 | ctx.from.player().r#where(|a| a.identity.eq(42)).build()
417417
| -- ^^ the trait `RHS<Player, spacetimedb::Identity>` is not implemented for `{integer}`
418418
| |
419419
| required by a bound introduced by this call
@@ -435,9 +435,9 @@ note: required by a bound in `Col::<T, V>::eq`
435435
| ^^^^^^^^^ required by this bound in `Col::<T, V>::eq`
436436

437437
error[E0277]: the trait bound `u32: RHS<PlayerInfo, u8>` is not satisfied
438-
--> tests/ui/views.rs:165:49
438+
--> tests/ui/views.rs:166:49
439439
|
440-
165 | ctx.from.player_info().r#where(|a| a.age.eq(4200u32)).build()
440+
166 | ctx.from.player_info().r#where(|a| a.age.eq(4200u32)).build()
441441
| -- ^^^^^^^ the trait `RHS<PlayerInfo, u8>` is not implemented for `u32`
442442
| |
443443
| required by a bound introduced by this call
@@ -457,9 +457,9 @@ note: required by a bound in `Col::<T, V>::eq`
457457
= note: this error originates in the macro `impl_rhs` (in Nightly builds, run with -Z macro-backtrace for more info)
458458

459459
error[E0308]: mismatched types
460-
--> tests/ui/views.rs:174:62
460+
--> tests/ui/views.rs:175:62
461461
|
462-
174 | .left_semijoin(ctx.from.player(), |a, b| a.weight.eq(b.identity))
462+
175 | .left_semijoin(ctx.from.player(), |a, b| a.weight.eq(b.identity))
463463
| -- ^^^^^^^^^^ expected `IxCol<Player, u32>`, found `IxCol<Player, Identity>`
464464
| |
465465
| arguments to this method are incorrect
@@ -473,15 +473,15 @@ note: method defined here
473473
| ^^
474474

475475
error[E0609]: no field `age` on type `&PlayerInfoIxCols`
476-
--> tests/ui/views.rs:184:72
476+
--> tests/ui/views.rs:185:72
477477
|
478-
184 | .right_semijoin(ctx.from.player_info(), |a, b| a.identity.eq(b.age))
478+
185 | .right_semijoin(ctx.from.player_info(), |a, b| a.identity.eq(b.age))
479479
| ^^^ unknown field
480480
|
481481
= note: available fields are: `identity`, `weight`
482482

483483
error[E0599]: no method named `xyz` found for struct `QueryBuilder` in the current scope
484-
--> tests/ui/views.rs:202:14
484+
--> tests/ui/views.rs:203:14
485485
|
486-
202 | ctx.from.xyz().build()
486+
203 | ctx.from.xyz().build()
487487
| ^^^ method not found in `QueryBuilder`

tools/xtask-llm-benchmark/src/benchmarks/basics/t_004_insert/spec.rs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,24 @@ pub fn spec() -> BenchmarkSpec {
88
let mut v = default_schema_parity_scorers(host_url, file!(), route_tag);
99
let casing = casing_for_lang(lang);
1010
let sb = SqlBuilder::new(casing);
11-
let select = sb.select_by_id(&table_name("user", lang), &["id", "name", "age", "active"], "id", 1);
11+
let select = sb.select_by_id(&table_name("user", lang), &["id","name","age","active"], "id", 1);
1212
let reducer_name = ident("InsertUser", crate::eval::Casing::Snake);
1313

14-
v.push(make_reducer_data_parity_scorer(
15-
host_url,
16-
ReducerDataParityConfig {
17-
src_file: file!(),
18-
route_tag,
19-
reducer: reducer_name.into(),
20-
args: vec![Value::from(1), Value::from("Alice"), Value::from(30), Value::from(true)],
21-
select_query: select.clone(),
22-
id_str: "data_parity_insert_user",
23-
collapse_ws: true,
24-
timeout: time::Duration::from_secs(10),
25-
},
26-
));
14+
v.push(make_reducer_data_parity_scorer(host_url, ReducerDataParityConfig {
15+
src_file: file!(),
16+
route_tag,
17+
reducer: reducer_name.into(),
18+
args: vec![
19+
Value::from(1),
20+
Value::from("Alice"),
21+
Value::from(30),
22+
Value::from(true),
23+
],
24+
select_query: select.clone(),
25+
id_str: "data_parity_insert_user",
26+
collapse_ws: true,
27+
timeout: time::Duration::from_secs(10),
28+
}));
2729
v
2830
})
2931
}

tools/xtask-llm-benchmark/src/benchmarks/basics/t_005_update/spec.rs

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use crate::eval::defaults::{
2-
default_schema_parity_scorers, make_reducer_data_parity_scorer, make_sql_exec_both_scorer,
2+
default_schema_parity_scorers,
3+
make_reducer_data_parity_scorer,
4+
make_sql_exec_both_scorer,
35
};
46
use crate::eval::{casing_for_lang, ident, table_name, BenchmarkSpec, ReducerDataParityConfig, SqlBuilder};
57
use serde_json::Value;
@@ -12,12 +14,8 @@ pub fn spec() -> BenchmarkSpec {
1214
let casing = casing_for_lang(lang);
1315
let sb = SqlBuilder::new(casing);
1416
let user_table = table_name("user", lang);
15-
let seed = sb.insert_values(
16-
&user_table,
17-
&["id", "name", "age", "active"],
18-
&["1", "'Alice'", "30", "true"],
19-
);
20-
let select = sb.select_by_id(&user_table, &["id", "name", "age", "active"], "id", 1);
17+
let seed = sb.insert_values(&user_table, &["id","name","age","active"], &["1","'Alice'","30","true"]);
18+
let select = sb.select_by_id(&user_table, &["id","name","age","active"], "id", 1);
2119
let reducer_name = ident("UpdateUser", crate::eval::Casing::Snake);
2220

2321
v.push(make_sql_exec_both_scorer(
@@ -29,24 +27,21 @@ pub fn spec() -> BenchmarkSpec {
2927
time::Duration::from_secs(10),
3028
));
3129

32-
v.push(make_reducer_data_parity_scorer(
33-
host_url,
34-
ReducerDataParityConfig {
35-
src_file: file!(),
36-
route_tag,
37-
reducer: reducer_name.into(),
38-
args: vec![
39-
Value::from(1),
40-
Value::from("Alice2"),
41-
Value::from(31),
42-
Value::from(false),
43-
],
44-
select_query: select.clone(),
45-
id_str: "data_parity_update_user",
46-
collapse_ws: true,
47-
timeout: time::Duration::from_secs(10),
48-
},
49-
));
30+
v.push(make_reducer_data_parity_scorer(host_url, ReducerDataParityConfig {
31+
src_file: file!(),
32+
route_tag,
33+
reducer: reducer_name.into(),
34+
args: vec![
35+
Value::from(1),
36+
Value::from("Alice2"),
37+
Value::from(31),
38+
Value::from(false),
39+
],
40+
select_query: select.clone(),
41+
id_str: "data_parity_update_user",
42+
collapse_ws: true,
43+
timeout: time::Duration::from_secs(10),
44+
}));
5045

5146
v
5247
})

tools/xtask-llm-benchmark/src/benchmarks/basics/t_006_delete/spec.rs

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
use crate::eval::defaults::{default_schema_parity_scorers, make_reducer_sql_count_scorer, make_sql_exec_both_scorer};
1+
use crate::eval::defaults::{
2+
default_schema_parity_scorers,
3+
make_reducer_sql_count_scorer,
4+
make_sql_exec_both_scorer,
5+
};
26
use crate::eval::{casing_for_lang, ident, table_name, BenchmarkSpec, ReducerSqlCountConfig, SqlBuilder};
37
use serde_json::Value;
48
use std::time;
@@ -10,11 +14,7 @@ pub fn spec() -> BenchmarkSpec {
1014
let casing = casing_for_lang(lang);
1115
let sb = SqlBuilder::new(casing);
1216
let user_table = table_name("user", lang);
13-
let seed = sb.insert_values(
14-
&user_table,
15-
&["id", "name", "age", "active"],
16-
&["1", "'Alice'", "30", "true"],
17-
);
17+
let seed = sb.insert_values(&user_table, &["id","name","age","active"], &["1","'Alice'","30","true"]);
1818
let count = sb.count_by_id(&user_table, "id", 1);
1919
let reducer_name = ident("DeleteUser", crate::eval::Casing::Snake);
2020

@@ -27,19 +27,16 @@ pub fn spec() -> BenchmarkSpec {
2727
time::Duration::from_secs(10),
2828
));
2929

30-
v.push(make_reducer_sql_count_scorer(
31-
host_url,
32-
ReducerSqlCountConfig {
33-
src_file: file!(),
34-
route_tag,
35-
reducer: reducer_name.into(),
36-
args: vec![Value::from(1)],
37-
sql_count_query: count.clone(),
38-
expected_count: 0,
39-
id_str: "delete_user_count_zero",
40-
timeout: time::Duration::from_secs(10),
41-
},
42-
));
30+
v.push(make_reducer_sql_count_scorer(host_url, ReducerSqlCountConfig {
31+
src_file: file!(),
32+
route_tag,
33+
reducer: reducer_name.into(),
34+
args: vec![Value::from(1)],
35+
sql_count_query: count.clone(),
36+
expected_count: 0,
37+
id_str: "delete_user_count_zero",
38+
timeout: time::Duration::from_secs(10),
39+
}));
4340

4441
v
4542
})
Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
use crate::eval::defaults::{
2-
default_schema_parity_scorers, make_reducer_data_parity_scorer, make_sql_count_only_scorer,
3-
};
1+
use crate::eval::defaults::{default_schema_parity_scorers, make_reducer_data_parity_scorer, make_sql_count_only_scorer};
42
use crate::eval::{casing_for_lang, ident, table_name, BenchmarkSpec, ReducerDataParityConfig, SqlBuilder};
53
use std::time::Duration;
64

@@ -13,42 +11,27 @@ pub fn spec() -> BenchmarkSpec {
1311
let reducer = ident("Crud", crate::eval::Casing::Snake);
1412
let user_table = table_name("user", lang);
1513

16-
let select_id1 = sb.select_by_id(&user_table, &["id", "name", "age", "active"], "id", 1);
17-
let count_id2 = sb.count_by_id(&user_table, "id", 2);
18-
let count_all = format!("SELECT COUNT(*) AS n FROM {user_table}");
14+
let select_id1 = sb.select_by_id(&user_table, &["id","name","age","active"], "id", 1);
15+
let count_id2 = sb.count_by_id(&user_table, "id", 2);
16+
let count_all = format!("SELECT COUNT(*) AS n FROM {user_table}");
1917

20-
v.push(make_reducer_data_parity_scorer(
21-
host_url,
22-
ReducerDataParityConfig {
23-
src_file: file!(),
24-
route_tag,
25-
reducer: reducer.into(),
26-
args: vec![],
27-
select_query: select_id1.clone(),
28-
id_str: "crud_row_id1_parity",
29-
collapse_ws: true,
30-
timeout: Duration::from_secs(10),
31-
},
32-
));
33-
v.push(make_sql_count_only_scorer(
34-
host_url,
35-
file!(),
18+
v.push(make_reducer_data_parity_scorer(host_url, ReducerDataParityConfig {
19+
src_file: file!(),
3620
route_tag,
37-
&count_id2,
38-
0,
39-
"crud_row_id2_deleted",
40-
Duration::from_secs(10),
21+
reducer: reducer.into(),
22+
args: vec![],
23+
select_query: select_id1.clone(),
24+
id_str: "crud_row_id1_parity",
25+
collapse_ws: true,
26+
timeout: Duration::from_secs(10),
27+
}));
28+
v.push(make_sql_count_only_scorer(
29+
host_url, file!(), route_tag, &count_id2, 0, "crud_row_id2_deleted", Duration::from_secs(10),
4130
));
4231
v.push(make_sql_count_only_scorer(
43-
host_url,
44-
file!(),
45-
route_tag,
46-
count_all,
47-
1,
48-
"crud_total_count_one",
49-
Duration::from_secs(10),
32+
host_url, file!(), route_tag, count_all, 1, "crud_total_count_one", Duration::from_secs(10),
5033
));
5134

5235
v
5336
})
54-
}
37+
}

tools/xtask-llm-benchmark/src/benchmarks/basics/t_008_index_lookup/spec.rs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use crate::eval::defaults::{
2-
default_schema_parity_scorers, make_reducer_data_parity_scorer, make_sql_exec_both_scorer,
2+
default_schema_parity_scorers,
3+
make_reducer_data_parity_scorer,
4+
make_sql_exec_both_scorer,
35
};
46
use crate::eval::{casing_for_lang, ident, table_name, BenchmarkSpec, ReducerDataParityConfig, SqlBuilder};
57
use serde_json::Value;
@@ -18,8 +20,8 @@ pub fn spec() -> BenchmarkSpec {
1820
// Seed a user row in both DBs so the lookup has something to find
1921
let seed_users = sb.insert_values(
2022
&user_table,
21-
&["id", "name", "age", "active"],
22-
&["1", "'Alice'", "30", "true"],
23+
&["id","name","age","active"],
24+
&["1","'Alice'","30","true"],
2325
);
2426

2527
v.push(make_sql_exec_both_scorer(
@@ -32,21 +34,23 @@ pub fn spec() -> BenchmarkSpec {
3234
));
3335

3436
// After calling the reducer, the projection should be present in results
35-
let select_result = sb.select_by_id(&result_table, &["id", "name"], "id", 1);
37+
let select_result = sb.select_by_id(
38+
&result_table,
39+
&["id","name"],
40+
"id",
41+
1,
42+
);
3643

37-
v.push(make_reducer_data_parity_scorer(
38-
host_url,
39-
ReducerDataParityConfig {
40-
src_file: file!(),
41-
route_tag,
42-
reducer: reducer_name.into(),
43-
args: vec![Value::from(1)],
44-
select_query: select_result.clone(),
45-
id_str: "index_lookup_projection_parity",
46-
collapse_ws: true,
47-
timeout: Duration::from_secs(10),
48-
},
49-
));
44+
v.push(make_reducer_data_parity_scorer(host_url, ReducerDataParityConfig {
45+
src_file: file!(),
46+
route_tag,
47+
reducer: reducer_name.into(),
48+
args: vec![Value::from(1)],
49+
select_query: select_result.clone(),
50+
id_str: "index_lookup_projection_parity",
51+
collapse_ws: true,
52+
timeout: Duration::from_secs(10),
53+
}));
5054

5155
v
5256
})

0 commit comments

Comments
 (0)