Skip to content

Commit

Permalink
AVRO-3794: [Rust] Do not fail the shared tests when the shared folder…
Browse files Browse the repository at this point in the history
… is not available (#2330)

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g authored Jul 8, 2023
1 parent 126c19b commit e503f2e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lang/rust/avro/tests/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ use std::{
const ROOT_DIRECTORY: &str = "../../../share/test/data/schemas";

#[test]
fn test_schema() -> TestResult {
let directory: ReadDir = scan_shared_folder();
fn aa_test_schema() -> TestResult {
let directory: ReadDir = match std::fs::read_dir(ROOT_DIRECTORY) {
Ok(root_folder) => root_folder,
Err(err) => {
log::warn!("Can't read the root folder: {err}");
return Ok(());
}
};
let mut result: Result<(), ErrorsDesc> = Ok(());
for f in directory {
let entry: DirEntry = match f {
Expand Down Expand Up @@ -143,7 +149,3 @@ fn test_folder(folder: &str) -> Result<(), ErrorsDesc> {
}
result
}

fn scan_shared_folder() -> ReadDir {
std::fs::read_dir(ROOT_DIRECTORY).expect("Can't read root folder")
}

0 comments on commit e503f2e

Please sign in to comment.