-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update service schema, remove feature gates from test. (#2439)
- Loading branch information
Showing
3 changed files
with
60 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
linera-service-graphql-client/tests/test_check_service_schema.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) Zefchain Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use std::io::Read; | ||
|
||
use linera_base::command::resolve_binary; | ||
use tempfile::tempdir; | ||
use tokio::process::Command; | ||
|
||
#[test_log::test(tokio::test)] | ||
async fn test_check_service_schema() { | ||
let tmp_dir = tempdir().unwrap(); | ||
let path = resolve_binary("linera-schema-export", "linera-service") | ||
.await | ||
.unwrap(); | ||
let mut command = Command::new(path); | ||
let output = command.current_dir(tmp_dir.path()).output().await.unwrap(); | ||
let service_schema = String::from_utf8(output.stdout).unwrap(); | ||
let mut file_base = std::fs::File::open("gql/service_schema.graphql").unwrap(); | ||
let mut graphql_schema = String::new(); | ||
file_base.read_to_string(&mut graphql_schema).unwrap(); | ||
assert_eq!( | ||
graphql_schema, service_schema, | ||
"\nGraphQL service schema has changed -> \ | ||
regenerate schema following steps in linera-service-graphql-client/README.md\n" | ||
) | ||
} |