FakeLaneContext class

A LaneContext wired to fakes, for testing lanes and actions.

Nothing runs, nothing touches the network and nothing is printed. Set up answers on shell and http, run the lane or action, then check what it did through shell, http and logger.

Inheritance

Constructors

FakeLaneContext({List<String> args = const [], Map<String, String> env = const {}, bool dryRun = false, bool verbose = false})
Creates a context with fresh fakes.

Properties

args → LaneArgs
Arguments given to the lane, after the lane name, parsed from the command line. See LaneArgs for the accepted forms and the typed getters.
finalinherited
dryRun → bool
Whether this is a dry run: the steps are described, not executed.
finalinherited
dryRunSteps → List<String>
The steps a dry run has described so far, in order.
no setterinherited
env → Map<String, String>
Environment variables visible to the lane.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
http → FakeHttp
Makes web requests.
no setteroverride
logger → FakeLaneLogger
Where progress and errors are written.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
secrets ↔ LaneSecrets
Reads secrets from environment variables and an optional .env file, and masks what it returns in the log.
latefinalinherited
shell → FakeLaneShell
Runs external commands. Prefer sh unless you need the exit code.
no setteroverride

Methods

close() → void
Releases resources this context created itself.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run<R>(LaneAction<R> action) → Future<R>
Runs action and returns its result.
inherited
sh(String executable, List<String> arguments, {String? workingDirectory, Map<String, String>? environment, bool streamOutput = true}) → Future<ShellResult>
Runs executable with arguments and returns the result.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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