Skip to content

Commit

Permalink
build: disable mariadb and mysql tests on when running on github for …
Browse files Browse the repository at this point in the history
…non-linux platforms
  • Loading branch information
brianheineman committed Oct 2, 2024
1 parent 6b3b51e commit f5de33e
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
17 changes: 17 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion rsql_drivers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ workspace = true

[dev-dependencies]
test-log = { workspace = true }
testcontainers = { workspace = true }
testcontainers = { workspace = true, features = ["watchdog"] }
testcontainers-modules = { workspace = true, features = ["mariadb", "mssql_server", "mysql"] }
tokio = { workspace = true }
wiremock = { workspace = true }
Expand Down
5 changes: 5 additions & 0 deletions rsql_drivers/src/mariadb/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ mod test {
#[allow(dead_code)]
#[tokio::test]
async fn test_container() -> anyhow::Result<()> {
// Skip tests on GitHub Actions for non-Linux platforms; the test containers fail to run.
if std::env::var("GITHUB_ACTIONS").is_ok() && !cfg!(target_os = "linux") {
return Ok(());
}

let mysql_image = testcontainers::ContainerRequest::from(
testcontainers_modules::mariadb::Mariadb::default(),
);
Expand Down
5 changes: 5 additions & 0 deletions rsql_drivers/src/mysql/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ mod test {
#[allow(dead_code)]
#[tokio::test]
async fn test_container() -> anyhow::Result<()> {
// Skip tests on GitHub Actions for non-Linux platforms; the test containers fail to run.
if std::env::var("GITHUB_ACTIONS").is_ok() && !cfg!(target_os = "linux") {
return Ok(());
}

let mysql_image =
testcontainers::ContainerRequest::from(testcontainers_modules::mysql::Mysql::default());
let container = mysql_image.start().await?;
Expand Down
5 changes: 5 additions & 0 deletions rsql_drivers/src/mysql/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ mod test {
#[allow(dead_code)]
#[tokio::test]
async fn test_container() -> anyhow::Result<()> {
// Skip tests on GitHub Actions for non-Linux platforms; the test containers fail to run.
if std::env::var("GITHUB_ACTIONS").is_ok() && !cfg!(target_os = "linux") {
return Ok(());
}

let mysql_image =
testcontainers::ContainerRequest::from(testcontainers_modules::mysql::Mysql::default());
let container = mysql_image.start().await?;
Expand Down

0 comments on commit f5de33e

Please sign in to comment.