Skip to content

Commit

Permalink
try macos kaleido
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Gherghescu <[email protected]>
  • Loading branch information
andrei-ng committed Dec 20, 2024
1 parent 45c1b05 commit 8c3c3e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
15 changes: 7 additions & 8 deletions plotly/src/plot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ impl PartialEq for Plot {
mod tests {
use std::path::PathBuf;

use base64::{engine::general_purpose, Engine as _};
use serde_json::{json, to_value};

use super::*;
Expand Down Expand Up @@ -748,7 +749,7 @@ mod tests {
assert!(!dst.exists());
}

#[cfg(target_os = "linux")]
// #[cfg(target_os = "linux")]
#[test]
#[cfg(feature = "kaleido")]
fn test_save_to_png() {
Expand All @@ -760,7 +761,7 @@ mod tests {
assert!(!dst.exists());
}

#[cfg(target_os = "linux")]
// #[cfg(target_os = "linux")]
#[test]
#[cfg(feature = "kaleido")]
fn test_save_to_jpeg() {
Expand All @@ -772,7 +773,7 @@ mod tests {
assert!(!dst.exists());
}

#[cfg(target_os = "linux")]
// #[cfg(target_os = "linux")]
#[test]
#[cfg(feature = "kaleido")]
fn test_save_to_svg() {
Expand All @@ -796,7 +797,7 @@ mod tests {
assert!(!dst.exists());
}

#[cfg(target_os = "linux")]
// #[cfg(target_os = "linux")]
#[test]
#[cfg(feature = "kaleido")]
fn test_save_to_pdf() {
Expand All @@ -820,12 +821,10 @@ mod tests {
assert!(!dst.exists());
}

#[cfg(target_os = "linux")]
// #[cfg(target_os = "linux")]
#[test]
#[cfg(feature = "kaleido")]
fn test_image_to_base64() {
use base64::engine::general_purpose;
use base64::Engine;
let plot = create_test_plot();

let image_base64 = plot.to_base64(ImageFormat::PNG, 200, 150, 1.0);
Expand All @@ -850,7 +849,7 @@ mod tests {
assert!(image_base64.is_empty());
}

#[cfg(target_os = "linux")]
// #[cfg(target_os = "linux")]
#[test]
#[cfg(feature = "kaleido")]
fn test_image_to_svg_string() {
Expand Down
10 changes: 5 additions & 5 deletions plotly_kaleido/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ mod tests {
}

// This seems to fail unpredictably on MacOs.
#[cfg(target_os = "linux")]
// #[cfg(target_os = "linux")]
#[test]
fn test_save_png() {
let test_plot = create_test_plot();
Expand All @@ -309,7 +309,7 @@ mod tests {
}

// This seems to fail unpredictably on MacOs.
#[cfg(target_os = "linux")]
// #[cfg(target_os = "linux")]
#[test]
fn test_save_jpeg() {
let test_plot = create_test_plot();
Expand All @@ -321,7 +321,7 @@ mod tests {
}

// This seems to fail unpredictably on MacOs.
#[cfg(target_os = "linux")]
// #[cfg(target_os = "linux")]
#[test]
fn test_save_webp() {
let test_plot = create_test_plot();
Expand All @@ -333,7 +333,7 @@ mod tests {
}

// This seems to fail unpredictably on MacOs.
#[cfg(target_os = "linux")]
// #[cfg(target_os = "linux")]
#[test]
fn test_save_svg() {
let test_plot = create_test_plot();
Expand All @@ -345,7 +345,7 @@ mod tests {
}

// This seems to fail unpredictably on MacOs.
#[cfg(target_os = "linux")]
// #[cfg(target_os = "linux")]
#[test]
fn test_save_pdf() {
let test_plot = create_test_plot();
Expand Down

0 comments on commit 8c3c3e4

Please sign in to comment.