mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-25 22:39:07 +00:00
Merge pull request #9095 from dotCooCoo/fix/flaky-filter-plugin-shortcut-test
Tests: the filter shortcut test no longer sees plug-ins another test installs
This commit is contained in:
@@ -1546,6 +1546,7 @@ mod tests {
|
||||
#[test]
|
||||
fn each_filter_plugin_is_a_result_of_its_own() {
|
||||
use vectorcraft_plugins::wat as tpl;
|
||||
let _names = crate::tests::SHARED_PLUGIN_NAMES.lock().unwrap_or_else(|e| e.into_inner());
|
||||
let (one, two) = ("test.UI.palette_filter-one", "test.UI.palette_filter-two");
|
||||
let (key_one, key_two) = (format!("plugin:{one}"), format!("plugin:{two}"));
|
||||
let install = |id: &str, params: &str| {
|
||||
@@ -1826,6 +1827,7 @@ mod tests {
|
||||
#[test]
|
||||
fn filter_plugins_with_one_name_show_their_ids() {
|
||||
use vectorcraft_plugins::wat as tpl;
|
||||
let _names = crate::tests::SHARED_PLUGIN_NAMES.lock().unwrap_or_else(|e| e.into_inner());
|
||||
let (one, two) = ("test.UI.palette_same-one", "test.UI.palette_same-two");
|
||||
for id in [one, two] {
|
||||
let manifest = format!(r#"{{"id":"{id}","name":"Same Name","version":"1","kind":"filter","params":{{"wiggle":{{"type":"bool"}}}}}}"#);
|
||||
|
||||
@@ -1642,6 +1642,7 @@ fn a_live_effect_plugin_installed_later_takes_a_shortcut_of_its_own() {
|
||||
#[test]
|
||||
fn each_filter_plugin_takes_a_shortcut_of_its_own() {
|
||||
use vectorcraft_plugins::wat as tpl;
|
||||
let _names = crate::tests::SHARED_PLUGIN_NAMES.lock().unwrap_or_else(|e| e.into_inner());
|
||||
let (one, two) = ("test.UI.key_filter-one", "test.UI.key_filter-two");
|
||||
let (key_one, key_two) = (format!("plugin:{one}"), format!("plugin:{two}"));
|
||||
let install = |id: &str, name: &str, params: &str| {
|
||||
|
||||
@@ -56,3 +56,8 @@ mod tab_reorder;
|
||||
pub(crate) mod taskbar;
|
||||
mod toolescape;
|
||||
mod trace_runs;
|
||||
|
||||
/// Installed plug-ins are process-wide. Tests that install filter plug-ins under a name another
|
||||
/// test also installs, or that check how plug-ins sharing a name are told apart, hold this lock
|
||||
/// while their plug-ins are installed, so each sees only its own plug-ins under that name.
|
||||
pub(super) static SHARED_PLUGIN_NAMES: std::sync::Mutex<()> = std::sync::Mutex::new(());
|
||||
|
||||
Reference in New Issue
Block a user