diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-04-15 05:26:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 11:26:31 +0200 |
commit | 263dc8f5fe09e57437d073429cc0fa1753362f06 (patch) | |
tree | 1ac456fc56a210709ffd9f04b15c37bee9688861 | |
parent | a7a3a771a0a0cb2df2a14bcf4b8c38bc69525dd6 (diff) |
Revert "test(inspector): add coverage test case (#4725)" (#4754)
Flaky and doesn't implement any features.
This reverts commit a7a3a771a0a0cb2df2a14bcf4b8c38bc69525dd6.
-rw-r--r-- | cli/tests/inspector_coverage.js | 16 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 75 |
2 files changed, 0 insertions, 91 deletions
diff --git a/cli/tests/inspector_coverage.js b/cli/tests/inspector_coverage.js deleted file mode 100644 index 3db0e5a19..000000000 --- a/cli/tests/inspector_coverage.js +++ /dev/null @@ -1,16 +0,0 @@ -function a() { - console.log("hello a"); -} - -function b() { - console.log("hello b"); -} - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function c() { - console.log("hello c"); -} - -a(); -b(); -b(); diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index d10c45899..905870c29 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -2208,81 +2208,6 @@ async fn inspector_break_on_first_line() { } #[tokio::test] -async fn inspector_coverage() { - let script = deno::test_util::root_path() - .join("cli") - .join("tests") - .join("inspector_coverage.js"); - let mut child = util::deno_cmd() - .arg("run") - // Warning: each inspector test should be on its own port to avoid - // conflicting with another inspector test. - .arg("--inspect-brk=127.0.0.1:9231") - .arg(script) - .stdout(std::process::Stdio::piped()) - .stderr(std::process::Stdio::piped()) - .spawn() - .unwrap(); - - let stderr = child.stderr.as_mut().unwrap(); - let ws_url = extract_ws_url_from_stderr(stderr); - let (socket, response) = tokio_tungstenite::connect_async(ws_url) - .await - .expect("Can't connect"); - assert_eq!(response.status(), 101); // Switching protocols. - - let (mut socket_tx, mut socket_rx) = socket.split(); - - let stdout = child.stdout.as_mut().unwrap(); - let mut stdout_lines = std::io::BufReader::new(stdout).lines(); - - use TestStep::*; - let test_steps = vec![ - WsSend(r#"{"id":1,"method":"Runtime.enable"}"#), - WsSend(r#"{"id":2,"method":"Profiler.enable"}"#), - WsSend( - r#"{"id":3,"method":"Profiler.startPreciseCoverage", "params": {"callCount": false, "detailed": true } }"#, - ), - WsRecv( - r#"{"method":"Runtime.executionContextCreated","params":{"context":{"id":1,"#, - ), - WsRecv(r#"{"id":1,"result":{}}"#), - WsRecv(r#"{"id":2,"result":{}}"#), - WsRecv(r#"{"id":3,"result":{"timestamp":"#), - WsSend(r#"{"id":4,"method":"Runtime.runIfWaitingForDebugger"}"#), - WsRecv(r#"{"id":4,"result":{}}"#), - StdOut("hello a"), - StdOut("hello b"), - StdOut("hello b"), - WsSend(r#"{"id":5,"method":"Profiler.takePreciseCoverage"}"#), - WsSend(r#"{"id":6,"method":"Profiler.stopPreciseCoverage"}"#), - WsRecv(r#"{"id":5,"result":{"result":[{"#), - ]; - - for step in test_steps { - match step { - StdOut(s) => match stdout_lines.next() { - Some(Ok(line)) => assert_eq!(line, s), - other => panic!(other), - }, - WsRecv(s) => loop { - let msg = match socket_rx.next().await { - Some(Ok(msg)) => msg.to_string(), - other => panic!(other), - }; - if !msg.starts_with(r#"{"method":"Debugger.scriptParsed","#) { - assert!(msg.starts_with(s)); - break; - } - }, - WsSend(s) => socket_tx.send(s.into()).await.unwrap(), - } - } - - child.kill().unwrap(); -} - -#[tokio::test] async fn inspector_pause() { let script = deno::test_util::root_path() .join("cli") |