1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

refactor(cli/tools/test): infer disable log from program state (#11803)

This commit is contained in:
Casper Beyer 2021-08-23 22:03:57 +08:00 committed by GitHub
parent dbcdd3a18e
commit 2c17045aa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 18 deletions

View file

@ -102,7 +102,6 @@ pub enum DenoSubcommand {
doc: bool,
no_run: bool,
fail_fast: Option<NonZeroUsize>,
quiet: bool,
allow_none: bool,
include: Option<Vec<String>>,
filter: Option<String>,
@ -1772,7 +1771,6 @@ fn test_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
let no_run = matches.is_present("no-run");
let doc = matches.is_present("doc");
let allow_none = matches.is_present("allow-none");
let quiet = matches.is_present("quiet");
let filter = matches.value_of("filter").map(String::from);
let fail_fast = if matches.is_present("fail-fast") {
@ -1837,7 +1835,6 @@ fn test_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
no_run,
doc,
fail_fast,
quiet,
include,
filter,
shuffle,
@ -3566,7 +3563,6 @@ mod tests {
fail_fast: None,
filter: Some("- foo".to_string()),
allow_none: true,
quiet: false,
include: Some(svec!["dir1/", "dir2/"]),
shuffle: None,
concurrent_jobs: NonZeroUsize::new(1).unwrap(),
@ -3634,7 +3630,6 @@ mod tests {
fail_fast: None,
filter: None,
allow_none: false,
quiet: false,
shuffle: None,
include: None,
concurrent_jobs: NonZeroUsize::new(4).unwrap(),
@ -3659,7 +3654,6 @@ mod tests {
fail_fast: Some(NonZeroUsize::new(3).unwrap()),
filter: None,
allow_none: false,
quiet: false,
shuffle: None,
include: None,
concurrent_jobs: NonZeroUsize::new(1).unwrap(),
@ -3688,7 +3682,6 @@ mod tests {
fail_fast: None,
filter: None,
allow_none: false,
quiet: false,
shuffle: None,
include: None,
concurrent_jobs: NonZeroUsize::new(1).unwrap(),
@ -3711,7 +3704,6 @@ mod tests {
fail_fast: None,
filter: None,
allow_none: false,
quiet: false,
shuffle: Some(1),
include: None,
concurrent_jobs: NonZeroUsize::new(1).unwrap(),
@ -3734,7 +3726,6 @@ mod tests {
fail_fast: None,
filter: None,
allow_none: false,
quiet: false,
shuffle: None,
include: None,
concurrent_jobs: NonZeroUsize::new(1).unwrap(),

View file

@ -1005,7 +1005,6 @@ async fn test_command(
no_run: bool,
doc: bool,
fail_fast: Option<NonZeroUsize>,
quiet: bool,
allow_none: bool,
filter: Option<String>,
shuffle: Option<u64>,
@ -1216,7 +1215,6 @@ async fn test_command(
test_modules_to_reload,
no_run,
fail_fast,
quiet,
true,
filter.clone(),
shuffle,
@ -1252,7 +1250,6 @@ async fn test_command(
test_modules,
no_run,
fail_fast,
quiet,
allow_none,
filter,
shuffle,
@ -1355,7 +1352,6 @@ fn get_subcommand(
no_run,
doc,
fail_fast,
quiet,
include,
allow_none,
filter,
@ -1367,7 +1363,6 @@ fn get_subcommand(
no_run,
doc,
fail_fast,
quiet,
allow_none,
filter,
shuffle,

View file

@ -21,6 +21,7 @@ use deno_core::serde_json::json;
use deno_core::JsRuntime;
use deno_core::ModuleSpecifier;
use deno_runtime::permissions::Permissions;
use log::Level;
use rand::rngs::SmallRng;
use rand::seq::SliceRandom;
use rand::SeedableRng;
@ -200,7 +201,6 @@ pub async fn test_specifier(
program_state: Arc<ProgramState>,
main_module: ModuleSpecifier,
permissions: Permissions,
quiet: bool,
filter: Option<String>,
shuffle: Option<u64>,
channel: Sender<TestEvent>,
@ -228,7 +228,7 @@ pub async fn test_specifier(
test_source.push_str(&format!(
"await Deno[Deno.internal].runTests({});\n",
json!({
"disableLog": quiet,
"disableLog": program_state.flags.log_level == Some(Level::Error),
"filter": filter,
"shuffle": shuffle,
}),
@ -470,7 +470,6 @@ pub async fn run_tests(
test_modules: Vec<ModuleSpecifier>,
no_run: bool,
fail_fast: Option<NonZeroUsize>,
quiet: bool,
allow_none: bool,
filter: Option<String>,
shuffle: Option<u64>,
@ -559,7 +558,6 @@ pub async fn run_tests(
program_state,
main_module,
permissions,
quiet,
filter,
shuffle,
sender,