Skip to content

Commit

Permalink
Disabled proxy unit test as it's succeptible to race condition
Browse files Browse the repository at this point in the history
Cargo runs the test in multiple threads, but setting an environment
variable (here `HTTP_PROXY`) to a value _will_ break other tests that
assumes no variable were set.

Setting environment variable `RUST_TEST_THREAD` to 1 is not an option as
this would slow down the test phase.
  • Loading branch information
nbigaouette committed Dec 9, 2016
1 parent b1d6124 commit 98f611c
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/gitlab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,23 +320,6 @@ mod tests {
debug);
}

#[test]
fn gitlab_proxy() {
use std::env;

// NOTE: We cannot split this test in two, as tests are run in parallel their will be
// a race condition when setting the `HTTP_PROXY` environment variable.

// Use good proxy port. Should succeed.
env::set_var("HTTP_PROXY", "http://localhost:8000");
let _ = GitLab::new("gitlab.com", "XXXXXXXXXXXXXXXXXXXX").unwrap();

// Use bad proxy port. Constructor should fail
env::set_var("HTTP_PROXY", "http://localhost:abc");
let gl = GitLab::new("gitlab.com", "XXXXXXXXXXXXXXXXXXXX");
verify_err(&gl);
}

#[test]
fn gitlab_listers_groups() {
let gl = GitLab::new("gitlab.com", "XXXXXXXXXXXXXXXXXXXX").unwrap();
Expand Down

0 comments on commit 98f611c

Please sign in to comment.