Skip to content

Commit

Permalink
Mark environment variable tests serial
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <[email protected]>
  • Loading branch information
gaborbernat committed Oct 23, 2024
1 parent 57325a9 commit 5feeb8a
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
78 changes: 78 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions axoupdater/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ self-replace = "1.5.0"
[dev-dependencies]
tokio = { version = "1.36.0", features = ["test-util"] }
httpmock = "0.7.0"
serial_test = "3.1.1"
6 changes: 6 additions & 0 deletions axoupdater/src/release/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ mod test {
use axoasset::reqwest::StatusCode;
use axoasset::serde_json::json;
use httpmock::prelude::*;
use serial_test::serial;
use std::env;

#[test]
Expand Down Expand Up @@ -321,6 +322,7 @@ mod test {
}

#[test]
#[serial] // modifying the global state environment variables
fn test_github_api_no_env_var() {
env::remove_var("INSTALLER_DOWNLOAD_URL");
let result = github_api();
Expand All @@ -329,6 +331,7 @@ mod test {
}

#[test]
#[serial] // modifying the global state environment variables
fn test_github_api_overwrite() {
env::set_var("INSTALLER_DOWNLOAD_URL", "https://magic.com");
let result = github_api();
Expand All @@ -337,6 +340,7 @@ mod test {
}

#[tokio::test]
#[serial] // modifying the global state environment variables
async fn test_get_latest_github_release_custom_endpoint() {
let server = MockServer::start_async().await;
env::set_var("INSTALLER_DOWNLOAD_URL", server.base_url());
Expand Down Expand Up @@ -373,6 +377,7 @@ mod test {
}

#[tokio::test]
#[serial] // modifying the global state environment variables
async fn test_get_specific_github_tag_custom_endpoint() {
let server = MockServer::start_async().await;
env::set_var("INSTALLER_DOWNLOAD_URL", server.base_url());
Expand All @@ -395,6 +400,7 @@ mod test {
}

#[tokio::test]
#[serial] // modifying the global state environment variables
async fn test_get_github_releases_custom_endpoint() {
let server = MockServer::start_async().await;
env::set_var("INSTALLER_DOWNLOAD_URL", server.base_url());
Expand Down

0 comments on commit 5feeb8a

Please sign in to comment.