Skip to content

Commit

Permalink
Update travis configuration (#228)
Browse files Browse the repository at this point in the history
* Update travis config

 * Separate out individual build jobs for faster wall-clock testing

 * Fix clippy not actually denying warnings (excluded examples because
   these are currently failing and have non-trivial fixes)

 * Add build job that checks --no-default-features works

 * Add build job that checks for intra-doc-resolution failures (excluded
   tide because of bugs in re-exports with the intra-doc feature)

* Fix warnings

* Fix doc-link in tide-cookies
  • Loading branch information
Nemo157 authored and yoshuawuyts committed May 19, 2019
1 parent 77b3a1c commit 85b85e9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 19 deletions.
39 changes: 28 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
language: rust
rust:
- nightly-2019-05-09

before_script: |
rustup component add rustfmt clippy
script: |
cargo fmt --all -- --check &&
cargo clippy --all --all-features -- -D clippy::all &&
cargo build --no-default-features --verbose &&
cargo build --all --all-features --verbose &&
cargo test --all --all-features --verbose
rust: nightly-2019-05-09
cache: cargo

matrix:
include:
- name: cargo doc
env: [CACHE_NAME=docs]
script:
- RUSTDOCFLAGS=-Dwarnings
cargo doc --all --all-features --no-deps --exclude tide

- name: cargo fmt
cache: false
before_script: rustup component add rustfmt
script: cargo fmt --all -- --check

- name: cargo clippy
env: [CACHE_NAME=clippy]
before_script: rustup component add clippy
script: cargo clippy --all --all-targets --exclude examples -- -Dwarnings

- name: cargo build --no-default-features
env: [CACHE_NAME=no-default-features]
script:
- cargo build --manifest-path tide/Cargo.toml --no-default-features
- cargo build --manifest-path tide-core/Cargo.toml --no-default-features

- name: cargo test
script: cargo test --all --verbose
6 changes: 2 additions & 4 deletions tide-compression/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,7 @@ mod tests {
.header(ACCEPT_ENCODING, hval)
.body(Body::empty())
.unwrap();
let res = server.simulate(req).unwrap();
res
server.simulate(req).unwrap()
}

// Generates a decoded response given a request body and the header value representing its encoding.
Expand All @@ -301,8 +300,7 @@ mod tests {
.header(CONTENT_ENCODING, hval)
.body(body)
.unwrap();
let res = server.simulate(req).unwrap();
res
server.simulate(req).unwrap()
}

#[test]
Expand Down
11 changes: 7 additions & 4 deletions tide-cookies/src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use tide_core::{

/// Middleware to work with cookies.
///
/// [`CookiesMiddleware`] along with [`ContextExt`](crate::cookies::ContextExt) provide smooth
/// [`CookiesMiddleware`] along with [`ContextExt`](crate::data::ContextExt) provide smooth
/// access to request cookies and setting/removing cookies from response. This leverages the
/// [cookie](https://crates.io/crates/cookie) crate.
/// This middleware parses cookies from request and caches them in the extension. Once the request
Expand Down Expand Up @@ -74,7 +74,11 @@ mod tests {

/// Tide will use the the `Cookies`'s `Extract` implementation to build this parameter.
async fn retrieve_cookie(mut cx: Context<()>) -> String {
format!("{}", cx.get_cookie(COOKIE_NAME).unwrap().unwrap().value())
cx.get_cookie(COOKIE_NAME)
.unwrap()
.unwrap()
.value()
.to_string()
}

async fn set_cookie(mut cx: Context<()>) {
Expand Down Expand Up @@ -109,8 +113,7 @@ mod tests {
.header(http::header::COOKIE, "testCookie=RequestCookieValue")
.body(Body::empty())
.unwrap();
let res = server.simulate(req).unwrap();
res
server.simulate(req).unwrap()
}

#[test]
Expand Down

0 comments on commit 85b85e9

Please sign in to comment.