-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tests): e2e subgraph lint (#2023)
- Loading branch information
1 parent
3b74d9f
commit cac1488
Showing
2 changed files
with
45 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use std::path::PathBuf; | ||
use std::process::Command; | ||
|
||
use assert_cmd::prelude::CommandCargoExt; | ||
use rstest::rstest; | ||
use speculoos::assert_that; | ||
use tracing::error; | ||
use tracing_test::traced_test; | ||
|
||
use crate::e2e::{remote_supergraph_graphref, test_artifacts_directory}; | ||
|
||
#[rstest] | ||
#[ignore] | ||
#[tokio::test(flavor = "multi_thread")] | ||
#[traced_test] | ||
async fn e2e_test_rover_subgraph_lint( | ||
remote_supergraph_graphref: String, | ||
test_artifacts_directory: PathBuf, | ||
) { | ||
let schema_file = test_artifacts_directory.join("perfSubgraph00.graphql"); | ||
let schema_file = schema_file | ||
.to_str() | ||
.expect("failed to get path to perfSubgraph00.graphql file"); | ||
|
||
let mut cmd = Command::cargo_bin("rover").expect("Could not find necessary binary"); | ||
cmd.args([ | ||
"subgraph", | ||
"lint", | ||
"--name", | ||
"perf-subgraph-00", | ||
"--schema", | ||
schema_file, | ||
&remote_supergraph_graphref, | ||
]); | ||
let output = cmd.output().expect("Could not run command"); | ||
println!("output: {output:?}"); | ||
|
||
if !output.status.success() { | ||
error!("{}", String::from_utf8(output.stderr).unwrap()); | ||
panic!("Command did not complete successfully"); | ||
} | ||
|
||
assert_that(&output.stderr.len()).is_equal_to(0); | ||
} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
mod fetch; | ||
mod introspect; | ||
mod lint; |