Configuration class

A class that encapsulates the command-line configuration of the test runner.

Constructors

Configuration({required bool? help, required String? customHtmlTemplatePath, required bool? version, required bool? pauseAfterLoad, required bool? debug, required bool? color, required String? configurationPath, required String? reporter, required Map<String, String>? fileReporters, required String? coverage, required int? concurrency, required int? shardIndex, required int? totalShards, required Map<String, Set<TestSelection>>? testSelections, required Iterable<String>? foldTraceExcept, required Iterable<String>? foldTraceOnly, required Glob? filename, required Iterable<String>? chosenPresets, required Map<String, Configuration>? presets, required Map<String, RuntimeSettings>? overrideRuntimes, required Map<String, CustomRuntime>? defineRuntimes, required bool? noRetry, required int? testRandomizeOrderingSeed, required bool? stopOnFirstFailure, required bool? allowDuplicateTestNames, required bool? allowTestRandomization, required bool? jsTrace, required bool? runSkipped, required Iterable<String>? dart2jsArgs, required String? precompiledPath, required Iterable<Pattern>? globalPatterns, required Iterable<CompilerSelection>? compilerSelections, required Iterable<RuntimeSelection>? runtimes, required BooleanSelector? includeTags, required BooleanSelector? excludeTags, required Map<BooleanSelector, SuiteConfiguration>? tags, required Map<PlatformSelector, SuiteConfiguration>? onPlatform, required bool? ignoreTimeouts, required Timeout? timeout, required bool? verboseTrace, required bool? chainStackTraces, required bool? skip, required int? retry, required String? skipReason, required PlatformSelector? testOn, required Iterable<String>? addTags})
factory
Configuration.fromSuiteConfiguration(SuiteConfiguration suiteConfig)
Creates a new Configuration that takes its configuration from SuiteConfiguration.
factory
Configuration.globalRunner({required bool? pauseAfterLoad, required String? customHtmlTemplatePath, required bool? runSkipped, required String? reporter, required Map<String, String>? fileReporters, required int? concurrency, required Iterable<CompilerSelection>? compilerSelections, required Iterable<RuntimeSelection>? runtimes, required Iterable<String>? chosenPresets, required Map<String, RuntimeSettings>? overrideRuntimes})
Runner configuration that is allowed in the global test config file.
factory
Configuration.globalTest({required bool? verboseTrace, required bool? jsTrace, required Timeout? timeout, required Map<String, Configuration>? presets, required bool? chainStackTraces, required Iterable<String>? foldTraceExcept, required Iterable<String>? foldTraceOnly})
Suite level configuration allowed in the global test config file.
factory
Configuration.load(String path, {bool global = false})
Loads configuration from path.
factory
Configuration.loadFromString(String content, {bool global = false, Uri? sourceUrl})
Parses configuration from YAML formatted content.
factory
Configuration.localRunner({required Iterable<Pattern>? globalPatterns, required Map<String, Set<TestSelection>>? testSelections, required Glob? filename, required BooleanSelector? includeTags, required BooleanSelector? excludeTags, required Map<String, CustomRuntime>? defineRuntimes})
Runner configuration that is not allowed in the global test config file.
factory
Configuration.localTest({required bool? skip, required int? retry, required String? skipReason, required PlatformSelector? testOn, required Iterable<String>? addTags, required bool? allowDuplicateTestNames, required bool? allowTestRandomization})
Suite level configuration that is not allowed in the global test config file.
factory
Configuration.onPlatform(Map<PlatformSelector, SuiteConfiguration> onPlatform)
A specialized constructor for configuring only onPlatform.
factory
Configuration.parse(List<String> arguments)
Parses the configuration from args.
factory
Configuration.tags(Map<BooleanSelector, SuiteConfiguration> tags)
factory

Properties

