aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-server/src/plugins/unit/plugin_tests.rs
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-06-28 16:47:43 +0200
committerGitHub <noreply@github.com>2024-06-28 16:47:43 +0200
commit7d7848cddcb303a8bdce6dd1431841345e9f6267 (patch)
tree3353b66dfc8a18cdea5d006b57f0c05b9e277be1 /zellij-server/src/plugins/unit/plugin_tests.rs
parentdocs(changelog): mouse fix (diff)
downloadsl0ppij-7d7848cddcb303a8bdce6dd1431841345e9f6267.tar.gz
sl0ppij-7d7848cddcb303a8bdce6dd1431841345e9f6267.tar.xz
sl0ppij-7d7848cddcb303a8bdce6dd1431841345e9f6267.zip
dependencies: switch from Wasmer to Wasmtime (#3349)
* Remove ForeignFunctionEnv wrapper around PluginEnv This will enable PluginEnv to be the Store context when migrating to Wasmtime. * Pass PluginEnv by value to load_plugin_instance This will allow removing the Clone impl from PluginEnv when migrating to Wasmtime as required by the missing Clone impl on Wasmtime's WasiCtx. * Avoid passing a Store around when an Engine is enough * Pass PluginEnv to the wasi read/write functions Wasmtime requires storing the read/write end of the pipe outside of the WasiCtx. Passing PluginEnv to these functions allows storing them in the PluginEnv. * Migrate to Wasmtime * Switch from wasi-common to wasmtime-wasi * Reduce verbosity of wasmtime_wasi logs * Increase startup delay To wait for all plugins to be compiled. * Disable some wasmtime features * Update to Wasmtime 21.0.1
Diffstat (limited to 'zellij-server/src/plugins/unit/plugin_tests.rs')
-rw-r--r--zellij-server/src/plugins/unit/plugin_tests.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/zellij-server/src/plugins/unit/plugin_tests.rs b/zellij-server/src/plugins/unit/plugin_tests.rs
index b644fe2f..6743d5e7 100644
--- a/zellij-server/src/plugins/unit/plugin_tests.rs
+++ b/zellij-server/src/plugins/unit/plugin_tests.rs
@@ -5,7 +5,7 @@ use insta::assert_snapshot;
use std::collections::BTreeMap;
use std::path::PathBuf;
use tempfile::tempdir;
-use wasmer::Store;
+use wasmtime::Engine;
use zellij_utils::data::{
BareKey, Event, KeyWithModifier, PermissionStatus, PermissionType, PluginCapabilities,
};
@@ -247,7 +247,7 @@ fn create_plugin_thread(
None,
)
.should_silently_fail();
- let store = Store::new(wasmer::Singlepass::default());
+ let engine = Engine::new(wasmtime::Config::new().strategy(wasmtime::Strategy::Winch)).unwrap();
let data_dir = PathBuf::from(tempdir().unwrap().path());
let default_shell = PathBuf::from(".");
let plugin_capabilities = PluginCapabilities::default();
@@ -270,7 +270,7 @@ fn create_plugin_thread(
set_var("ZELLIJ_SESSION_NAME", "zellij-test");
plugin_thread_main(
plugin_bus,
- store,
+ engine,
data_dir,
Box::new(Layout::default()),
None,
@@ -337,7 +337,7 @@ fn create_plugin_thread_with_server_receiver(
None,
)
.should_silently_fail();
- let store = Store::new(wasmer::Singlepass::default());
+ let engine = Engine::new(wasmtime::Config::new().strategy(wasmtime::Strategy::Winch)).unwrap();
let data_dir = PathBuf::from(tempdir().unwrap().path());
let default_shell = PathBuf::from(".");
let plugin_capabilities = PluginCapabilities::default();
@@ -349,7 +349,7 @@ fn create_plugin_thread_with_server_receiver(
set_var("ZELLIJ_SESSION_NAME", "zellij-test");
plugin_thread_main(
plugin_bus,
- store,
+ engine,
data_dir,
Box::new(Layout::default()),
None,
@@ -422,7 +422,7 @@ fn create_plugin_thread_with_pty_receiver(
None,
)
.should_silently_fail();
- let store = Store::new(wasmer::Singlepass::default());
+ let engine = Engine::new(wasmtime::Config::new().strategy(wasmtime::Strategy::Winch)).unwrap();
let data_dir = PathBuf::from(tempdir().unwrap().path());
let default_shell = PathBuf::from(".");
let plugin_capabilities = PluginCapabilities::default();
@@ -434,7 +434,7 @@ fn create_plugin_thread_with_pty_receiver(
set_var("ZELLIJ_SESSION_NAME", "zellij-test");
plugin_thread_main(
plugin_bus,
- store,
+ engine,
data_dir,
Box::new(Layout::default()),
None,
@@ -502,7 +502,7 @@ fn create_plugin_thread_with_background_jobs_receiver(
None,
)
.should_silently_fail();
- let store = Store::new(wasmer::Singlepass::default());
+ let engine = Engine::new(wasmtime::Config::new().strategy(wasmtime::Strategy::Winch)).unwrap();
let data_dir = PathBuf::from(tempdir().unwrap().path());
let default_shell = PathBuf::from(".");
let plugin_capabilities = PluginCapabilities::default();
@@ -514,7 +514,7 @@ fn create_plugin_thread_with_background_jobs_receiver(
set_var("ZELLIJ_SESSION_NAME", "zellij-test");
plugin_thread_main(
plugin_bus,
- store,
+ engine,
data_dir,
Box::new(Layout::default()),
None,