Skip to content

Commit

Permalink
Make test_experimental_notice more targeted in its assertions so th…
Browse files Browse the repository at this point in the history
…at it won't fail on other output changes.
  • Loading branch information
bryn committed May 4, 2023
1 parent bdf87fc commit f415952
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion apollo-router/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ impl IntegrationTest {
}

#[allow(dead_code)]
async fn assert_log_contains(&mut self, msg: &str) {
pub async fn assert_log_contains(&mut self, msg: &str) {
let now = Instant::now();
while now.elapsed() < Duration::from_secs(5) {
if let Ok(line) = self.stdio_rx.try_recv() {
Expand Down
7 changes: 3 additions & 4 deletions apollo-router/tests/lifecycle_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ async fn test_cli_config_preview() {

#[tokio::test(flavor = "multi_thread")]
async fn test_experimental_notice() {
let (tx, rx) = tokio::sync::oneshot::channel();
let mut router = IntegrationTest::builder()
.config(
"
Expand All @@ -194,12 +193,12 @@ async fn test_experimental_notice() {
format: json
",
)
.collect_stdio(tx)
.build()
.await;
router.start().await;
router
.assert_log_contains("You're using some \\\"experimental\\\" features of the Apollo Router")
.await;
router.assert_started().await;
router.kill().await;

insta::assert_snapshot!(rx.await.unwrap());
}

This file was deleted.

0 comments on commit f415952

Please sign in to comment.