Skip to content

Commit

Permalink
Fixed file checkpointing tests and added crate tests to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-k committed Jan 18, 2024
1 parent 6936aa0 commit 8ed3b25
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ jobs:
- name: Test
run: cargo test -p argmin-observer-paramwriter

tests-argmin-checkpointing-file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Test
run: cargo test -p argmin-checkpointing-file

tests-argmin-observer-spectator:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 0 additions & 1 deletion argmin/src/core/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ mod tests {

/// The solver's `init` should not be called when started from a checkpoint.
/// See https://github.com/argmin-rs/argmin/issues/199.
// #[cfg(feature = "serde1")]
#[test]
#[cfg(feature = "serde1")]
fn test_checkpointing_solver_initialization() {
Expand Down
3 changes: 3 additions & 0 deletions checkpointing/file/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ exclude = []
argmin = { version = "0.9.0", path = "../../argmin", default-features = false }
bincode = "1.3.3"
serde = "1.0.195"

[dev-dependencies]
argmin = { version = "0.9.0", path = "../../argmin", features = ["serde1"] }
Binary file added checkpointing/file/checkpoints/solver.arg
Binary file not shown.
11 changes: 4 additions & 7 deletions checkpointing/file/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl Default for FileCheckpoint {
/// # Example
///
/// ```
/// use argmin::core::checkpointing::FileCheckpoint;
/// use argmin_checkpointing_file::FileCheckpoint;
/// # use argmin::core::checkpointing::CheckpointingFrequency;
/// # use std::path::PathBuf;
///
Expand All @@ -56,8 +56,7 @@ impl FileCheckpoint {
/// # Example
///
/// ```
/// use argmin::core::checkpointing::CheckpointingFrequency;
/// use argmin_checkpointing_file::FileCheckpoint;
/// use argmin_checkpointing_file::{FileCheckpoint, CheckpointingFrequency};
/// # use std::path::PathBuf;
///
/// let directory = "checkpoints";
Expand Down Expand Up @@ -93,8 +92,7 @@ where
/// # Example
///
/// ```
/// use argmin::core::checkpointing::CheckpointingFrequency;
/// use argmin_checkpointing_file::FileCheckpoint;
/// use argmin_checkpointing_file::{FileCheckpoint, CheckpointingFrequency, Checkpoint};
///
/// # use std::fs::File;
/// # use std::io::BufReader;
Expand Down Expand Up @@ -129,8 +127,7 @@ where
/// # Example
///
/// ```
/// use argmin::core::checkpointing::CheckpointingFrequency;
/// use argmin_checkpointing_file::FileCheckpoint
/// use argmin_checkpointing_file::{FileCheckpoint, CheckpointingFrequency, Checkpoint};
/// # use argmin::core::Error;
///
/// # use std::fs::File;
Expand Down

0 comments on commit 8ed3b25

Please sign in to comment.