-
Notifications
You must be signed in to change notification settings - Fork 189
/
Copy pathrebuild_test_artifacts.sh
executable file
·44 lines (32 loc) · 1.71 KB
/
rebuild_test_artifacts.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# When tests are run, the `build.rs` of `dojo-test-utils` is re-building the
# cairo artifacts ONLY if they don't exist.
# This script gives an easy way to remove those artifacts.
cargo build -r --bin katana
cargo build -r --bin sozo
# Some formatting.
cargo +nightly-2024-08-28 fmt --all -- "$@"
scarb --manifest-path examples/spawn-and-move/Scarb.toml fmt
scarb --manifest-path examples/simple/Scarb.toml fmt
scarb --manifest-path crates/dojo/core/Scarb.toml fmt
scarb --manifest-path crates/dojo/core-cairo-test/Scarb.toml fmt
# Manual forced cleanup.
rm -rf examples/spawn-and-move/target
rm -rf crates/torii/types-test/target
rm -rf crates/dojo/lang/src/manifest_test_data/compiler_cairo/target
# Ensure the world bindings are up to date.
cargo run --bin dojo-world-abigen -r
cargo +nightly-2024-08-28 fmt --all -- "$@"
# Fix the cairo test to re-generate the code that is expected to be tested.
# CAIRO_FIX_TESTS=1 cargo test --package dojo-lang plugin && \
# CAIRO_FIX_TESTS=1 cargo test --package dojo-lang semantics
# Re-run the minimal tests, this will re-build the projects + generate the build artifacts.
./target/release/sozo build --manifest-path examples/simple/Scarb.toml
./target/release/sozo build --manifest-path examples/spawn-and-move/Scarb.toml
./target/release/sozo build --manifest-path examples/spawn-and-move/Scarb.toml -P release
./target/release/sozo build --manifest-path crates/torii/types-test/Scarb.toml
./target/release/sozo test --manifest-path crates/dojo/core-cairo-test/Scarb.toml
# Generates the database for testing by migrating the spawn and move example.
KATANA_RUNNER_BIN=./target/release/katana cargo generate-test-db
# Extracts the database for testing.
bash ./scripts/extract_test_db.sh