From b293d4c9990b33bb67602be45645690d80ea9d47 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 12 Feb 2026 10:03:38 -0800 Subject: [PATCH 01/11] [bfops/fix-double-runs]: CI - Fix smoketests running twice --- crates/smoketests/tests/mod.rs | 35 ---------------------------------- 1 file changed, 35 deletions(-) diff --git a/crates/smoketests/tests/mod.rs b/crates/smoketests/tests/mod.rs index 358436c0ea1..4f773726a20 100644 --- a/crates/smoketests/tests/mod.rs +++ b/crates/smoketests/tests/mod.rs @@ -1,36 +1 @@ -// All smoketest modules -pub mod add_remove_index; -pub mod auto_inc; -pub mod auto_migration; -pub mod call; pub mod cli; -pub mod client_connection_errors; -pub mod confirmed_reads; -pub mod connect_disconnect_from_cli; -pub mod create_project; -pub mod csharp_module; -pub mod default_module_clippy; -pub mod delete_database; -pub mod describe; -pub mod detect_wasm_bindgen; -pub mod dml; -pub mod domains; -pub mod energy; -pub mod fail_initial_publish; -pub mod filtering; -pub mod http_egress; -pub mod module_nested_op; -pub mod modules; -pub mod namespaces; -pub mod new_user_flow; -pub mod panic; -pub mod permissions; -pub mod pg_wire; -pub mod quickstart; -pub mod restart; -pub mod rls; -pub mod schedule_reducer; -pub mod servers; -pub mod sql; -pub mod timestamp_route; -pub mod views; From e9c4aac9f6e2af5ce02c52c00bce96b335a1235e Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Mon, 16 Feb 2026 09:56:24 -0800 Subject: [PATCH 02/11] [bfops/fix-double-runs]: revert --- crates/smoketests/tests/mod.rs | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/crates/smoketests/tests/mod.rs b/crates/smoketests/tests/mod.rs index 4f773726a20..358436c0ea1 100644 --- a/crates/smoketests/tests/mod.rs +++ b/crates/smoketests/tests/mod.rs @@ -1 +1,36 @@ +// All smoketest modules +pub mod add_remove_index; +pub mod auto_inc; +pub mod auto_migration; +pub mod call; pub mod cli; +pub mod client_connection_errors; +pub mod confirmed_reads; +pub mod connect_disconnect_from_cli; +pub mod create_project; +pub mod csharp_module; +pub mod default_module_clippy; +pub mod delete_database; +pub mod describe; +pub mod detect_wasm_bindgen; +pub mod dml; +pub mod domains; +pub mod energy; +pub mod fail_initial_publish; +pub mod filtering; +pub mod http_egress; +pub mod module_nested_op; +pub mod modules; +pub mod namespaces; +pub mod new_user_flow; +pub mod panic; +pub mod permissions; +pub mod pg_wire; +pub mod quickstart; +pub mod restart; +pub mod rls; +pub mod schedule_reducer; +pub mod servers; +pub mod sql; +pub mod timestamp_route; +pub mod views; From 6833d05198bf6d0e9cbb214c0b7de20ec372f08e Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Mon, 16 Feb 2026 09:56:31 -0800 Subject: [PATCH 03/11] [bfops/fix-double-runs]: Revert "Smoketests - Collapse one directory level (#4184)" This reverts commit eb2997e69b97d0043c0e965c05d961043557e090. --- crates/smoketests/tests/integration.rs | 2 ++ crates/smoketests/tests/{ => smoketests}/add_remove_index.rs | 0 crates/smoketests/tests/{ => smoketests}/auto_inc.rs | 0 crates/smoketests/tests/{ => smoketests}/auto_migration.rs | 0 crates/smoketests/tests/{ => smoketests}/call.rs | 0 crates/smoketests/tests/{ => smoketests}/cli/dev.rs | 0 crates/smoketests/tests/{ => smoketests}/cli/mod.rs | 0 crates/smoketests/tests/{ => smoketests}/cli/publish.rs | 0 crates/smoketests/tests/{ => smoketests}/cli/server.rs | 0 .../tests/{ => smoketests}/client_connection_errors.rs | 0 crates/smoketests/tests/{ => smoketests}/confirmed_reads.rs | 0 .../tests/{ => smoketests}/connect_disconnect_from_cli.rs | 0 crates/smoketests/tests/{ => smoketests}/create_project.rs | 0 crates/smoketests/tests/{ => smoketests}/csharp_module.rs | 0 .../tests/{ => smoketests}/default_module_clippy.rs | 0 crates/smoketests/tests/{ => smoketests}/delete_database.rs | 0 crates/smoketests/tests/{ => smoketests}/describe.rs | 0 .../smoketests/tests/{ => smoketests}/detect_wasm_bindgen.rs | 0 crates/smoketests/tests/{ => smoketests}/dml.rs | 0 crates/smoketests/tests/{ => smoketests}/domains.rs | 0 crates/smoketests/tests/{ => smoketests}/energy.rs | 0 .../smoketests/tests/{ => smoketests}/fail_initial_publish.rs | 0 crates/smoketests/tests/{ => smoketests}/filtering.rs | 0 crates/smoketests/tests/{ => smoketests}/mod.rs | 0 crates/smoketests/tests/{ => smoketests}/module_nested_op.rs | 0 crates/smoketests/tests/{ => smoketests}/modules.rs | 0 crates/smoketests/tests/{ => smoketests}/namespaces.rs | 0 crates/smoketests/tests/{ => smoketests}/new_user_flow.rs | 0 crates/smoketests/tests/{ => smoketests}/panic.rs | 0 crates/smoketests/tests/{ => smoketests}/permissions.rs | 0 crates/smoketests/tests/{ => smoketests}/pg_wire.rs | 0 crates/smoketests/tests/{ => smoketests}/quickstart.rs | 0 crates/smoketests/tests/{ => smoketests}/restart.rs | 0 crates/smoketests/tests/{ => smoketests}/rls.rs | 0 crates/smoketests/tests/{ => smoketests}/schedule_reducer.rs | 0 crates/smoketests/tests/{ => smoketests}/servers.rs | 0 crates/smoketests/tests/{ => smoketests}/sql.rs | 0 crates/smoketests/tests/{ => smoketests}/timestamp_route.rs | 0 crates/smoketests/tests/{ => smoketests}/views.rs | 4 ++-- 39 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 crates/smoketests/tests/integration.rs rename crates/smoketests/tests/{ => smoketests}/add_remove_index.rs (100%) rename crates/smoketests/tests/{ => smoketests}/auto_inc.rs (100%) rename crates/smoketests/tests/{ => smoketests}/auto_migration.rs (100%) rename crates/smoketests/tests/{ => smoketests}/call.rs (100%) rename crates/smoketests/tests/{ => smoketests}/cli/dev.rs (100%) rename crates/smoketests/tests/{ => smoketests}/cli/mod.rs (100%) rename crates/smoketests/tests/{ => smoketests}/cli/publish.rs (100%) rename crates/smoketests/tests/{ => smoketests}/cli/server.rs (100%) rename crates/smoketests/tests/{ => smoketests}/client_connection_errors.rs (100%) rename crates/smoketests/tests/{ => smoketests}/confirmed_reads.rs (100%) rename crates/smoketests/tests/{ => smoketests}/connect_disconnect_from_cli.rs (100%) rename crates/smoketests/tests/{ => smoketests}/create_project.rs (100%) rename crates/smoketests/tests/{ => smoketests}/csharp_module.rs (100%) rename crates/smoketests/tests/{ => smoketests}/default_module_clippy.rs (100%) rename crates/smoketests/tests/{ => smoketests}/delete_database.rs (100%) rename crates/smoketests/tests/{ => smoketests}/describe.rs (100%) rename crates/smoketests/tests/{ => smoketests}/detect_wasm_bindgen.rs (100%) rename crates/smoketests/tests/{ => smoketests}/dml.rs (100%) rename crates/smoketests/tests/{ => smoketests}/domains.rs (100%) rename crates/smoketests/tests/{ => smoketests}/energy.rs (100%) rename crates/smoketests/tests/{ => smoketests}/fail_initial_publish.rs (100%) rename crates/smoketests/tests/{ => smoketests}/filtering.rs (100%) rename crates/smoketests/tests/{ => smoketests}/mod.rs (100%) rename crates/smoketests/tests/{ => smoketests}/module_nested_op.rs (100%) rename crates/smoketests/tests/{ => smoketests}/modules.rs (100%) rename crates/smoketests/tests/{ => smoketests}/namespaces.rs (100%) rename crates/smoketests/tests/{ => smoketests}/new_user_flow.rs (100%) rename crates/smoketests/tests/{ => smoketests}/panic.rs (100%) rename crates/smoketests/tests/{ => smoketests}/permissions.rs (100%) rename crates/smoketests/tests/{ => smoketests}/pg_wire.rs (100%) rename crates/smoketests/tests/{ => smoketests}/quickstart.rs (100%) rename crates/smoketests/tests/{ => smoketests}/restart.rs (100%) rename crates/smoketests/tests/{ => smoketests}/rls.rs (100%) rename crates/smoketests/tests/{ => smoketests}/schedule_reducer.rs (100%) rename crates/smoketests/tests/{ => smoketests}/servers.rs (100%) rename crates/smoketests/tests/{ => smoketests}/sql.rs (100%) rename crates/smoketests/tests/{ => smoketests}/timestamp_route.rs (100%) rename crates/smoketests/tests/{ => smoketests}/views.rs (98%) diff --git a/crates/smoketests/tests/integration.rs b/crates/smoketests/tests/integration.rs new file mode 100644 index 00000000000..dd50b65bb8b --- /dev/null +++ b/crates/smoketests/tests/integration.rs @@ -0,0 +1,2 @@ +// Single test binary entry point - includes all smoketests +mod smoketests; diff --git a/crates/smoketests/tests/add_remove_index.rs b/crates/smoketests/tests/smoketests/add_remove_index.rs similarity index 100% rename from crates/smoketests/tests/add_remove_index.rs rename to crates/smoketests/tests/smoketests/add_remove_index.rs diff --git a/crates/smoketests/tests/auto_inc.rs b/crates/smoketests/tests/smoketests/auto_inc.rs similarity index 100% rename from crates/smoketests/tests/auto_inc.rs rename to crates/smoketests/tests/smoketests/auto_inc.rs diff --git a/crates/smoketests/tests/auto_migration.rs b/crates/smoketests/tests/smoketests/auto_migration.rs similarity index 100% rename from crates/smoketests/tests/auto_migration.rs rename to crates/smoketests/tests/smoketests/auto_migration.rs diff --git a/crates/smoketests/tests/call.rs b/crates/smoketests/tests/smoketests/call.rs similarity index 100% rename from crates/smoketests/tests/call.rs rename to crates/smoketests/tests/smoketests/call.rs diff --git a/crates/smoketests/tests/cli/dev.rs b/crates/smoketests/tests/smoketests/cli/dev.rs similarity index 100% rename from crates/smoketests/tests/cli/dev.rs rename to crates/smoketests/tests/smoketests/cli/dev.rs diff --git a/crates/smoketests/tests/cli/mod.rs b/crates/smoketests/tests/smoketests/cli/mod.rs similarity index 100% rename from crates/smoketests/tests/cli/mod.rs rename to crates/smoketests/tests/smoketests/cli/mod.rs diff --git a/crates/smoketests/tests/cli/publish.rs b/crates/smoketests/tests/smoketests/cli/publish.rs similarity index 100% rename from crates/smoketests/tests/cli/publish.rs rename to crates/smoketests/tests/smoketests/cli/publish.rs diff --git a/crates/smoketests/tests/cli/server.rs b/crates/smoketests/tests/smoketests/cli/server.rs similarity index 100% rename from crates/smoketests/tests/cli/server.rs rename to crates/smoketests/tests/smoketests/cli/server.rs diff --git a/crates/smoketests/tests/client_connection_errors.rs b/crates/smoketests/tests/smoketests/client_connection_errors.rs similarity index 100% rename from crates/smoketests/tests/client_connection_errors.rs rename to crates/smoketests/tests/smoketests/client_connection_errors.rs diff --git a/crates/smoketests/tests/confirmed_reads.rs b/crates/smoketests/tests/smoketests/confirmed_reads.rs similarity index 100% rename from crates/smoketests/tests/confirmed_reads.rs rename to crates/smoketests/tests/smoketests/confirmed_reads.rs diff --git a/crates/smoketests/tests/connect_disconnect_from_cli.rs b/crates/smoketests/tests/smoketests/connect_disconnect_from_cli.rs similarity index 100% rename from crates/smoketests/tests/connect_disconnect_from_cli.rs rename to crates/smoketests/tests/smoketests/connect_disconnect_from_cli.rs diff --git a/crates/smoketests/tests/create_project.rs b/crates/smoketests/tests/smoketests/create_project.rs similarity index 100% rename from crates/smoketests/tests/create_project.rs rename to crates/smoketests/tests/smoketests/create_project.rs diff --git a/crates/smoketests/tests/csharp_module.rs b/crates/smoketests/tests/smoketests/csharp_module.rs similarity index 100% rename from crates/smoketests/tests/csharp_module.rs rename to crates/smoketests/tests/smoketests/csharp_module.rs diff --git a/crates/smoketests/tests/default_module_clippy.rs b/crates/smoketests/tests/smoketests/default_module_clippy.rs similarity index 100% rename from crates/smoketests/tests/default_module_clippy.rs rename to crates/smoketests/tests/smoketests/default_module_clippy.rs diff --git a/crates/smoketests/tests/delete_database.rs b/crates/smoketests/tests/smoketests/delete_database.rs similarity index 100% rename from crates/smoketests/tests/delete_database.rs rename to crates/smoketests/tests/smoketests/delete_database.rs diff --git a/crates/smoketests/tests/describe.rs b/crates/smoketests/tests/smoketests/describe.rs similarity index 100% rename from crates/smoketests/tests/describe.rs rename to crates/smoketests/tests/smoketests/describe.rs diff --git a/crates/smoketests/tests/detect_wasm_bindgen.rs b/crates/smoketests/tests/smoketests/detect_wasm_bindgen.rs similarity index 100% rename from crates/smoketests/tests/detect_wasm_bindgen.rs rename to crates/smoketests/tests/smoketests/detect_wasm_bindgen.rs diff --git a/crates/smoketests/tests/dml.rs b/crates/smoketests/tests/smoketests/dml.rs similarity index 100% rename from crates/smoketests/tests/dml.rs rename to crates/smoketests/tests/smoketests/dml.rs diff --git a/crates/smoketests/tests/domains.rs b/crates/smoketests/tests/smoketests/domains.rs similarity index 100% rename from crates/smoketests/tests/domains.rs rename to crates/smoketests/tests/smoketests/domains.rs diff --git a/crates/smoketests/tests/energy.rs b/crates/smoketests/tests/smoketests/energy.rs similarity index 100% rename from crates/smoketests/tests/energy.rs rename to crates/smoketests/tests/smoketests/energy.rs diff --git a/crates/smoketests/tests/fail_initial_publish.rs b/crates/smoketests/tests/smoketests/fail_initial_publish.rs similarity index 100% rename from crates/smoketests/tests/fail_initial_publish.rs rename to crates/smoketests/tests/smoketests/fail_initial_publish.rs diff --git a/crates/smoketests/tests/filtering.rs b/crates/smoketests/tests/smoketests/filtering.rs similarity index 100% rename from crates/smoketests/tests/filtering.rs rename to crates/smoketests/tests/smoketests/filtering.rs diff --git a/crates/smoketests/tests/mod.rs b/crates/smoketests/tests/smoketests/mod.rs similarity index 100% rename from crates/smoketests/tests/mod.rs rename to crates/smoketests/tests/smoketests/mod.rs diff --git a/crates/smoketests/tests/module_nested_op.rs b/crates/smoketests/tests/smoketests/module_nested_op.rs similarity index 100% rename from crates/smoketests/tests/module_nested_op.rs rename to crates/smoketests/tests/smoketests/module_nested_op.rs diff --git a/crates/smoketests/tests/modules.rs b/crates/smoketests/tests/smoketests/modules.rs similarity index 100% rename from crates/smoketests/tests/modules.rs rename to crates/smoketests/tests/smoketests/modules.rs diff --git a/crates/smoketests/tests/namespaces.rs b/crates/smoketests/tests/smoketests/namespaces.rs similarity index 100% rename from crates/smoketests/tests/namespaces.rs rename to crates/smoketests/tests/smoketests/namespaces.rs diff --git a/crates/smoketests/tests/new_user_flow.rs b/crates/smoketests/tests/smoketests/new_user_flow.rs similarity index 100% rename from crates/smoketests/tests/new_user_flow.rs rename to crates/smoketests/tests/smoketests/new_user_flow.rs diff --git a/crates/smoketests/tests/panic.rs b/crates/smoketests/tests/smoketests/panic.rs similarity index 100% rename from crates/smoketests/tests/panic.rs rename to crates/smoketests/tests/smoketests/panic.rs diff --git a/crates/smoketests/tests/permissions.rs b/crates/smoketests/tests/smoketests/permissions.rs similarity index 100% rename from crates/smoketests/tests/permissions.rs rename to crates/smoketests/tests/smoketests/permissions.rs diff --git a/crates/smoketests/tests/pg_wire.rs b/crates/smoketests/tests/smoketests/pg_wire.rs similarity index 100% rename from crates/smoketests/tests/pg_wire.rs rename to crates/smoketests/tests/smoketests/pg_wire.rs diff --git a/crates/smoketests/tests/quickstart.rs b/crates/smoketests/tests/smoketests/quickstart.rs similarity index 100% rename from crates/smoketests/tests/quickstart.rs rename to crates/smoketests/tests/smoketests/quickstart.rs diff --git a/crates/smoketests/tests/restart.rs b/crates/smoketests/tests/smoketests/restart.rs similarity index 100% rename from crates/smoketests/tests/restart.rs rename to crates/smoketests/tests/smoketests/restart.rs diff --git a/crates/smoketests/tests/rls.rs b/crates/smoketests/tests/smoketests/rls.rs similarity index 100% rename from crates/smoketests/tests/rls.rs rename to crates/smoketests/tests/smoketests/rls.rs diff --git a/crates/smoketests/tests/schedule_reducer.rs b/crates/smoketests/tests/smoketests/schedule_reducer.rs similarity index 100% rename from crates/smoketests/tests/schedule_reducer.rs rename to crates/smoketests/tests/smoketests/schedule_reducer.rs diff --git a/crates/smoketests/tests/servers.rs b/crates/smoketests/tests/smoketests/servers.rs similarity index 100% rename from crates/smoketests/tests/servers.rs rename to crates/smoketests/tests/smoketests/servers.rs diff --git a/crates/smoketests/tests/sql.rs b/crates/smoketests/tests/smoketests/sql.rs similarity index 100% rename from crates/smoketests/tests/sql.rs rename to crates/smoketests/tests/smoketests/sql.rs diff --git a/crates/smoketests/tests/timestamp_route.rs b/crates/smoketests/tests/smoketests/timestamp_route.rs similarity index 100% rename from crates/smoketests/tests/timestamp_route.rs rename to crates/smoketests/tests/smoketests/timestamp_route.rs diff --git a/crates/smoketests/tests/views.rs b/crates/smoketests/tests/smoketests/views.rs similarity index 98% rename from crates/smoketests/tests/views.rs rename to crates/smoketests/tests/smoketests/views.rs index 2d5f43917a0..29930d0c209 100644 --- a/crates/smoketests/tests/views.rs +++ b/crates/smoketests/tests/smoketests/views.rs @@ -27,7 +27,7 @@ fn test_st_view_tables() { fn test_fail_publish_namespace_collision() { let mut test = Smoketest::builder() // Can't be precompiled because the code is intentionally broken - .module_code(include_str!("../modules/views-broken-namespace/src/lib.rs")) + .module_code(include_str!("../../modules/views-broken-namespace/src/lib.rs")) .autopublish(false) .build(); @@ -43,7 +43,7 @@ fn test_fail_publish_namespace_collision() { fn test_fail_publish_wrong_return_type() { let mut test = Smoketest::builder() // Can't be precompiled because the code is intentionally broken - .module_code(include_str!("../modules/views-broken-return-type/src/lib.rs")) + .module_code(include_str!("../../modules/views-broken-return-type/src/lib.rs")) .autopublish(false) .build(); From e544ed471dc0ba57ec9905ffe046adbf0cc5bd80 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Mon, 16 Feb 2026 09:59:05 -0800 Subject: [PATCH 04/11] [bfops/fix-double-runs]: updates --- .../tests/{ => smoketests}/http_egress.rs | 0 .../tests/{ => smoketests}/integration.rs | 0 crates/smoketests/tests/smoketests/mod.rs | 72 ++++++++++--------- .../publish_upgrade_prompt.rs | 0 4 files changed, 37 insertions(+), 35 deletions(-) rename crates/smoketests/tests/{ => smoketests}/http_egress.rs (100%) rename crates/smoketests/tests/{ => smoketests}/integration.rs (100%) rename crates/smoketests/tests/{ => smoketests}/publish_upgrade_prompt.rs (100%) diff --git a/crates/smoketests/tests/http_egress.rs b/crates/smoketests/tests/smoketests/http_egress.rs similarity index 100% rename from crates/smoketests/tests/http_egress.rs rename to crates/smoketests/tests/smoketests/http_egress.rs diff --git a/crates/smoketests/tests/integration.rs b/crates/smoketests/tests/smoketests/integration.rs similarity index 100% rename from crates/smoketests/tests/integration.rs rename to crates/smoketests/tests/smoketests/integration.rs diff --git a/crates/smoketests/tests/smoketests/mod.rs b/crates/smoketests/tests/smoketests/mod.rs index 358436c0ea1..9df387f83ff 100644 --- a/crates/smoketests/tests/smoketests/mod.rs +++ b/crates/smoketests/tests/smoketests/mod.rs @@ -1,36 +1,38 @@ // All smoketest modules -pub mod add_remove_index; -pub mod auto_inc; -pub mod auto_migration; -pub mod call; -pub mod cli; -pub mod client_connection_errors; -pub mod confirmed_reads; -pub mod connect_disconnect_from_cli; -pub mod create_project; -pub mod csharp_module; -pub mod default_module_clippy; -pub mod delete_database; -pub mod describe; -pub mod detect_wasm_bindgen; -pub mod dml; -pub mod domains; -pub mod energy; -pub mod fail_initial_publish; -pub mod filtering; -pub mod http_egress; -pub mod module_nested_op; -pub mod modules; -pub mod namespaces; -pub mod new_user_flow; -pub mod panic; -pub mod permissions; -pub mod pg_wire; -pub mod quickstart; -pub mod restart; -pub mod rls; -pub mod schedule_reducer; -pub mod servers; -pub mod sql; -pub mod timestamp_route; -pub mod views; +mod add_remove_index; +mod auto_inc; +mod auto_migration; +mod call; +mod cli; +mod client_connection_errors; +mod confirmed_reads; +mod connect_disconnect_from_cli; +mod create_project; +mod csharp_module; +mod default_module_clippy; +mod delete_database; +mod describe; +mod detect_wasm_bindgen; +mod dml; +mod domains; +mod energy; +mod fail_initial_publish; +mod filtering; +mod http_egress; +mod integration; +mod module_nested_op; +mod modules; +mod namespaces; +mod new_user_flow; +mod panic; +mod permissions; +mod pg_wire; +mod publish_upgrade_prompt; +mod quickstart; +mod restart; +mod rls; +mod schedule_reducer; +mod servers; +mod sql; +mod timestamp_route; +mod views; diff --git a/crates/smoketests/tests/publish_upgrade_prompt.rs b/crates/smoketests/tests/smoketests/publish_upgrade_prompt.rs similarity index 100% rename from crates/smoketests/tests/publish_upgrade_prompt.rs rename to crates/smoketests/tests/smoketests/publish_upgrade_prompt.rs From 145e7507e4cb1dd5ae479f413ef13b7fe15d6ef9 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 18 Feb 2026 11:31:34 -0800 Subject: [PATCH 05/11] [bfops/fix-double-runs]: fix --- crates/smoketests/modules/Cargo.lock | 47 ++++++++++++++++--- .../tests/{smoketests => }/integration.rs | 0 crates/smoketests/tests/smoketests/mod.rs | 1 - 3 files changed, 40 insertions(+), 8 deletions(-) rename crates/smoketests/tests/{smoketests => }/integration.rs (100%) diff --git a/crates/smoketests/modules/Cargo.lock b/crates/smoketests/modules/Cargo.lock index 7034774a56f..95d9b7faa99 100644 --- a/crates/smoketests/modules/Cargo.lock +++ b/crates/smoketests/modules/Cargo.lock @@ -76,6 +76,15 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" +[[package]] +name = "castaway" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" +dependencies = [ + "rustversion", +] + [[package]] name = "cc" version = "1.2.54" @@ -289,6 +298,17 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "lean_string" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "962df00ba70ac8d5ca5c064e17e5c3d090c087fd8d21aa45096c716b169da514" +dependencies = [ + "castaway", + "itoa", + "ryu", +] + [[package]] name = "libc" version = "0.2.180" @@ -429,6 +449,18 @@ dependencies = [ "semver", ] +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + [[package]] name = "scoped-tls" version = "1.0.1" @@ -892,7 +924,7 @@ dependencies = [ [[package]] name = "spacetimedb" -version = "1.12.0" +version = "2.0.0" dependencies = [ "anyhow", "bytemuck", @@ -913,7 +945,7 @@ dependencies = [ [[package]] name = "spacetimedb-bindings-macro" -version = "1.12.0" +version = "2.0.0" dependencies = [ "heck 0.4.1", "humantime", @@ -925,14 +957,14 @@ dependencies = [ [[package]] name = "spacetimedb-bindings-sys" -version = "1.12.0" +version = "2.0.0" dependencies = [ "spacetimedb-primitives", ] [[package]] name = "spacetimedb-lib" -version = "1.12.0" +version = "2.0.0" dependencies = [ "anyhow", "bitflags", @@ -951,7 +983,7 @@ dependencies = [ [[package]] name = "spacetimedb-primitives" -version = "1.12.0" +version = "2.0.0" dependencies = [ "bitflags", "either", @@ -962,14 +994,14 @@ dependencies = [ [[package]] name = "spacetimedb-query-builder" -version = "1.12.0" +version = "2.0.0" dependencies = [ "spacetimedb-lib", ] [[package]] name = "spacetimedb-sats" -version = "1.12.0" +version = "2.0.0" dependencies = [ "anyhow", "arrayvec", @@ -983,6 +1015,7 @@ dependencies = [ "ethnum", "hex", "itertools", + "lean_string", "rand 0.9.2", "second-stack", "sha3", diff --git a/crates/smoketests/tests/smoketests/integration.rs b/crates/smoketests/tests/integration.rs similarity index 100% rename from crates/smoketests/tests/smoketests/integration.rs rename to crates/smoketests/tests/integration.rs diff --git a/crates/smoketests/tests/smoketests/mod.rs b/crates/smoketests/tests/smoketests/mod.rs index 9df387f83ff..ab815c5fa4b 100644 --- a/crates/smoketests/tests/smoketests/mod.rs +++ b/crates/smoketests/tests/smoketests/mod.rs @@ -19,7 +19,6 @@ mod energy; mod fail_initial_publish; mod filtering; mod http_egress; -mod integration; mod module_nested_op; mod modules; mod namespaces; From e04c013ac4f9860347cab12f9be8cc968561e21a Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 18 Feb 2026 11:32:09 -0800 Subject: [PATCH 06/11] [bfops/fix-double-runs]: WIP --- .github/workflows/ci.yml | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91471ce634e..f70cc0d95ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,64 @@ concurrency: cancel-in-progress: true jobs: + smoketests_mod_rs_complete: + name: Check smoketests/mod.rs is complete + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Verify crates/smoketests/tests/smoketests/mod.rs lists all entries + shell: bash + run: | + python3 - <<'PY' + import pathlib + import sys + + repo_root = pathlib.Path('.').resolve() + directory = repo_root / 'crates/smoketests/tests/smoketests' + mod_rs = directory / 'mod.rs' + + if not directory.is_dir(): + print(f"Error: directory not found: {directory}") + sys.exit(1) + + if not mod_rs.is_file(): + print(f"Error: mod.rs not found: {mod_rs}") + sys.exit(1) + + mod_rs_text = mod_rs.read_text(encoding='utf-8', errors='strict') + + expected = set() + for child in directory.iterdir(): + name = child.name + if name == 'mod.rs': + continue + if name.startswith('.'): + continue + + if child.is_dir(): + expected.add(child.name) + continue + + if child.is_file() and child.suffix == '.rs': + expected.add(child.stem) + continue + + missing = [] + for m in sorted(expected): + if f"mod {m};" not in mod_rs_text: + missing.append(m) + + if missing: + print('Error: crates/smoketests/tests/smoketests/mod.rs is missing these entries:') + for m in missing: + print(f"- mod {m};") + sys.exit(1) + + print('OK: crates/smoketests/tests/smoketests/mod.rs lists all entries.') + PY + smoketests: needs: [lints] name: Smoketests (${{ matrix.name }}) From 8201521a632f3e285611bf9d0d3effc2b12e4870 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 18 Feb 2026 14:15:11 -0800 Subject: [PATCH 07/11] [bfops/fix-double-runs]: CI check --- .github/workflows/ci.yml | 112 ++++++++++++++++++-------------------- tools/ci/src/main.rs | 10 +--- tools/ci/src/smoketest.rs | 78 +++++++++++++++++++++++++- tools/ci/src/util.rs | 16 ++++++ 4 files changed, 149 insertions(+), 67 deletions(-) create mode 100644 tools/ci/src/util.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f70cc0d95ed..e02317f9044 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,64 +18,6 @@ concurrency: cancel-in-progress: true jobs: - smoketests_mod_rs_complete: - name: Check smoketests/mod.rs is complete - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Verify crates/smoketests/tests/smoketests/mod.rs lists all entries - shell: bash - run: | - python3 - <<'PY' - import pathlib - import sys - - repo_root = pathlib.Path('.').resolve() - directory = repo_root / 'crates/smoketests/tests/smoketests' - mod_rs = directory / 'mod.rs' - - if not directory.is_dir(): - print(f"Error: directory not found: {directory}") - sys.exit(1) - - if not mod_rs.is_file(): - print(f"Error: mod.rs not found: {mod_rs}") - sys.exit(1) - - mod_rs_text = mod_rs.read_text(encoding='utf-8', errors='strict') - - expected = set() - for child in directory.iterdir(): - name = child.name - if name == 'mod.rs': - continue - if name.startswith('.'): - continue - - if child.is_dir(): - expected.add(child.name) - continue - - if child.is_file() and child.suffix == '.rs': - expected.add(child.stem) - continue - - missing = [] - for m in sorted(expected): - if f"mod {m};" not in mod_rs_text: - missing.append(m) - - if missing: - print('Error: crates/smoketests/tests/smoketests/mod.rs is missing these entries:') - for m in missing: - print(f"- mod {m};") - sys.exit(1) - - print('OK: crates/smoketests/tests/smoketests/mod.rs lists all entries.') - PY - smoketests: needs: [lints] name: Smoketests (${{ matrix.name }}) @@ -1230,3 +1172,57 @@ jobs: fi echo "No Python smoketest changes detected." + + smoketests_mod_rs_complete: + name: Check smoketests/mod.rs is complete + runs-on: ubuntu-latest + env: + CARGO_TARGET_DIR: ${{ github.workspace }}/target + steps: + - name: Find Git ref + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + PR_NUMBER="${{ github.event.inputs.pr_number || null }}" + if test -n "${PR_NUMBER}"; then + GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )" + else + GIT_REF="${{ github.ref }}" + fi + echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV" + - name: Checkout sources + uses: actions/checkout@v4 + with: + ref: ${{ env.GIT_REF }} + - uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + with: + workspaces: ${{ github.workspace }} + shared-key: spacetimedb + cache-on-failure: false + cache-all-crates: true + cache-workspace-crates: true + prefix-key: v1 + + # This step shouldn't be needed, but somehow we end up with caches that are missing librusty_v8.a. + # ChatGPT suspects that this could be due to different build invocations using the same target dir, + # and this makes sense to me because we only see it in this job where we mix `cargo build -p` with + # `cargo build --manifest-path` (which apparently build different dependency trees). + # However, we've been unable to fix it so... /shrug + - name: Check v8 outputs + shell: bash + run: | + find "${CARGO_TARGET_DIR}"/ -type f | grep '[/_]v8' || true + if ! [ -f "${CARGO_TARGET_DIR}"/debug/gn_out/obj/librusty_v8.a ]; then + echo "Could not find v8 output file librusty_v8.a; rebuilding manually." + cargo clean -p v8 || true + cargo build -p v8 + fi + + - name: Verify crates/smoketests/tests/smoketests/mod.rs lists all entries + run: | + cargo ci smoketests check-mod-list diff --git a/tools/ci/src/main.rs b/tools/ci/src/main.rs index a108ed9a538..165863d851e 100644 --- a/tools/ci/src/main.rs +++ b/tools/ci/src/main.rs @@ -12,6 +12,9 @@ const README_PATH: &str = "tools/ci/README.md"; mod ci_docs; mod smoketest; +mod util; + +use util::ensure_repo_root; /// SpacetimeDB CI tasks /// @@ -35,13 +38,6 @@ struct Cli { skip: Vec, } -fn ensure_repo_root() -> Result<()> { - if !Path::new("Cargo.toml").exists() { - bail!("You must execute this command from the SpacetimeDB repository root (where Cargo.toml is located)"); - } - Ok(()) -} - fn check_global_json_policy() -> Result<()> { ensure_repo_root()?; diff --git a/tools/ci/src/smoketest.rs b/tools/ci/src/smoketest.rs index 60deac8441d..7be66aff65b 100644 --- a/tools/ci/src/smoketest.rs +++ b/tools/ci/src/smoketest.rs @@ -1,8 +1,13 @@ #![allow(clippy::disallowed_macros)] -use anyhow::{ensure, Result}; +use anyhow::{bail, ensure, Result}; use clap::{Args, Subcommand}; -use std::env; +use duct::cmd; +use std::ffi::OsStr; +use std::path::Path; use std::process::{Command, Stdio}; +use std::{env, fs}; + +use crate::util; #[derive(Args)] /// This command first builds the spacetimedb-cli and spacetimedb-standalone binaries, @@ -35,6 +40,7 @@ enum SmoketestCmd { /// /// Use this before running `cargo test --all` to ensure binaries are built. Prepare, + CheckModList, } pub fn run(args: SmoketestsArgs) -> Result<()> { @@ -44,6 +50,11 @@ pub fn run(args: SmoketestsArgs) -> Result<()> { eprintln!("Binaries ready. You can now run `cargo test --all`."); Ok(()) } + Some(SmoketestCmd::CheckModList) => { + check_smoketests_mod_rs_complete()?; + eprintln!("smoketests/mod.rs is up to date."); + Ok(()) + } None => run_smoketest(args.server, args.dotnet, args.args), } } @@ -177,3 +188,66 @@ fn set_env(cmd: &mut Command, server: Option, dotnet: bool) { } cmd.env("SMOKETESTS_DOTNET", if dotnet { "1" } else { "0" }); } + +fn check_smoketests_mod_rs_complete() -> Result<()> { + util::ensure_repo_root()?; + + let expected_dir = Path::new("crates/smoketests/tests/smoketests"); + let mut expected = std::collections::BTreeSet::::new(); + for entry in fs::read_dir(expected_dir)? { + let entry = entry?; + let path = entry.path(); + let name = entry.file_name(); + let name = name.to_string_lossy(); + if name == "mod.rs" { + continue; + } + if name.starts_with('.') { + continue; + } + + let ft = entry.file_type()?; + if ft.is_dir() { + expected.insert(name.to_string()); + } else if ft.is_file() { + if path.extension() == Some(OsStr::new("rs")) { + if let Some(stem) = path.file_stem() { + expected.insert(stem.to_string_lossy().to_string()); + } + } + } + } + + let out = cmd!("cargo", "test", "-p", "spacetimedb-smoketests", "--", "--list",).read()?; + + let mut present = std::collections::BTreeSet::::new(); + for line in out.lines() { + let line = line.trim(); + let parts: Vec<&str> = line.split("::").collect(); + if parts.len() < 2 { + continue; + } + if parts[0] != "smoketests" { + continue; + } + present.insert(parts[1].to_string()); + } + + let missing = expected + .into_iter() + .filter(|m| !present.contains(m)) + .collect::>(); + + if !missing.is_empty() { + bail!( + "crates/smoketests/tests/smoketests/mod.rs appears incomplete; missing modules (not present in `cargo test -- --list`):\n{}", + missing + .iter() + .map(|m| format!("- mod {m};")) + .collect::>() + .join("\n") + ); + } + + Ok(()) +} diff --git a/tools/ci/src/util.rs b/tools/ci/src/util.rs new file mode 100644 index 00000000000..315e7df3990 --- /dev/null +++ b/tools/ci/src/util.rs @@ -0,0 +1,16 @@ +#![allow(clippy::disallowed_macros)] + +use anyhow::{bail, Result}; +use clap::{CommandFactory, Parser, Subcommand}; +use duct::cmd; +use std::ffi::OsStr; +use std::path::Path; +use std::path::PathBuf; +use std::{env, fs}; + +pub fn ensure_repo_root() -> Result<()> { + if !Path::new("Cargo.toml").exists() { + bail!("You must execute this command from the SpacetimeDB repository root (where Cargo.toml is located)"); + } + Ok(()) +} From 6dbc0036dc8b926edbb45ee07929b38232baf464 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 18 Feb 2026 14:16:37 -0800 Subject: [PATCH 08/11] [bfops/fix-double-runs]: lints --- tools/ci/src/util.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tools/ci/src/util.rs b/tools/ci/src/util.rs index 315e7df3990..ac35a7a465b 100644 --- a/tools/ci/src/util.rs +++ b/tools/ci/src/util.rs @@ -1,12 +1,7 @@ #![allow(clippy::disallowed_macros)] use anyhow::{bail, Result}; -use clap::{CommandFactory, Parser, Subcommand}; -use duct::cmd; -use std::ffi::OsStr; use std::path::Path; -use std::path::PathBuf; -use std::{env, fs}; pub fn ensure_repo_root() -> Result<()> { if !Path::new("Cargo.toml").exists() { From 131c1b44e6ae36583b4c4696a82cb392fd3c270b Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 18 Feb 2026 14:19:52 -0800 Subject: [PATCH 09/11] [bfops/fix-double-runs]: --- crates/bindings/tests/ui/views.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/bindings/tests/ui/views.rs b/crates/bindings/tests/ui/views.rs index 2e2b9320696..23a353b0583 100644 --- a/crates/bindings/tests/ui/views.rs +++ b/crates/bindings/tests/ui/views.rs @@ -144,6 +144,7 @@ fn sched_table_view(_: &ViewContext, _args: ScheduledTable) -> Vec { vec![] } + #[table(accessor = player_info)] struct PlayerInfo { #[unique] From b21bff6792fa2f3ef34cb093e3497adc27635da7 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 18 Feb 2026 14:20:36 -0800 Subject: [PATCH 10/11] [bfops/fix-double-runs]: --- .../add-remove-index-indexed/src/lib.rs | 10 +---- .../modules/add-remove-index/src/lib.rs | 8 +--- .../modules/call-reducer-procedure/src/lib.rs | 4 +- .../modules/delete-database/src/lib.rs | 4 +- .../smoketests/modules/filtering/src/lib.rs | 38 ++++--------------- .../modules/module-nested-op/src/lib.rs | 7 +--- .../modules/new-user-flow/src/lib.rs | 2 +- crates/smoketests/modules/pg-wire/src/lib.rs | 37 ++++++------------ .../modules/schedule-cancel/src/lib.rs | 15 +++----- .../modules/schedule-subscribe/src/lib.rs | 20 ++-------- .../modules/upload-module-2/src/lib.rs | 8 +--- 11 files changed, 41 insertions(+), 112 deletions(-) diff --git a/crates/smoketests/modules/add-remove-index-indexed/src/lib.rs b/crates/smoketests/modules/add-remove-index-indexed/src/lib.rs index 725a8119e23..1993db7fed1 100644 --- a/crates/smoketests/modules/add-remove-index-indexed/src/lib.rs +++ b/crates/smoketests/modules/add-remove-index-indexed/src/lib.rs @@ -1,16 +1,10 @@ use spacetimedb::{ReducerContext, Table}; #[spacetimedb::table(accessor = t1)] -pub struct T1 { - #[index(btree)] - id: u64, -} +pub struct T1 { #[index(btree)] id: u64 } #[spacetimedb::table(accessor = t2)] -pub struct T2 { - #[index(btree)] - id: u64, -} +pub struct T2 { #[index(btree)] id: u64 } #[spacetimedb::reducer(init)] pub fn init(ctx: &ReducerContext) { diff --git a/crates/smoketests/modules/add-remove-index/src/lib.rs b/crates/smoketests/modules/add-remove-index/src/lib.rs index bab951a0728..2e98cbcb190 100644 --- a/crates/smoketests/modules/add-remove-index/src/lib.rs +++ b/crates/smoketests/modules/add-remove-index/src/lib.rs @@ -1,14 +1,10 @@ use spacetimedb::{ReducerContext, Table}; #[spacetimedb::table(accessor = t1)] -pub struct T1 { - id: u64, -} +pub struct T1 { id: u64 } #[spacetimedb::table(accessor = t2)] -pub struct T2 { - id: u64, -} +pub struct T2 { id: u64 } #[spacetimedb::reducer(init)] pub fn init(ctx: &ReducerContext) { diff --git a/crates/smoketests/modules/call-reducer-procedure/src/lib.rs b/crates/smoketests/modules/call-reducer-procedure/src/lib.rs index 5415eb0d3de..09c2c060ef3 100644 --- a/crates/smoketests/modules/call-reducer-procedure/src/lib.rs +++ b/crates/smoketests/modules/call-reducer-procedure/src/lib.rs @@ -12,7 +12,5 @@ pub fn say_hello(_ctx: &ReducerContext) { #[spacetimedb::procedure] pub fn return_person(_ctx: &mut ProcedureContext) -> Person { - return Person { - name: "World".to_owned(), - }; + return Person { name: "World".to_owned() }; } diff --git a/crates/smoketests/modules/delete-database/src/lib.rs b/crates/smoketests/modules/delete-database/src/lib.rs index bf513a42050..85d74acb944 100644 --- a/crates/smoketests/modules/delete-database/src/lib.rs +++ b/crates/smoketests/modules/delete-database/src/lib.rs @@ -1,10 +1,10 @@ -use spacetimedb::{duration, ReducerContext, Table}; +use spacetimedb::{ReducerContext, Table, duration}; #[spacetimedb::table(accessor = counter, public)] pub struct Counter { #[primary_key] id: u64, - val: u64, + val: u64 } #[spacetimedb::table(accessor = scheduled_counter, public, scheduled(inc, at = sched_at))] diff --git a/crates/smoketests/modules/filtering/src/lib.rs b/crates/smoketests/modules/filtering/src/lib.rs index 66cc9bd7134..d306c25d19c 100644 --- a/crates/smoketests/modules/filtering/src/lib.rs +++ b/crates/smoketests/modules/filtering/src/lib.rs @@ -13,24 +13,16 @@ pub struct Person { #[spacetimedb::reducer] pub fn insert_person(ctx: &ReducerContext, id: i32, name: String, nick: String) { - ctx.db.person().insert(Person { id, name, nick }); + ctx.db.person().insert(Person { id, name, nick} ); } #[spacetimedb::reducer] pub fn insert_person_twice(ctx: &ReducerContext, id: i32, name: String, nick: String) { // We'd like to avoid an error due to a set-semantic error. let name2 = format!("{name}2"); - ctx.db.person().insert(Person { - id, - name, - nick: nick.clone(), - }); - match ctx.db.person().try_insert(Person { - id, - name: name2, - nick: nick.clone(), - }) { - Ok(_) => {} + ctx.db.person().insert(Person { id, name, nick: nick.clone()} ); + match ctx.db.person().try_insert(Person { id, name: name2, nick: nick.clone()}) { + Ok(_) => {}, Err(_) => { log::info!("UNIQUE CONSTRAINT VIOLATION ERROR: id = {}, nick = {}", id, nick) } @@ -93,7 +85,7 @@ pub struct NonuniquePerson { #[spacetimedb::reducer] pub fn insert_nonunique_person(ctx: &ReducerContext, id: i32, name: String, is_human: bool) { - ctx.db.nonunique_person().insert(NonuniquePerson { id, name, is_human }); + ctx.db.nonunique_person().insert(NonuniquePerson { id, name, is_human } ); } #[spacetimedb::reducer] @@ -166,11 +158,7 @@ struct IndexedPerson { #[spacetimedb::reducer] fn insert_indexed_person(ctx: &ReducerContext, id: i32, given_name: String, surname: String) { - ctx.db.indexed_person().insert(IndexedPerson { - id, - given_name, - surname, - }); + ctx.db.indexed_person().insert(IndexedPerson { id, given_name, surname }); } #[spacetimedb::reducer] @@ -181,12 +169,7 @@ fn delete_indexed_person(ctx: &ReducerContext, id: i32) { #[spacetimedb::reducer] fn find_indexed_people(ctx: &ReducerContext, surname: String) { for person in ctx.db.indexed_person().surname().filter(&surname) { - log::info!( - "INDEXED FOUND: id {}: {}, {}", - person.id, - person.surname, - person.given_name - ); + log::info!("INDEXED FOUND: id {}: {}, {}", person.id, person.surname, person.given_name); } } @@ -194,11 +177,6 @@ fn find_indexed_people(ctx: &ReducerContext, surname: String) { fn find_indexed_people_read_only(ctx: &ReducerContext, surname: String) { let ctx = ctx.as_read_only(); for person in ctx.db.indexed_person().surname().filter(&surname) { - log::info!( - "INDEXED FOUND: id {}: {}, {}", - person.id, - person.surname, - person.given_name - ); + log::info!("INDEXED FOUND: id {}: {}, {}", person.id, person.surname, person.given_name); } } diff --git a/crates/smoketests/modules/module-nested-op/src/lib.rs b/crates/smoketests/modules/module-nested-op/src/lib.rs index 4db37eb613d..fea0f2c55a9 100644 --- a/crates/smoketests/modules/module-nested-op/src/lib.rs +++ b/crates/smoketests/modules/module-nested-op/src/lib.rs @@ -15,7 +15,7 @@ pub struct Friends { #[spacetimedb::reducer] pub fn create_account(ctx: &ReducerContext, account_id: i32, name: String) { - ctx.db.account().insert(Account { id: account_id, name }); + ctx.db.account().insert(Account { id: account_id, name } ); } #[spacetimedb::reducer] @@ -23,10 +23,7 @@ pub fn add_friend(ctx: &ReducerContext, my_id: i32, their_id: i32) { // Make sure our friend exists for account in ctx.db.account().iter() { if account.id == their_id { - ctx.db.friends().insert(Friends { - friend_1: my_id, - friend_2: their_id, - }); + ctx.db.friends().insert(Friends { friend_1: my_id, friend_2: their_id }); return; } } diff --git a/crates/smoketests/modules/new-user-flow/src/lib.rs b/crates/smoketests/modules/new-user-flow/src/lib.rs index c6e695e24cb..100c13245a5 100644 --- a/crates/smoketests/modules/new-user-flow/src/lib.rs +++ b/crates/smoketests/modules/new-user-flow/src/lib.rs @@ -2,7 +2,7 @@ use spacetimedb::{log, ReducerContext, Table}; #[spacetimedb::table(accessor = person)] pub struct Person { - name: String, + name: String } #[spacetimedb::reducer] diff --git a/crates/smoketests/modules/pg-wire/src/lib.rs b/crates/smoketests/modules/pg-wire/src/lib.rs index a22ed574ef6..d1e92fc1614 100644 --- a/crates/smoketests/modules/pg-wire/src/lib.rs +++ b/crates/smoketests/modules/pg-wire/src/lib.rs @@ -1,5 +1,5 @@ use spacetimedb::sats::{i256, u256}; -use spacetimedb::{ConnectionId, Identity, ReducerContext, SpacetimeType, Table, TimeDuration, Timestamp, Uuid}; +use spacetimedb::{ConnectionId, Identity, ReducerContext, SpacetimeType, Table, Timestamp, TimeDuration, Uuid}; #[derive(Copy, Clone)] #[spacetimedb::table(accessor = t_ints, public)] @@ -50,7 +50,7 @@ pub struct TOthers { #[spacetimedb::table(accessor = t_others_tuple, public)] pub struct TOthersTuple { - tuple: TOthers, + tuple: TOthers } #[derive(SpacetimeType, Debug, Clone, Copy)] @@ -79,9 +79,9 @@ pub struct TEnum { #[spacetimedb::table(accessor = t_nested, public)] pub struct TNested { - en: TEnum, - se: TSimpleEnum, - ints: TInts, + en: TEnum, + se: TSimpleEnum, + ints: TInts, } #[derive(Clone)] @@ -127,7 +127,7 @@ pub fn test(ctx: &ReducerContext) { f32: 594806.58906, f64: -3454353.345389043278459, str: "This is spacetimedb".to_string(), - bytes: vec![1, 2, 3, 4, 5, 6, 7], + bytes: vec!(1, 2, 3, 4, 5, 6, 7), identity: Identity::ONE, connection_id: ConnectionId::ZERO, timestamp: Timestamp::UNIX_EPOCH, @@ -137,29 +137,14 @@ pub fn test(ctx: &ReducerContext) { ctx.db.t_others().insert(tuple.clone()); ctx.db.t_others_tuple().insert(TOthersTuple { tuple }); - ctx.db.t_simple_enum().insert(TSimpleEnum { - id: 1, - action: Action::Inactive, - }); - ctx.db.t_simple_enum().insert(TSimpleEnum { - id: 2, - action: Action::Active, - }); + ctx.db.t_simple_enum().insert(TSimpleEnum { id: 1, action: Action::Inactive }); + ctx.db.t_simple_enum().insert(TSimpleEnum { id: 2, action: Action::Active }); - ctx.db.t_enum().insert(TEnum { - id: 1, - color: Color::Gray(128), - }); + ctx.db.t_enum().insert(TEnum { id: 1, color: Color::Gray(128) }); ctx.db.t_nested().insert(TNested { - en: TEnum { - id: 1, - color: Color::Gray(128), - }, - se: TSimpleEnum { - id: 2, - action: Action::Active, - }, + en: TEnum { id: 1, color: Color::Gray(128) }, + se: TSimpleEnum { id: 2, action: Action::Active }, ints, }); diff --git a/crates/smoketests/modules/schedule-cancel/src/lib.rs b/crates/smoketests/modules/schedule-cancel/src/lib.rs index cc89792d47a..1e22e67bff7 100644 --- a/crates/smoketests/modules/schedule-cancel/src/lib.rs +++ b/crates/smoketests/modules/schedule-cancel/src/lib.rs @@ -7,17 +7,14 @@ fn init(ctx: &ReducerContext) { scheduled_id: 0, scheduled_at: duration!(100ms).into(), }); - ctx.db - .scheduled_reducer_args() - .scheduled_id() - .delete(&schedule.scheduled_id); + ctx.db.scheduled_reducer_args().scheduled_id().delete(&schedule.scheduled_id); let schedule = ctx.db.scheduled_reducer_args().insert(ScheduledReducerArgs { - num: 2, - scheduled_id: 0, - scheduled_at: duration!(1000ms).into(), - }); - do_cancel(ctx, schedule.scheduled_id); + num: 2, + scheduled_id: 0, + scheduled_at: duration!(1000ms).into(), + }); + do_cancel(ctx, schedule.scheduled_id); } #[spacetimedb::table(accessor = scheduled_reducer_args, public, scheduled(reducer))] diff --git a/crates/smoketests/modules/schedule-subscribe/src/lib.rs b/crates/smoketests/modules/schedule-subscribe/src/lib.rs index 990c83467aa..65948edfb83 100644 --- a/crates/smoketests/modules/schedule-subscribe/src/lib.rs +++ b/crates/smoketests/modules/schedule-subscribe/src/lib.rs @@ -1,4 +1,4 @@ -use spacetimedb::{duration, log, ReducerContext, Table, Timestamp}; +use spacetimedb::{log, duration, ReducerContext, Table, Timestamp}; #[spacetimedb::table(accessor = scheduled_table, public, scheduled(my_reducer, at = sched_at))] pub struct ScheduledTable { @@ -11,27 +11,15 @@ pub struct ScheduledTable { #[spacetimedb::reducer] fn schedule_reducer(ctx: &ReducerContext) { - ctx.db.scheduled_table().insert(ScheduledTable { - prev: Timestamp::from_micros_since_unix_epoch(0), - scheduled_id: 2, - sched_at: Timestamp::from_micros_since_unix_epoch(0).into(), - }); + ctx.db.scheduled_table().insert(ScheduledTable { prev: Timestamp::from_micros_since_unix_epoch(0), scheduled_id: 2, sched_at: Timestamp::from_micros_since_unix_epoch(0).into(), }); } #[spacetimedb::reducer] fn schedule_repeated_reducer(ctx: &ReducerContext) { - ctx.db.scheduled_table().insert(ScheduledTable { - prev: Timestamp::from_micros_since_unix_epoch(0), - scheduled_id: 1, - sched_at: duration!(100ms).into(), - }); + ctx.db.scheduled_table().insert(ScheduledTable { prev: Timestamp::from_micros_since_unix_epoch(0), scheduled_id: 1, sched_at: duration!(100ms).into(), }); } #[spacetimedb::reducer] pub fn my_reducer(ctx: &ReducerContext, arg: ScheduledTable) { - log::info!( - "Invoked: ts={:?}, delta={:?}", - ctx.timestamp, - ctx.timestamp.duration_since(arg.prev) - ); + log::info!("Invoked: ts={:?}, delta={:?}", ctx.timestamp, ctx.timestamp.duration_since(arg.prev)); } diff --git a/crates/smoketests/modules/upload-module-2/src/lib.rs b/crates/smoketests/modules/upload-module-2/src/lib.rs index 07ce0eeadca..a2ba45fd351 100644 --- a/crates/smoketests/modules/upload-module-2/src/lib.rs +++ b/crates/smoketests/modules/upload-module-2/src/lib.rs @@ -1,4 +1,4 @@ -use spacetimedb::{duration, log, ReducerContext, Table, Timestamp}; +use spacetimedb::{log, duration, ReducerContext, Table, Timestamp}; #[spacetimedb::table(accessor = scheduled_message, public, scheduled(my_repeating_reducer))] pub struct ScheduledMessage { @@ -20,9 +20,5 @@ fn init(ctx: &ReducerContext) { #[spacetimedb::reducer] pub fn my_repeating_reducer(ctx: &ReducerContext, arg: ScheduledMessage) { - log::info!( - "Invoked: ts={:?}, delta={:?}", - ctx.timestamp, - ctx.timestamp.duration_since(arg.prev) - ); + log::info!("Invoked: ts={:?}, delta={:?}", ctx.timestamp, ctx.timestamp.duration_since(arg.prev)); } From 0ba6f53fc8db94d1c0fd845802a38755dc0ce42b Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 18 Feb 2026 16:20:18 -0800 Subject: [PATCH 11/11] [bfops/fix-double-runs]: ci --- tools/ci/README.md | 11 +++++++++++ tools/ci/src/smoketest.rs | 8 +++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/ci/README.md b/tools/ci/README.md index c3fc615ddbe..c01598359e7 100644 --- a/tools/ci/README.md +++ b/tools/ci/README.md @@ -121,6 +121,17 @@ Usage: prepare - `--help`: Print help (see a summary with '-h') +#### `check-mod-list` + +**Usage:** +```bash +Usage: check-mod-list +``` + +**Options:** + +- `--help`: + #### `help` **Usage:** diff --git a/tools/ci/src/smoketest.rs b/tools/ci/src/smoketest.rs index 7be66aff65b..efc0781b4fa 100644 --- a/tools/ci/src/smoketest.rs +++ b/tools/ci/src/smoketest.rs @@ -209,11 +209,9 @@ fn check_smoketests_mod_rs_complete() -> Result<()> { let ft = entry.file_type()?; if ft.is_dir() { expected.insert(name.to_string()); - } else if ft.is_file() { - if path.extension() == Some(OsStr::new("rs")) { - if let Some(stem) = path.file_stem() { - expected.insert(stem.to_string_lossy().to_string()); - } + } else if ft.is_file() && path.extension() == Some(OsStr::new("rs")) { + if let Some(stem) = path.file_stem() { + expected.insert(stem.to_string_lossy().to_string()); } } }