History, more test coverage improvements, and refactorings. (#3217)

Improvements overall to Nu. Also among the changes here, we can also be more confident towards incorporating `3041`. End to end tests for checking envs properly exported to externals is not added here (since it's in the other PR)

A few things added in this PR (probably forgetting some too)

* no writes happen to history during test runs.
* environment syncing end to end coverage added.
* clean up / refactorings few areas.
* testing API for finer control (can write tests passing more than one pipeline)
* can pass environment variables in tests that nu will inherit when running.

* No longer needed.

* no longer under a module. No need to use super.
This commit is contained in:
Andrés N. Robalino
2021-03-27 00:08:03 -05:00
committed by GitHub
parent b243b3ee1d
commit 8fc8fc89aa
31 changed files with 483 additions and 241 deletions

View File

@ -64,6 +64,13 @@ fn main() -> Result<(), Box<dyn Error>> {
.multiple(false)
.takes_value(false),
)
.arg(
Arg::with_name("no-history")
.hidden(true)
.long("no-history")
.multiple(false)
.takes_value(false),
)
.arg(
Arg::with_name("script")
.help("the nu script to run")
@ -95,6 +102,7 @@ fn main() -> Result<(), Box<dyn Error>> {
.value_of("config-file")
.map(std::ffi::OsString::from);
options.stdin = matches.is_present("stdin");
options.save_history = !matches.is_present("no-history");
let loglevel = match matches.value_of("loglevel") {
None => LevelFilter::Warn,