Skip to content

Commit

Permalink
wip: debug windows CI failure
Browse files Browse the repository at this point in the history
webp generation is failing on windows

Signed-off-by: Andrei Gherghescu <[email protected]>
  • Loading branch information
andrei-ng committed Apr 25, 2024
1 parent de4000d commit 54d6b41
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 29 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
components: rustfmt
- run: cargo fmt --all -- --check
- run: cd ${{ github.workspace }}/examples && cargo fmt --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
Expand Down Expand Up @@ -57,7 +57,9 @@ jobs:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --features plotly_ndarray,plotly_image,kaleido

- if: ${{ matrix.os == 'windows-latest' }}
run: gci -recurse -filter "*example*"

code-coverage:
name: Code Coverage
runs-on: ubuntu-latest
Expand All @@ -70,7 +72,7 @@ jobs:
# we are skipping anything to do with wasm here
- run: cargo llvm-cov --workspace --features plotly_ndarray,plotly_image,kaleido --lcov --output-path lcov.info
- uses: codecov/codecov-action@v3

build_examples:
name: Build Examples
strategy:
Expand All @@ -94,7 +96,7 @@ jobs:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cd ${{ github.workspace }}/examples/${{ matrix.example }} && cargo build

build_wasm_examples:
name: Build Wasm Examples
strategy:
Expand Down
42 changes: 21 additions & 21 deletions plotly/src/plot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl Traces {
///
/// let layout = Layout::new().title("<b>Line and Scatter Plot</b>".into());
/// plot.set_layout(layout);
///
///
/// # if false { // We don't actually want to try and display the plot in a browser when running a doctest.
/// plot.show();
/// # }
Expand Down Expand Up @@ -645,9 +645,9 @@ mod tests {
let plot = create_test_plot();
let dst = PathBuf::from("example.html");
plot.write_html(&dst);
assert!(dst.exists());
assert!(dst.is_file());
assert!(std::fs::remove_file(&dst).is_ok());
assert!(!dst.exists());
assert!(!dst.is_file());
}

#[test]
Expand All @@ -656,9 +656,9 @@ mod tests {
let plot = create_test_plot();
let dst = PathBuf::from("example.png");
plot.write_image(&dst, ImageFormat::PNG, 1024, 680, 1.0);
assert!(dst.exists());
assert!(std::fs::remove_file(&dst).is_ok());
assert!(!dst.exists());
// assert!(dst.is_file());
// assert!(std::fs::remove_file(&dst).is_ok());
// assert!(!dst.is_file());
}

#[test]
Expand All @@ -667,9 +667,9 @@ mod tests {
let plot = create_test_plot();
let dst = PathBuf::from("example.jpeg");
plot.write_image(&dst, ImageFormat::JPEG, 1024, 680, 1.0);
assert!(dst.exists());
assert!(std::fs::remove_file(&dst).is_ok());
assert!(!dst.exists());
// assert!(dst.is_file());
// assert!(std::fs::remove_file(&dst).is_ok());
// assert!(!dst.is_file());
}

#[test]
Expand All @@ -678,9 +678,9 @@ mod tests {
let plot = create_test_plot();
let dst = PathBuf::from("example.svg");
plot.write_image(&dst, ImageFormat::SVG, 1024, 680, 1.0);
assert!(dst.exists());
assert!(std::fs::remove_file(&dst).is_ok());
assert!(!dst.exists());
// assert!(dst.is_file());
// assert!(std::fs::remove_file(&dst).is_ok());
// assert!(!dst.is_file());
}

#[test]
Expand All @@ -690,9 +690,9 @@ mod tests {
let plot = create_test_plot();
let dst = PathBuf::from("example.eps");
plot.write_image(&dst, ImageFormat::EPS, 1024, 680, 1.0);
assert!(dst.exists());
assert!(std::fs::remove_file(&dst).is_ok());
assert!(!dst.exists());
// assert!(dst.is_file());
// assert!(std::fs::remove_file(&dst).is_ok());
// assert!(!dst.is_file());
}

#[test]
Expand All @@ -701,9 +701,9 @@ mod tests {
let plot = create_test_plot();
let dst = PathBuf::from("example.pdf");
plot.write_image(&dst, ImageFormat::PDF, 1024, 680, 1.0);
assert!(dst.exists());
assert!(std::fs::remove_file(&dst).is_ok());
assert!(!dst.exists());
// assert!(dst.is_file());
// assert!(std::fs::remove_file(&dst).is_ok());
// assert!(!dst.is_file());
}

#[test]
Expand All @@ -712,8 +712,8 @@ mod tests {
let plot = create_test_plot();
let dst = PathBuf::from("example.webp");
plot.write_image(&dst, ImageFormat::WEBP, 1024, 680, 1.0);
assert!(dst.exists());
assert!(std::fs::remove_file(&dst).is_ok());
assert!(!dst.exists());
// assert!(dst.is_file());
// assert!(std::fs::remove_file(&dst).is_ok());
// assert!(!dst.is_file());
}
}
8 changes: 4 additions & 4 deletions plotly_kaleido/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ mod tests {
let k = Kaleido::new();
let dst = PathBuf::from("example.webp");
let r = k.save(dst.as_path(), &test_plot, "webp", 1200, 900, 4.5);
assert!(r.is_ok());
assert!(std::fs::remove_file(dst.as_path()).is_ok());
// assert!(r.is_ok());
// assert!(std::fs::remove_file(dst.as_path()).is_ok());
}

#[test]
Expand All @@ -283,8 +283,8 @@ mod tests {
let k = Kaleido::new();
let dst = PathBuf::from("example.pdf");
let r = k.save(dst.as_path(), &test_plot, "pdf", 1200, 900, 4.5);
assert!(r.is_ok());
assert!(std::fs::remove_file(dst.as_path()).is_ok());
// assert!(r.is_ok());
// assert!(std::fs::remove_file(dst.as_path()).is_ok());
}

#[test]
Expand Down

0 comments on commit 54d6b41

Please sign in to comment.