chore(lib): individually disable tests and examples that aren't updated

This commit is contained in:
Sean McArthur
2019-07-12 13:29:57 -07:00
parent f93463b3d9
commit 5da17df97f
29 changed files with 120 additions and 61 deletions

View File

@@ -25,7 +25,7 @@ matrix:
# fi # fi
script: script:
- cargo build $FEATURES - cargo build $FEATURES --all-targets
# Disable tests temporarily # Disable tests temporarily
# - 'if [ "$BUILD_ONLY" != "1" ]; then cargo test $FEATURES -- --test-threads=1; fi' # - 'if [ "$BUILD_ONLY" != "1" ]; then cargo test $FEATURES -- --test-threads=1; fi'
# - 'if [ $TRAVIS_RUST_VERSION = nightly ]; then for f in ./benches/*.rs; do cargo test --bench $(basename $f .rs) $FEATURES; done; fi' # - 'if [ $TRAVIS_RUST_VERSION = nightly ]; then for f in ./benches/*.rs; do cargo test --bench $(basename $f .rs) $FEATURES; done; fi'

View File

@@ -114,66 +114,66 @@ name = "params"
path = "examples/params.rs" path = "examples/params.rs"
required-features = ["runtime"] required-features = ["runtime"]
[[example]] #[[example]]
name = "proxy" #name = "proxy"
path = "examples/proxy.rs" #path = "examples/proxy.rs"
required-features = ["runtime"] #required-features = ["runtime"]
[[example]] #[[example]]
name = "send_file" #name = "send_file"
path = "examples/send_file.rs" #path = "examples/send_file.rs"
required-features = ["runtime"] #required-features = ["runtime"]
[[example]] #[[example]]
name = "single_threaded" #name = "single_threaded"
path = "examples/single_threaded.rs" #path = "examples/single_threaded.rs"
required-features = ["runtime"] #required-features = ["runtime"]
[[example]] #[[example]]
name = "state" #name = "state"
path = "examples/state.rs" #path = "examples/state.rs"
required-features = ["runtime"] #required-features = ["runtime"]
[[example]] #[[example]]
name = "upgrades" #name = "upgrades"
path = "examples/upgrades.rs" #path = "examples/upgrades.rs"
required-features = ["runtime"] #required-features = ["runtime"]
[[example]] #[[example]]
name = "web_api" #name = "web_api"
path = "examples/web_api.rs" #path = "examples/web_api.rs"
required-features = ["runtime"] #required-features = ["runtime"]
[[bench]] #[[bench]]
name = "end_to_end" #name = "end_to_end"
path = "benches/end_to_end.rs" #path = "benches/end_to_end.rs"
required-features = ["runtime"] #required-features = ["runtime"]
[[bench]] #[[bench]]
name = "pipeline" #name = "pipeline"
path = "benches/pipeline.rs" #path = "benches/pipeline.rs"
required-features = ["runtime"] #required-features = ["runtime"]
[[bench]] #[[bench]]
name = "server" #name = "server"
path = "benches/server.rs" #path = "benches/server.rs"
required-features = ["runtime"] #required-features = ["runtime"]
[[test]] #[[test]]
name = "client" #name = "client"
path = "tests/client.rs" #path = "tests/client.rs"
required-features = ["runtime"] #required-features = ["runtime"]
[[test]] #[[test]]
name = "integration" #name = "integration"
path = "tests/integration.rs" #path = "tests/integration.rs"
required-features = ["runtime"] #required-features = ["runtime"]
[[test]] #[[test]]
name = "server" #name = "server"
path = "tests/server.rs" #path = "tests/server.rs"
required-features = ["runtime"] #required-features = ["runtime"]

View File

@@ -1,7 +1,5 @@
#![feature(async_await)] #![feature(async_await)]
#![deny(warnings)] //#![deny(warnings)]
extern crate hyper;
use hyper::{Body, Method, Request, Response, Server, StatusCode}; use hyper::{Body, Method, Request, Response, Server, StatusCode};
use hyper::service::{make_service_fn, service_fn}; use hyper::service::{make_service_fn, service_fn};

View File

@@ -549,10 +549,20 @@ impl Sink for Sender {
} }
*/ */
#[test] #[cfg(test)]
fn test_body_stream_concat() { mod tests {
let body = Body::from("hello world"); // FIXME: re-implement tests with `async/await`, this import should
// trigger a warning to remind us
use crate::Error;
let total = body.concat2().wait().unwrap(); /*
assert_eq!(total.as_ref(), b"hello world"); use super::*;
#[test]
fn test_body_stream_concat() {
let body = Body::from("hello world");
let total = body.concat2().wait().unwrap();
assert_eq!(total.as_ref(), b"hello world");
}
*/
} }

View File

@@ -569,6 +569,10 @@ impl ConnectingTcp {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
// FIXME: re-implement tests with `async/await`, this import should
// trigger a warning to remind us
use crate::Error;
/*
use std::io; use std::io;
use futures::Future; use futures::Future;
use super::{Connect, Destination, HttpConnector}; use super::{Connect, Destination, HttpConnector};
@@ -755,5 +759,6 @@ mod tests {
(reachable, duration) (reachable, duration)
} }
} }
*/
} }

View File

@@ -250,6 +250,10 @@ impl<T, U> Callback<T, U> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
// FIXME: re-implement tests with `async/await`, this import should
// trigger a warning to remind us
use crate::Error;
/*
extern crate pretty_env_logger; extern crate pretty_env_logger;
#[cfg(feature = "nightly")] #[cfg(feature = "nightly")]
extern crate test; extern crate test;
@@ -367,4 +371,5 @@ mod tests {
rx.taker.cancel(); rx.taker.cancel();
}) })
} }
*/
} }

