Skip to content

Commit

Permalink
Windows test
Browse files Browse the repository at this point in the history
  • Loading branch information
paraseba committed Feb 3, 2025
1 parent 9e63119 commit 6ddf191
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/windows-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Windows tests
on:
pull_request:
types: [opened, reopened, synchronize, labeled]
push:
branches:
- main

env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CI: 1
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings -W unreachable-pub -W bare-trait-objects"
RUSTUP_MAX_RETRIES: 10

jobs:
rust:
name: Run rust tests in windows
timeout-minutes: 20
runs-on: windows-latest
#defaults:
# run:
# working-directory: ./
#permissions:
#contents: read
#actions: read
#pull-requests: read
env:
#CC: deny_c
RUST_CHANNEL: 'stable'


steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install Rust toolchain
run: |
rustup update --no-self-update ${{ env.RUST_CHANNEL }}
rustup component add --toolchain ${{ env.RUST_CHANNEL }} rustfmt rust-src clippy
rustup default ${{ env.RUST_CHANNEL }}
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
with:
# workspaces: "rust -> target"
key: windows-${{ env.RUST_CHANNEL }}

- name: Check
run: |
cargo test --lib
19 changes: 18 additions & 1 deletion icechunk/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,27 @@ pub fn new_gcs_storage(
#[allow(clippy::unwrap_used)]
mod tests {

use std::collections::HashSet;
use std::{collections::HashSet, fs::File, io::Write, path::PathBuf};

use super::*;
use proptest::prelude::*;
use tempfile::TempDir;

#[tokio::test]
async fn test_is_clean() {
let repo_dir = TempDir::new().unwrap();
let s = new_local_filesystem_storage(repo_dir.path()).unwrap();
assert!(s.root_is_clean().await.unwrap());

let mut file = File::create(repo_dir.path().join("foo.txt")).unwrap();
write!(file, "hello").unwrap();
assert!(!s.root_is_clean().await.unwrap());

let inside_existing =
PathBuf::from_iter([repo_dir.path().as_os_str().to_str().unwrap(), "foo"]);
let s = new_local_filesystem_storage(&inside_existing).unwrap();
assert!(s.root_is_clean().await.unwrap());
}

proptest! {
#![proptest_config(ProptestConfig {
Expand Down
4 changes: 3 additions & 1 deletion icechunk/src/storage/object_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ impl ObjectStorage {
.map_err(|e| StorageError::Other(e.to_string()))?;
let prefix =
prefix.into_os_string().into_string().map_err(StorageError::BadPrefix)?;
let url = format!("file://{prefix}");
dbg!(&prefix);
let url = format!("file:///{prefix}");
dbg!(&url);
let config = ObjectStorageConfig { url, prefix, options: vec![] };
Self::from_config(config)
}
Expand Down

0 comments on commit 6ddf191

Please sign in to comment.