mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
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:
parent
89b71dc9a9
commit
33a37a8857
@ -8,8 +8,9 @@ unittests:
|
|||||||
- ln -s /dockercache/target target
|
- ln -s /dockercache/target target
|
||||||
- rm -r target/debug/incremental/veloren_* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
|
- 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-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
|
- rm -r target/debug/incremental* || echo "all good" # TMP FIX FOR 2021-03-22-nightly
|
||||||
- cargo test --features asset_tweak
|
- cargo test
|
||||||
retry:
|
retry:
|
||||||
max: 2
|
max: 2
|
||||||
|
|
||||||
|
@ -250,7 +250,6 @@ pub fn path_of(specifier: &str, ext: &str) -> PathBuf {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
||||||
use std::{ffi::OsStr, fs::File};
|
use std::{ffi::OsStr, fs::File};
|
||||||
use walkdir::WalkDir;
|
use walkdir::WalkDir;
|
||||||
|
|
||||||
@ -260,7 +259,10 @@ mod tests {
|
|||||||
let ext = OsStr::new("ron");
|
let ext = OsStr::new("ron");
|
||||||
WalkDir::new(crate::ASSETS_PATH.as_path())
|
WalkDir::new(crate::ASSETS_PATH.as_path())
|
||||||
.into_iter()
|
.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.is_file())
|
||||||
.filter(|path| {
|
.filter(|path| {
|
||||||
path.extension()
|
path.extension()
|
||||||
@ -268,7 +270,7 @@ mod tests {
|
|||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
})
|
})
|
||||||
.for_each(|path| {
|
.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) {
|
if let Err(err) = ron::de::from_reader::<_, ron::Value>(file) {
|
||||||
println!("{:?}", path);
|
println!("{:?}", path);
|
||||||
println!("{:#?}", err);
|
println!("{:#?}", err);
|
||||||
|
Loading…
Reference in New Issue
Block a user