View File

@@ -774,6 +774,11 @@ impl<T> WeakOpt<T> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
// FIXME: re-implement tests with `async/await`, this import should
// trigger a warning to remind us
use crate::Error;
/*
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
use futures::{Async, Future}; use futures::{Async, Future};
@@ -998,4 +1003,5 @@ mod tests {
assert!(!pool.locked().idle.contains_key(&key)); assert!(!pool.locked().idle.contains_key(&key));
} }
*/
} }

View File

@@ -1,3 +1,7 @@
// FIXME: re-implement tests with `async/await`, this import should
// trigger a warning to remind us
use super::Client;
/*
#![cfg(feature = "runtime")] #![cfg(feature = "runtime")]
extern crate pretty_env_logger; extern crate pretty_env_logger;
@@ -267,3 +271,4 @@ fn bench_http1_get_10b(b: &mut test::Bencher) {
rt.block_on(res1.join(srv1)).expect("res1"); rt.block_on(res1.join(srv1)).expect("res1");
}); });
} }
*/

View File

@@ -121,6 +121,11 @@ where
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
// FIXME: re-implement tests with `async/await`, this import should
// trigger a warning to remind us
use crate::Error;
/*
use futures::{future, Async, Future, Poll}; use futures::{future, Async, Future, Poll};
use super::*; use super::*;
@@ -235,5 +240,6 @@ mod tests {
Ok::<_, ()>(()) Ok::<_, ()>(())
}).wait().unwrap(); }).wait().unwrap();
} }
*/
} }

View File

@@ -124,6 +124,10 @@ where
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
// FIXME: re-implement tests with `async/await`, this import should
// trigger a warning to remind us
use super::Rewind;
/*
use super::*; use super::*;
extern crate tokio_mockstream; extern crate tokio_mockstream;
use self::tokio_mockstream::MockStream; use self::tokio_mockstream::MockStream;
@@ -212,4 +216,5 @@ mod tests {
stream.read(&mut o2[cnt..]).unwrap(); stream.read(&mut o2[cnt..]).unwrap();
assert_eq!(&o2, &bs); assert_eq!(&o2, &bs);
} }
*/
} }

View File

@@ -1,3 +1,7 @@
// FIXME: re-implement tests with `async/await`, this import should
// trigger a warning to remind us
use crate::Error;
/*
#[cfg(feature = "runtime")] #[cfg(feature = "runtime")]
use std::collections::HashMap; use std::collections::HashMap;
use std::cmp; use std::cmp;
@@ -523,3 +527,4 @@ impl Drop for MockedConnections {
} }
} }
} }
*/

View File

@@ -884,7 +884,7 @@ impl State {
#[cfg(test)] #[cfg(test)]
//TODO: rewrite these using dispatch //TODO: rewrite these using dispatch
mod tests { mod tests {
/*
#[cfg(feature = "nightly")] #[cfg(feature = "nightly")]
#[bench] #[bench]
fn bench_read_head_short(b: &mut ::test::Bencher) { fn bench_read_head_short(b: &mut ::test::Bencher) {
@@ -918,6 +918,7 @@ mod tests {
conn.state.reading = Reading::Init; conn.state.reading = Reading::Init;
}); });
} }
*/
/* /*
use futures::{Async, Future, Stream, Sink}; use futures::{Async, Future, Stream, Sink};
use futures::future; use futures::future;

View File

@@ -319,6 +319,10 @@ impl StdError for IncompleteBody {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
// FIXME: re-implement tests with `async/await`, this import should
// trigger a warning to remind us
use crate::Error;
/*
use std::io; use std::io;
use std::io::Write; use std::io::Write;
use super::Decoder; use super::Decoder;
@@ -535,5 +539,5 @@ mod tests {
let content = "foobar"; let content = "foobar";
all_async_cases(content, content, Decoder::eof()); all_async_cases(content, content, Decoder::eof());
} }
*/
} }

View File

@@ -598,6 +598,10 @@ where
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
// FIXME: re-implement tests with `async/await`, this import should
// trigger a warning to remind us
use crate::Error;
/*
extern crate pretty_env_logger; extern crate pretty_env_logger;
use super::*; use super::*;
@@ -656,4 +660,5 @@ mod tests {
Ok::<(), ()>(()) Ok::<(), ()>(())
}).wait().unwrap(); }).wait().unwrap();
} }
*/
} }

View File

@@ -650,6 +650,10 @@ impl<T: Buf> Buf for BufDeque<T> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
// FIXME: re-implement tests with `async/await`, this import should
// trigger a warning to remind us
use crate::Error;
/*
use super::*; use super::*;
use std::io::Read; use std::io::Read;
use crate::mock::AsyncIo; use crate::mock::AsyncIo;
@@ -657,8 +661,7 @@ mod tests {
#[cfg(feature = "nightly")] #[cfg(feature = "nightly")]
use test::Bencher; use test::Bencher;
#[cfg(test)] impl<T: Read> MemRead for AsyncIo<T> {
impl<T: Read> MemRead for crate::mock::AsyncIo<T> {
fn read_mem(&mut self, len: usize) -> Poll<Bytes, io::Error> { fn read_mem(&mut self, len: usize) -> Poll<Bytes, io::Error> {
let mut v = vec![0; len]; let mut v = vec![0; len];
let n = try_nb!(self.read(v.as_mut_slice())); let n = try_nb!(self.read(v.as_mut_slice()));
@@ -900,4 +903,5 @@ mod tests {
write_buf.headers.bytes.clear(); write_buf.headers.bytes.clear();
}) })
} }
*/
} }