Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cardano-tesnet: allow to specify output directory #6095

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Jan 29, 2025

Description

Adds the --output-dir to the cardano-testnet executable

Fixes #6078

How trust this PR

Use the new flag:

> ls /tmp > tmp-before # for checking data afterwards
> cabal run cardano-testnet -- cardano --testnet-magic 44 --output-dir output-dir

Witness that the output directory gets populated:

> tree output-dir
output-dir/
├── alonzo-genesis.json
├── byron-gen-command
│   └── genesis-keys.000.key
├── byron-genesis.json
├── byron.genesis.spec.json
├── configuration.yaml
├── conway-genesis.json
├── delegate-keys
│   ├── delegate1
│   │   ├── kes.skey
│   │   ├── kes.vkey
│   │   ├── key.skey
│   │   ├── key.vkey
...

You can check that the /tmp directory wasn't used, by comparing its current state with the state before:

> ls /tmp > tmp-after
> diff tmp-before tmp-after
# nothing gets printed

Now test that you can omit the flag:

> ls /tmp > tmp-before-2
> cabal run cardano-testnet -- cardano --testnet-magic 44

Observe that the testnet's log mentions a workspace in /tmp like before this PR:

    forAll77 =
      /tmp/nix-shell.hc4ID6/testnet-test-dc5d67c2dd8545dd
    
    forAll78 =
      Workspace: /tmp/nix-shell.hc4ID6/testnet-test-dc5d67c2dd8545dd

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • Self-reviewed the diff

@smelc smelc force-pushed the smelc/cardano-testnet-custom-output-dir branch 4 times, most recently from 4d30612 to 55313f5 Compare January 30, 2025 14:14
@smelc smelc marked this pull request as ready for review January 30, 2025 16:21
@smelc smelc requested a review from a team as a code owner January 30, 2025 16:21
Copy link
Contributor

@carbolymer carbolymer left a comment

Choose a reason for hiding this comment

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

My main remark is about reusing mkConf, the other ones a just styling suggestions.

cardano-testnet/src/Testnet/Property/Run.hs Outdated Show resolved Hide resolved
cardano-testnet/src/Testnet/Property/Run.hs Show resolved Hide resolved
cardano-testnet/src/Testnet/Property/Run.hs Outdated Show resolved Hide resolved
@smelc smelc force-pushed the smelc/cardano-testnet-custom-output-dir branch from deb17c2 to 19f24f4 Compare January 31, 2025 10:31
@smelc smelc enabled auto-merge January 31, 2025 14:49
@smelc smelc force-pushed the smelc/cardano-testnet-custom-output-dir branch from 19f24f4 to 4405b07 Compare February 4, 2025 14:44
@smelc smelc added this pull request to the merge queue Feb 4, 2025
Merged via the queue into master with commit 46484ea Feb 4, 2025
22 of 26 checks passed
@smelc smelc deleted the smelc/cardano-testnet-custom-output-dir branch February 4, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] - cardano-testnet Use flags to specify the output directory for the cluster artifacts
2 participants