chosenPresets Set<String>
The set of presets to use.
final
color bool
Whether to use command-line color escapes.
no setter
concurrency int
How many tests to run concurrently.
no setter
configurationPath String
The path to the file from which to load more configuration information.
no setter
coverage String?
The output folder for coverage gathering
final
customHtmlTemplatePath String?
Custom HTML template file.
final
debug bool
Whether to run browsers in their respective debug modes
no setter
defineRuntimes Map<String, CustomRuntime>
Runtimes defined by the user in terms of existing runtimes.
final
excludeTags → BooleanSelector
Do not run tests whose tags match this selector.
final
explicitPaths bool
Whether the load paths were passed explicitly or the default was used.
no setter
filename → Glob
The glob matching the basename of tests to run.
no setter
fileReporters Map<String, String>
The map of file reporters where the key is the name of the reporter and the value is the filepath to which its output should be written.
final
foldTraceExcept Set<String>
The list of packages to fold when producing StackTraces.
no setter
foldTraceOnly Set<String>
If non-empty, all packages not in this list will be folded when producing StackTraces.
no setter
globalPatterns Set<Pattern>
The set of patterns to check test names against in all suites that run.
final
hashCode int
The hash code for this object.
no setterinherited
help bool
Whether --help was passed.
no setter
includeTags → BooleanSelector
Only run tests whose tags match this selector.
final
knownPresets Set<String>
All preset names that are known to be valid.
no setter
knownTags Set<String>
The set of tags that have been declared in any way in this configuration.
latefinal
noRetry bool
Whether to disable retries of tests.
no setter
overrideRuntimes Map<String, RuntimeSettings>
Built-in runtimes whose settings are overridden by the user.
final
pauseAfterLoad bool
Whether to pause for debugging after loading each test suite.
no setter
presets Map<String, Configuration>
Configuration presets.
final
reporter String
The name of the reporter to use to display results.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shardIndex int?
The index of the current shard, if sharding is in use, or null if it's not.
final
stopOnFirstFailure bool
Whether to stop running subsequent tests after a test fails.
no setter
suiteDefaults SuiteConfiguration
The default suite-level configuration.
final
testRandomizeOrderingSeed int?
The seed used to generate randomness for test case shuffling.
final
testSelections Map<String, Set<TestSelection>>
The paths from which to load tests, and the test cases to run.
no setter
totalShards int?
The total number of shards, if sharding is in use, or null if it's not.
final
version bool
Whether --version was passed.
no setter

Methods

asCurrent<T>(T body()) → T
Runs body with this as Configuration.current.
change({bool? help, String? customHtmlTemplatePath, bool? version, bool? pauseAfterLoad, bool? debug, bool? color, String? configurationPath, String? reporter, Map<String, String>? fileReporters, String? coverage, int? concurrency, int? shardIndex, int? totalShards, Map<String, Set<TestSelection>>? testSelections, Iterable<String>? exceptPackages, Iterable<String>? onlyPackages, Glob? filename, Iterable<String>? chosenPresets, Map<String, Configuration>? presets, Map<String, RuntimeSettings>? overrideRuntimes, Map<String, CustomRuntime>? defineRuntimes, bool? noRetry, int? testRandomizeOrderingSeed, bool? ignoreTimeouts, bool? allowDuplicateTestNames, bool? jsTrace, bool? runSkipped, Iterable<String>? dart2jsArgs, String? precompiledPath, Iterable<RuntimeSelection>? runtimes, BooleanSelector? includeTags, BooleanSelector? excludeTags, Map<BooleanSelector, SuiteConfiguration>? tags, Map<PlatformSelector, SuiteConfiguration>? onPlatform, Timeout? timeout, bool? verboseTrace, bool? chainStackTraces, bool? skip, String? skipReason, PlatformSelector? testOn, Iterable<String>? addTags}) Configuration
Returns a copy of this configuration with the given fields updated.
merge(Configuration other) Configuration
Merges this with other.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validateRuntimes(List<Runtime> allRuntimes) → void
Throws a FormatException if this refers to any undefined runtimes.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

current Configuration
Returns the current configuration, or a default configuration if no current configuration is set.
no setter
empty Configuration
An empty configuration with only default values.
final
usage String
The usage string for the command-line arguments.
no setter