Skip to content

xtask: sovereign binaries execution #227

Open
@gabriele-0201

Description

@gabriele-0201

Duct does a weird thing with dir. You can find more information about it here: docs.rs/duct/latest/duct/struct.Expression.html#method.dir and the following code snippet does not work:

let sovereign_rollup_handle = cmd!("../target/release/sov-demo-rollup")
   .dir("demo/sovereign/demo-rollup/")
   .run()?;

To solve this issue, you can change the references to the folder demo/sovereign/test-data. Currently, the sov-demo-rollup and sov-cli binaries expect to be executed from the folder demo/sovereign/demo-rollup, and every reference to test-data is ../test-data. We could modify it to be executed from the main directory of the project, so that all relative paths to test-data will be demo/sovereign/test-data, and there won't be conflicts with how relative paths are handled by duct::dir.

Here's how it could look like if we make such change:

let sovereign_rollup_handle = cmd!("demo/sovereign/target/release/sov-demo-rollup").run()?;

the test function would then be

let cli = "demo/sovereign/target/release/sov-cli";
let test_data_path = "demo/sovereign/test-data/";
let run_cli_cmd = |args: &str| duct::cmd(cli, args.split(' ')).run();

As you can see, there would no longer be a need to execute sh commands with duct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions