()
| 476 | } |
| 477 | |
| 478 | fn main() -> Result<()> { |
| 479 | env_logger::init(); |
| 480 | |
| 481 | let cli = Cli::parse(); |
| 482 | |
| 483 | match cli.cmd { |
| 484 | Some(CiCmd::Test) => { |
| 485 | cmd!("pnpm", "build").dir("crates/bindings-typescript").run()?; |
| 486 | |
| 487 | // TODO: This doesn't work on at least user Linux machines, because something here apparently uses `sudo`? |
| 488 | |
| 489 | // Exclude smoketests from `cargo test --all` since they require pre-built binaries. |
| 490 | // Smoketests have their own dedicated command: `cargo ci smoketests` |
| 491 | cmd!( |
| 492 | "cargo", |
| 493 | "test", |
| 494 | "--all", |
| 495 | "--exclude", |
| 496 | "spacetimedb-smoketests", |
| 497 | "--exclude", |
| 498 | "spacetimedb-sdk", |
| 499 | "--exclude", |
| 500 | "spacetimedb", |
| 501 | "--", |
| 502 | "--test-threads=2", |
| 503 | "--skip", |
| 504 | "unreal" |
| 505 | ) |
| 506 | .run()?; |
| 507 | // Bindings snapshot tests rely on the unstable feature, |
| 508 | // as they compile and test APIs which are gated behind that feature, |
| 509 | // e.g. procedures, HTTP handlers. |
| 510 | cmd!( |
| 511 | "cargo", |
| 512 | "test", |
| 513 | "-p", |
| 514 | "spacetimedb", |
| 515 | "--features", |
| 516 | "unstable", |
| 517 | "--", |
| 518 | "--test-threads=2", |
| 519 | ) |
| 520 | .run()?; |
| 521 | // The SDK test harness uses the same child-process server guard as smoketests, |
| 522 | // which expects release CLI/standalone binaries to already exist. |
| 523 | cmd!( |
| 524 | "cargo", |
| 525 | "build", |
| 526 | "--release", |
| 527 | "-p", |
| 528 | "spacetimedb-cli", |
| 529 | "-p", |
| 530 | "spacetimedb-standalone", |
| 531 | "--features", |
| 532 | "spacetimedb-standalone/allow_loopback_http_for_tests", |
| 533 | ) |
| 534 | .run()?; |
| 535 | // SDK procedure tests intentionally make localhost HTTP requests. |
nothing calls this directly
no test coverage detected
searching dependent graphs…