Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows test #669

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading