Skip to content

Commit

Permalink
Merge pull request input-output-hk#1338 from input-output-hk/damien/e…
Browse files Browse the repository at this point in the history
…nhance-end-to-end-readme

Enhance end to end readme and fix `work_directory` default value on MacOS
  • Loading branch information
dlachaume authored Nov 13, 2023
2 parents 38d4573 + 0311cf0 commit 03271e2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
32 changes: 32 additions & 0 deletions mithril-test-lab/mithril-end-to-end/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,40 @@ make build
./mithril-end-to-end --db-directory db/ --bin-directory ../../target/release
```

To run `mithril-end-to-end` command, you must first compile the Mithril nodes:

```bash
cargo build --release
```

### Note for MacOS users

#### `sed` compatibility

Mithril end to end test uses `sed` command which is not compatible with MacOS.

To deal easily with this issue, you can install `gnu-sed` and use it as `sed`.

Here is an example of the installation of `gnu-sed` with Homebrew:

```bash
brew install gnu-sed
```

The shell output should display the instruction below, that you must follow:

```bash
GNU "sed" has been installed as "gsed".
If you need to use it as "sed", you can add a "gnubin" directory
to your PATH from your bashrc like:

PATH="$HOMEBREW_PREFIX/opt/gnu-sed/libexec/gnubin:$PATH"
```

Once saved, you need to reload your shell profile. Execute source $HOME/.bashrc or source $HOME/.zshrc (depending on the shell application you use).

#### Use your own cardano binaries

The cardano binaries downloaded to run the test suite are only built for Linux.

To run the end to end test, you will need to build and use your own compiled cardano binaries:
Expand Down
5 changes: 5 additions & 0 deletions mithril-test-lab/mithril-end-to-end/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ pub struct Args {
/// will be located.
///
/// Optional: if not set it will default to `{system_temp_folder}/mithril-end-to-end`
/// Exception for MacOS: default is `./mithril-end-to-end` as the length of the temporary directory's path
/// is too long. It causes the maximum path size of the node.sock file to be exceeded.
#[clap(long)]
work_directory: Option<PathBuf>,

Expand Down Expand Up @@ -74,6 +76,9 @@ async fn main() -> StdResult<()> {
path.canonicalize().unwrap()
}
None => {
#[cfg(target_os = "macos")]
let work_dir = PathBuf::from("./mithril_end_to_end");
#[cfg(not(target_os = "macos"))]
let work_dir = std::env::temp_dir().join("mithril_end_to_end");
create_workdir_if_not_exist_clean_otherwise(&work_dir);
work_dir.canonicalize().unwrap()
Expand Down

0 comments on commit 03271e2

Please sign in to comment.