Skip to content

Commit

Permalink
[test] fix test_generated_schema_are_up_to_date_in_git (#3704)
Browse files Browse the repository at this point in the history
* update test

* workaround jsonrpc-client-transports bug

* add

* add

* move generated schema

* comment

* fmt

* update

* update

* update script generated_rpc_schema path
  • Loading branch information
jiangying000 authored Sep 1, 2022
1 parent 80916d3 commit 740c36a
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions rpc/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jsonrpc-core-client = {version = "18", features = [
"ipc",
"ws",
"arbitrary_precision",
"tls",
]}
jsonrpc-derive = {git = "https://github.com/starcoinorg/jsonrpc", rev = "2f6c2b33d3048d57a85347ee735b312df0117b15"}
jsonrpc-pubsub = "18"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 10 additions & 5 deletions rpc/api/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,16 @@ fn assert_that_version_control_has_no_unstaged_changes() {
fn test_generated_schema_are_up_to_date_in_git() {
// Better not run the `stdlib` tool when the repository is not in a clean state.
assert_that_version_control_has_no_unstaged_changes();
let path = PathBuf::from("../../target/debug/starcoin-rpc-schema-generate")
.canonicalize()
.unwrap();
assert!(Command::new(path)
.current_dir("../")

// The directory containing the manifest for the package being built
const CARGO_MANIFEST_DIR: &str = env!("CARGO_MANIFEST_DIR");
let generated_file_path = PathBuf::from(CARGO_MANIFEST_DIR);

assert!(Command::new("cargo")
.current_dir(generated_file_path)
.arg("run")
.arg("--bin")
.arg("starcoin-rpc-schema-generate")
.status()
.unwrap()
.success());
Expand Down
2 changes: 1 addition & 1 deletion scripts/check_commit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cargo run -p stdlib
# generate genesis
cargo run -p starcoin-genesis
# generate rpc schema document
cargo run -p starcoin-rpc-api -- -d ./rpc/generated_rpc_schema
cargo run -p starcoin-rpc-api -- -d ./rpc/api/generated_rpc_schema
# test config file
cargo test -p starcoin-config test_example_config_compact
# check changed files
Expand Down
2 changes: 1 addition & 1 deletion scripts/check_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cargo run -p stdlib
# generate genesis
cargo run -p starcoin-genesis
# generate rpc schema document
cargo run -p starcoin-rpc-api -- -d ./rpc/generated_rpc_schema
cargo run -p starcoin-rpc-api -- -d ./rpc/api/generated_rpc_schema
# test config file
cargo test -p starcoin-config test_example_config_compact
# check changed files
Expand Down

0 comments on commit 740c36a

Please sign in to comment.