Skip to content

Commit

Permalink
Remove tools/hyper_hello (denoland#6651)
Browse files Browse the repository at this point in the history
  • Loading branch information
ry authored Jul 6, 2020
1 parent c7afbda commit 75d9913
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 64 deletions.
9 changes: 0 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
members = [
"cli",
"core",
"tools/hyper_hello",
"deno_typescript",
"test_plugin",
"test_util",
Expand Down
18 changes: 17 additions & 1 deletion test_util/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
// Usage: provide a port as argument to run hyper_hello benchmark server
// otherwise this starts multiple servers on many ports for test endpoints.

#[macro_use]
extern crate lazy_static;

use futures::future::{self, FutureExt};
use os_pipe::pipe;
use regex::Regex;
use std::env;
use std::io::Read;
use std::io::Write;
use std::mem::replace;
Expand All @@ -17,8 +20,10 @@ use std::process::Stdio;
use std::sync::Mutex;
use std::sync::MutexGuard;
use tempfile::TempDir;
use warp::http::HeaderValue;
use warp::http::Response;
use warp::http::StatusCode;
use warp::http::Uri;
use warp::http::{HeaderValue, Response, StatusCode};
use warp::hyper::Body;
use warp::reply::with_header;
use warp::reply::Reply;
Expand Down Expand Up @@ -78,8 +83,19 @@ pub fn test_server_path() -> PathBuf {
p
}

/// Benchmark server that just serves "hello world" responses.
async fn hyper_hello(port: u16) {
println!("hyper hello");
let route = warp::any().map(|| "Hello World!");
warp::serve(route).bind(([127, 0, 0, 1], port)).await;
}

#[tokio::main]
pub async fn run_all_servers() {
if let Some(port) = env::args().nth(1) {
return hyper_hello(port.parse::<u16>().unwrap()).await;
}

let routes = warp::path::full().map(|path: warp::path::FullPath| {
let p = path.as_str();
assert_eq!(&p[0..1], "/");
Expand Down
2 changes: 1 addition & 1 deletion tools/http_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def hyper_http(hyper_hello_exe):


def http_benchmark(build_dir):
hyper_hello_exe = os.path.join(build_dir, "hyper_hello")
hyper_hello_exe = os.path.join(build_dir, "test_server")
deno_core_http_bench_exe = os.path.join(build_dir,
"examples/deno_core_http_bench")
deno_exe = os.path.join(build_dir, "deno")
Expand Down
12 changes: 0 additions & 12 deletions tools/hyper_hello/Cargo.toml

This file was deleted.

40 changes: 0 additions & 40 deletions tools/hyper_hello/hyper_hello.rs

This file was deleted.

0 comments on commit 75d9913

Please sign in to comment.