Skip to content

Commit

Permalink
Thread safe tests and --ignored note
Browse files Browse the repository at this point in the history
  • Loading branch information
marioortizmanero committed Aug 16, 2020
1 parent b02f202 commit fb67d1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/test_with_credential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ use rspotify::client::Spotify;
use rspotify::oauth2::SpotifyClientCredentials;
use rspotify::senum::{AlbumType, Country};

use std::sync::Mutex;
use std::sync::{Arc, Mutex};

use lazy_static::lazy_static;

lazy_static! {
// Set client_id and client_secret in .env file or
// export CLIENT_ID="your client_id"
// export CLIENT_SECRET="secret"
static ref CLIENT_CREDENTIAL: Mutex<SpotifyClientCredentials> = Mutex::new(SpotifyClientCredentials::default().build());
static ref CLIENT_CREDENTIAL: Arc<Mutex<SpotifyClientCredentials>> = Arc::new(Mutex::new(SpotifyClientCredentials::default().build()));
}

#[tokio::test]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_with_oauth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use rspotify::senum::{Country, RepeatState, SearchType, TimeRange};
use rspotify::util::get_token;

// Because of all these tests need to poll up the browser, it is impossible to
// run in a CI envirnment like travis, so I just ignore them all. You could
// delete the #[ignore] tag, and run it on your local machine.
// run in a CI environment like travis, so I just ignore them all. The
// --ignored flag can be used with `cargo test` to manually run them.

#[tokio::test]
#[ignore]
Expand Down

0 comments on commit fb67d1b

Please sign in to comment.