Skip to content

Commit

Permalink
Re-enable a BinaryPackage test
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-F-Bryan committed Oct 27, 2023
1 parent cb2ee79 commit 89defc0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ required-features = ["backend"]
[[example]]
name = "errors"
path = "examples/errors.rs"
required-features = ["sys"]
required-features = ["backend"]

[[example]]
name = "imported-function-env"
Expand Down
14 changes: 10 additions & 4 deletions lib/wasix/src/bin_factory/binary_package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,16 @@ mod tests {
use tempfile::TempDir;
use virtual_fs::AsyncReadExt;

use crate::{runtime::task_manager::VirtualTaskManager, PluggableRuntime};
use crate::{
runtime::{package_loader::BuiltinPackageLoader, task_manager::VirtualTaskManager},
PluggableRuntime,
};

use super::*;

fn task_manager() -> Arc<dyn VirtualTaskManager + Send + Sync> {
cfg_if::cfg_if! {
if #[cfg(feature = "sys-threads")] {
if #[cfg(feature = "sys-thread")] {
Arc::new(crate::runtime::task_manager::tokio::TokioTaskManager::new(tokio::runtime::Handle::current()))
} else {
unimplemented!("Unable to get the task manager")
Expand All @@ -173,7 +176,7 @@ mod tests {

#[tokio::test]
#[cfg_attr(
not(feature = "sys-threads"),
not(feature = "sys-thread"),
ignore = "The tokio task manager isn't available on this platform"
)]
async fn fs_table_can_map_directories_to_different_names() {
Expand All @@ -197,7 +200,10 @@ mod tests {
.unwrap()
.into();
let tasks = task_manager();
let runtime = PluggableRuntime::new(tasks);
let mut runtime = PluggableRuntime::new(tasks);
runtime.set_package_loader(BuiltinPackageLoader::new_only_client(
runtime.http_client().unwrap().clone(),
));

let pkg = BinaryPackage::from_webc(&webc, &runtime).await.unwrap();

Expand Down
2 changes: 0 additions & 2 deletions lib/wasix/src/os/console/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,6 @@ mod tests {
/// Regression test to ensure merging of multiple packages works correctly.
#[test]
fn test_console_python_merge() {
std::env::set_var("RUST_LOG", "wasmer_wasix=trace");
tracing_subscriber::fmt::init();
let tokio_rt = tokio::runtime::Runtime::new().unwrap();
let rt_handle = tokio_rt.handle().clone();
let _guard = rt_handle.enter();
Expand Down

0 comments on commit 89defc0

Please sign in to comment.