Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
Integration test timeouts (#12)
Browse files Browse the repository at this point in the history
* increase integration test timeouts

* gzip enabled by default

* increase timeouts more

* version bump

* make it build on stable and beta too
  • Loading branch information
jgrillo committed Jan 28, 2018
1 parent d52cc44 commit ee21ecf
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ matrix:
allow_failures:
- rust: nightly
script: cargo test --features integration
notifications:
email:
- jesse.grillo@gmail.com
on_failure: always
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "Apache-2.0"
documentation = "https://jgrillo.github.io/forecast-rs/"
repository = "https://github.com/jgrillo/forecast-rs"
keywords = ["forecast", "weather", "darksky"]
version = "1.0.0"
version = "1.0.1"
authors = ["Jesse C. Grillo <jesse.grillo@gmail.com>"]

[features]
Expand Down
27 changes: 23 additions & 4 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ extern crate forecast;
use std::error::Error;
use std::fs::File;
use std::path::{PathBuf, Path};
use std::time::Duration;

use reqwest::{Client, StatusCode};

Expand All @@ -35,6 +36,8 @@ const LAT: f64 = 42.3736;
const LONG: f64 = -71.1097;
const TIME: u64 = 1505899999;

const TIMEOUT_SECS: u64 = 60;

// tests for serde models

fn test_response_serde(path: &Path) {
Expand Down Expand Up @@ -84,7 +87,11 @@ fn test_response_serde_01_21_2018() {
fn test_get_forecast_request_default() {
let api_key = env!("FORECAST_API_KEY");

let reqwest_client = Client::new();
let reqwest_client = Client::builder()
.timeout(Duration::from_secs(TIMEOUT_SECS))
.build()
.unwrap();

let api_client = ApiClient::new(&reqwest_client);

let forecast_request = ForecastRequestBuilder::new(api_key, LAT, LONG).build();
Expand All @@ -109,7 +116,11 @@ fn test_get_forecast_request_default() {
fn test_get_forecast_request_full() {
let api_key = env!("FORECAST_API_KEY");

let reqwest_client = Client::new();
let reqwest_client = Client::builder()
.timeout(Duration::from_secs(TIMEOUT_SECS))
.build()
.unwrap();

let api_client = ApiClient::new(&reqwest_client);

let mut blocks = vec![ExcludeBlock::Alerts];
Expand Down Expand Up @@ -143,7 +154,11 @@ fn test_get_forecast_request_full() {
fn test_get_time_machine_request_default() {
let api_key = env!("FORECAST_API_KEY");

let reqwest_client = Client::new();
let reqwest_client = Client::builder()
.timeout(Duration::from_secs(TIMEOUT_SECS))
.build()
.unwrap();

let api_client = ApiClient::new(&reqwest_client);

let time_machine_request = TimeMachineRequestBuilder::new(
Expand All @@ -170,7 +185,11 @@ fn test_get_time_machine_request_default() {
fn test_get_time_machine_request_full() {
let api_key = env!("FORECAST_API_KEY");

let reqwest_client = Client::new();
let reqwest_client = Client::builder()
.timeout(Duration::from_secs(TIMEOUT_SECS))
.build()
.unwrap();

let api_client = ApiClient::new(&reqwest_client);

let mut blocks = vec![ExcludeBlock::Daily];
Expand Down

0 comments on commit ee21ecf

Please sign in to comment.