Skip to content

Error while trying to run E2E tests locally #836

@dorianvp

Description

@dorianvp
$ cargo nextest run tex_send_address
    Finished `test` profile [optimized] target(s) in 0.23s
────────────
 Nextest run ID 88bff314-c8b9-449f-ad8f-a2d46e9092d0 with nextest profile: default
    Starting 4 tests across 5 binaries (76 tests skipped)
        FAIL [  11.723s] rust::e2e_tests e2e::arm32::tex_send_address
──── STDOUT:             rust::e2e_tests e2e::arm32::tex_send_address

running 1 test
Exit Code: 1
Output: 
Error: ./scripts/e2e_tests.sh: illegal option -- a
Try 'e2e_tests.sh -h' for more information.

The issue originates from rust/zingomobile_utils/src/lib.rs:

pub fn android_e2e_test(abi: &str, test_name: &str) -> (i32, String, String) {
    let command: String;
    let arg: String;
    #[cfg(unix)]
    {
        command = "sh".to_string();
        arg = "-c".to_string();
    }

    #[cfg(windows)]
    {
        command = "cmd".to_string();
        arg = "/C".to_string();
    }

    #[cfg(not(any(target_arch = "arm", target_arch = "aarch64")))]
    let output = Command::new(command)
        .arg(arg)
        .arg(format!(
            r#"
            cd $(git rev-parse --show-toplevel)
            ./scripts/e2e_tests.sh -a {} -e {}
            "#,
            abi, test_name
        ))
        .output()
        .expect("Failed to execute command"); // << HERE. Removing the abi parameter fixes it

    #[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
    let output = Command::new(command)
        .arg(arg)
        .arg(format!(
            r#"
            cd $(git rev-parse --show-toplevel)
            ./scripts/e2e_tests.sh -a {} -e {} -A
            "#,
            abi, test_name
        ))
        .output()
        .expect("Failed to execute command");

    let exit_code = output.status.code().unwrap_or(-1);
    let stdout = String::from_utf8_lossy(&output.stdout).to_string();
    let stderr = String::from_utf8_lossy(&output.stderr).to_string();

    (exit_code, stdout, stderr)
}

Metadata

Metadata

Assignees

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