Skip to content

Commit

Permalink
additional toml->yaml items
Browse files Browse the repository at this point in the history
  • Loading branch information
neonphog committed Oct 27, 2020
1 parent 7ad0232 commit a66deb2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
6 changes: 3 additions & 3 deletions crates/holochain/src/bin/holochain/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct Opt {
#[structopt(
short = "c",
long,
help = "Path to a TOML file containing conductor configuration"
help = "Path to a YAML file containing conductor configuration"
)]
config_path: Option<PathBuf>,

Expand Down Expand Up @@ -177,7 +177,7 @@ Error: The conductor is set up to load its configuration from the default path:
{path}
but this file doesn't exist. If you meant to specify a path, run this command
again with the -c option. Otherwise, please either create a TOML config file at
again with the -c option. Otherwise, please either create a YAML config file at
this path yourself, or rerun the command with the '-i' flag, which will help you
automatically create a default config file.
",
Expand All @@ -190,7 +190,7 @@ Error: You asked to load configuration from the path:
{path}
but this file doesn't exist. Please either create a TOML config file at this
but this file doesn't exist. Please either create a YAML config file at this
path yourself, or rerun the command with the '-i' flag, which will help you
automatically create a default config file.
",
Expand Down
2 changes: 1 addition & 1 deletion crates/holochain/src/conductor/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub fn load_config_or_prompt_for_default(
ConductorConfig::load_yaml(config_path.as_ref()).map(Some).or_else(|err| {
if let ConductorError::ConfigMissing(_) = err {
let prompt = format!(
"There is no conductor config TOML file at the path specified ({})\nWould you like to create a default config file at this location?",
"There is no conductor config YAML file at the path specified ({})\nWould you like to create a default config file at this location?",
config_path
);
if ask_yn(prompt, Some(true))? {
Expand Down
2 changes: 1 addition & 1 deletion crates/holochain/src/conductor/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const ORGANIZATION: &str = "holochain";
const APPLICATION: &str = "holochain";
const KEYS_DIRECTORY: &str = "keys";
const DATABASES_DIRECTORY: &str = "databases";
const CONFIG_FILENAME: &str = "conductor-config.toml";
const CONFIG_FILENAME: &str = "conductor-config.yml";

/// Returns the project root builder for holochain directories.
fn project_root() -> Option<directories::ProjectDirs> {
Expand Down
15 changes: 6 additions & 9 deletions crates/holochain/tests/test_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ use std::process::Command;
use tempdir::TempDir;

#[test]
// (david.b) [D-01034] these take minutes to run in nix/CI - disable until fixed
fn first_experience_with_holochain_is_a_friendly_one() {
let tmp = TempDir::new("").unwrap();
let path = tmp.path().join("missing-config.toml");
let path = tmp.path().join("missing-config.yml");
let mut cmd = Command::cargo_bin("holochain").unwrap();
let cmd = cmd.args(&["-c", &path.display().to_string()]);
cmd.assert().failure().code(predicate::eq(42));
Expand All @@ -19,11 +18,10 @@ fn first_experience_with_holochain_is_a_friendly_one() {
}

#[test]
// (david.b) [D-01034] these take minutes to run in nix/CI - disable until fixed
fn malformed_toml_error_is_friendly() {
let tmp = TempDir::new("").unwrap();
let path = tmp.path().join("malformed-config.toml");
std::fs::write(&path, "{{ totally [ not ( valid toml").unwrap();
let path = tmp.path().join("malformed-config.yml");
std::fs::write(&path, "{{ totally [ not ( valid yaml").unwrap();
let mut cmd = Command::cargo_bin("holochain").unwrap();
let cmd = cmd.args(&["-c", &path.display().to_string()]);
cmd.assert().failure().code(predicate::eq(42));
Expand All @@ -32,15 +30,14 @@ fn malformed_toml_error_is_friendly() {
.stdout(predicate::str::is_match("[Pp]lease").unwrap());
cmd.assert()
.append_context("reason", "output contains the wrong reason for error")
.stdout(predicate::str::contains("expected a table key"));
.stdout(predicate::str::contains("did not find expected"));
}

#[test]
// (david.b) [D-01034] these take minutes to run in nix/CI - disable until fixed
fn invalid_config_error_is_friendly() {
let tmp = TempDir::new("").unwrap();
let path = tmp.path().join("malformed-config.toml");
std::fs::write(&path, "[valid]\nbut=\"wrong\"").unwrap();
let path = tmp.path().join("malformed-config.yml");
std::fs::write(&path, "valid:\n but: wrong").unwrap();
let mut cmd = Command::cargo_bin("holochain").unwrap();
let cmd = cmd.args(&["-c", &path.display().to_string()]);
cmd.assert().failure().code(predicate::eq(42));
Expand Down

1 comment on commit a66deb2

@thedavidmeister
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmarking wasm_call_n/1: Analyzing
wasm_call_n/1           time:   [1.5688 ms 1.5703 ms 1.5722 ms]
                        thrpt:  [636.05   B/s 636.81   B/s 637.42   B/s]
                 change:
                        time:   [-2.7860% -2.1955% -1.5611%] (p = 0.00 < 0.05)
                        thrpt:  [+1.5859% +2.2448% +2.8659%]
                        Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
  5 (5.00%) high mild
  5 (5.00%) high severe
Benchmarking wasm_call_n/1000
Benchmarking wasm_call_n/1000: Analyzing
wasm_call_n/1000        time:   [1.5869 ms 1.5884 ms 1.5903 ms]
                        thrpt:  [614.09 KiB/s 614.80 KiB/s 615.38 KiB/s]
                 change:
                        time:   [-5.2367% -5.0034% -4.7597%] (p = 0.00 < 0.05)
                        thrpt:  [+4.9976% +5.2669% +5.5261%]
                        Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
  5 (5.00%) high mild
  5 (5.00%) high severe
Benchmarking wasm_call_n/1000000
Benchmarking wasm_call_n/1000000: Analyzing
wasm_call_n/1000000     time:   [28.491 ms 28.532 ms 28.583 ms]
                        thrpt:  [33.365 MiB/s 33.424 MiB/s 33.473 MiB/s]
                 change:
                        time:   [+0.9624% +1.2239% +1.4937%] (p = 0.00 < 0.05)
                        thrpt:  [-1.4717% -1.2091% -0.9532%]
                        Change within noise threshold.
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) high mild
  3 (3.00%) high severe```

Please sign in to comment.