Run asset_tweak tests separately

+ Make parse_all_ron_files_to_value panic-friendly. Remove unwraps
to unwrap_or_else with panic message.
This commit is contained in:
juliancoffee 2021-07-04 16:55:14 +03:00
parent 89b71dc9a9
commit 33a37a8857
2 changed files with 7 additions and 4 deletions

View File

@ -8,8 +8,9 @@ unittests:
- ln -s /dockercache/target target
- rm -r target/debug/incremental/veloren_* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
- cargo test --package veloren-i18n --lib test_all_localizations -- --nocapture --ignored
- cargo test --package veloren-common-assets asset_tweak::tests --features asset_tweak --lib
- rm -r target/debug/incremental* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
- cargo test --features asset_tweak
- cargo test
retry:
max: 2

View File

@ -250,7 +250,6 @@ pub fn path_of(specifier: &str, ext: &str) -> PathBuf {
#[cfg(test)]
mod tests {
use std::{ffi::OsStr, fs::File};
use walkdir::WalkDir;
@ -260,7 +259,10 @@ mod tests {
let ext = OsStr::new("ron");
WalkDir::new(crate::ASSETS_PATH.as_path())
.into_iter()
.map(|ent| ent.unwrap().into_path())
.map(|ent| {
ent.expect("Failed to walk over asset directory")
.into_path()
})
.filter(|path| path.is_file())
.filter(|path| {
path.extension()
@ -268,7 +270,7 @@ mod tests {
.unwrap_or(false)
})
.for_each(|path| {
let file = File::open(&path).unwrap();
let file = File::open(&path).expect("Failed to open the file");
if let Err(err) = ron::de::from_reader::<_, ron::Value>(file) {
println!("{:?}", path);
println!("{:#?}", err);