File tree 4 files changed +58
-0
lines changed
4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -235,6 +235,7 @@ git2 = { workspace = true, features = ["https"] }
235
235
graphql-schema-diff = " =0.2.0"
236
236
httpmock = { workspace = true }
237
237
indoc = { workspace = true }
238
+ jsonschema = " 0.29.0"
238
239
mime = " =0.3.17"
239
240
mockall = " =0.13.1"
240
241
portpicker = " =0.1.1"
Original file line number Diff line number Diff line change
1
+ use std:: process:: Command ;
2
+
3
+ use assert_cmd:: cargo:: CommandCargoExt ;
4
+ use rstest:: rstest;
5
+ use tracing:: error;
6
+ use tracing_test:: traced_test;
7
+
8
+ #[ rstest]
9
+ #[ ignore]
10
+ #[ tokio:: test( flavor = "multi_thread" ) ]
11
+ #[ traced_test]
12
+ async fn e2e_test_rover_supergraph_config_schema ( ) {
13
+ let mut cmd = Command :: cargo_bin ( "rover" ) . expect ( "Could not find necessary binary" ) ;
14
+ cmd. args ( [ "supergraph" , "config" , "schema" ] ) ;
15
+
16
+ let output = cmd. output ( ) . expect ( "Could not run command" ) ;
17
+ if !output. status . success ( ) {
18
+ error ! ( "{}" , String :: from_utf8( output. stderr) . unwrap( ) ) ;
19
+ panic ! ( "Command did not complete successfully" ) ;
20
+ }
21
+
22
+ let output = String :: from_utf8 ( output. stdout ) . unwrap ( ) ;
23
+ let json_schema = serde_json:: from_str ( & output) . unwrap ( ) ;
24
+ if !jsonschema:: meta:: is_valid ( & json_schema) {
25
+ error ! ( "{}" , output) ;
26
+ panic ! ( "Could not validate JSON Schema, incorrect schema printed above" ) ;
27
+ }
28
+ }
Original file line number Diff line number Diff line change 1
1
mod compose;
2
+ mod config;
2
3
mod fetch;
Original file line number Diff line number Diff line change
1
+ use std:: process:: Command ;
2
+
3
+ use assert_cmd:: cargo:: CommandCargoExt ;
4
+ use rstest:: rstest;
5
+ use tracing:: error;
6
+ use tracing_test:: traced_test;
7
+
8
+ #[ rstest]
9
+ #[ ignore]
10
+ #[ tokio:: test( flavor = "multi_thread" ) ]
11
+ #[ traced_test]
12
+ async fn e2e_test_rover_supergraph_print_json_schema ( ) {
13
+ let mut cmd = Command :: cargo_bin ( "rover" ) . expect ( "Could not find necessary binary" ) ;
14
+ cmd. args ( [ "supergraph" , "print-json-schema" ] ) ;
15
+
16
+ let output = cmd. output ( ) . expect ( "Could not run command" ) ;
17
+ if !output. status . success ( ) {
18
+ error ! ( "{}" , String :: from_utf8( output. stderr) . unwrap( ) ) ;
19
+ panic ! ( "Command did not complete successfully" ) ;
20
+ }
21
+
22
+ let output = String :: from_utf8 ( output. stdout ) . unwrap ( ) ;
23
+ let json_schema = serde_json:: from_str ( & output) . unwrap ( ) ;
24
+ if !jsonschema:: meta:: is_valid ( & json_schema) {
25
+ error ! ( "{}" , output) ;
26
+ panic ! ( "Could not validate JSON Schema, incorrect schema printed above" ) ;
27
+ }
28
+ }
You can’t perform that action at this time.
0 commit comments