summaryrefslogtreecommitdiff
path: root/cli/lsp/testing/execution.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/lsp/testing/execution.rs')
-rw-r--r--cli/lsp/testing/execution.rs40
1 files changed, 21 insertions, 19 deletions
diff --git a/cli/lsp/testing/execution.rs b/cli/lsp/testing/execution.rs
index 5dfb31013..4834cd0c9 100644
--- a/cli/lsp/testing/execution.rs
+++ b/cli/lsp/testing/execution.rs
@@ -6,11 +6,11 @@ use super::lsp_custom;
use crate::args::flags_from_vec;
use crate::args::DenoSubcommand;
+use crate::factory::CliFactory;
use crate::lsp::client::Client;
use crate::lsp::client::TestingNotification;
use crate::lsp::config;
use crate::lsp::logging::lsp_log;
-use crate::proc_state;
use crate::tools::test;
use crate::tools::test::FailFastTracker;
use crate::tools::test::TestEventSender;
@@ -218,16 +218,16 @@ impl TestRun {
let args = self.get_args();
lsp_log!("Executing test run with arguments: {}", args.join(" "));
let flags = flags_from_vec(args.into_iter().map(String::from).collect())?;
- let ps = proc_state::ProcState::from_flags(flags).await?;
+ let factory = CliFactory::from_flags(flags).await?;
// Various test files should not share the same permissions in terms of
// `PermissionsContainer` - otherwise granting/revoking permissions in one
// file would have impact on other files, which is undesirable.
let permissions =
- Permissions::from_options(&ps.options.permissions_options())?;
+ Permissions::from_options(&factory.cli_options().permissions_options())?;
test::check_specifiers(
- &ps.options,
- &ps.file_fetcher,
- &ps.module_load_preparer,
+ factory.cli_options(),
+ factory.file_fetcher()?,
+ factory.module_load_preparer().await?,
self
.queue
.iter()
@@ -236,18 +236,19 @@ impl TestRun {
)
.await?;
- let (concurrent_jobs, fail_fast) =
- if let DenoSubcommand::Test(test_flags) = ps.options.sub_command() {
- (
- test_flags
- .concurrent_jobs
- .unwrap_or_else(|| NonZeroUsize::new(1).unwrap())
- .into(),
- test_flags.fail_fast,
- )
- } else {
- unreachable!("Should always be Test subcommand.");
- };
+ let (concurrent_jobs, fail_fast) = if let DenoSubcommand::Test(test_flags) =
+ factory.cli_options().sub_command()
+ {
+ (
+ test_flags
+ .concurrent_jobs
+ .unwrap_or_else(|| NonZeroUsize::new(1).unwrap())
+ .into(),
+ test_flags.fail_fast,
+ )
+ } else {
+ unreachable!("Should always be Test subcommand.");
+ };
let (sender, mut receiver) = mpsc::unbounded_channel::<test::TestEvent>();
let sender = TestEventSender::new(sender);
@@ -259,7 +260,8 @@ impl TestRun {
let tests: Arc<RwLock<IndexMap<usize, test::TestDescription>>> =
Arc::new(RwLock::new(IndexMap::new()));
let mut test_steps = IndexMap::new();
- let worker_factory = Arc::new(ps.create_cli_main_worker_factory());
+ let worker_factory =
+ Arc::new(factory.create_cli_main_worker_factory().await?);
let join_handles = queue.into_iter().map(move |specifier| {
let specifier = specifier.clone();