Skip to content

Commit

Permalink
🐛 fix: Fix tests (mostly)
Browse files Browse the repository at this point in the history
  • Loading branch information
queer committed Jul 2, 2024
1 parent 71d299a commit ad1205c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
22 changes: 12 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ctor = "0.2.7"
disk-drive = "0.1.10"
eyre = "0.6.12"
flail = "0.3.0"
flop = "0.2.4"
flop = "0.2.7"
floppy-disk = "0.2.6"
futures-util = "0.3.30"
hyper = { version = "0.14.27", features = ["stream"] }
Expand Down
8 changes: 7 additions & 1 deletion src/artifact/tarball.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use floppy_disk::tokio_fs::TokioFloppyDisk;
use floppy_disk::FloppyDisk;
use smoosh::CompressionType;
use tokio::fs::File;
use tokio::fs::OpenOptions;
use tracing::*;

use crate::fs::MemFS;
Expand Down Expand Up @@ -150,7 +151,12 @@ impl ArtifactProducer for TarballProducer {
));
path
};
let mut compressed_tarball = File::open(&compressed_path).await?;
let mut compressed_tarball = OpenOptions::new()
.write(true)
.create(true)
.truncate(true)
.open(&compressed_path)
.await?;
smoosh::recompress(
&mut built_tarball,
&mut compressed_tarball,
Expand Down
6 changes: 4 additions & 2 deletions src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ pub fn test_init() {
let subscriber = tracing_subscriber::FmtSubscriber::builder()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.finish();
tracing::subscriber::set_global_default(subscriber)
.expect("setting default subscriber failed");
match tracing::subscriber::set_global_default(subscriber) {
Ok(_) => println!("set global tracing subscriber"),
Err(_) => println!("failed to set global tracing subscriber (already set?)"),
}
});
}

Expand Down

0 comments on commit ad1205c

Please sign in to comment.