regolith-labs / steel

Solana smart contract framework.
146 stars 32 forks source link

`steel test` can't find my test file #19

Closed Perelyn-sama closed 2 weeks ago

Perelyn-sama commented 3 weeks ago

using steel test Screenshot 2024-10-24 at 2 20 53 AM

error:

running 1 test
[2024-10-24T01:24:04.062732000Z WARN  solana_program_test] Possible bogus program name. Ensure the program name (steel) matches one of the following recognizable program names:
[2024-10-24T01:24:04.064577000Z WARN  solana_program_test]  - steel_program
test run_test ... FAILED

failures:

---- run_test stdout ----
thread 'run_test' panicked at /Users/mac/.cargo/registry/src/index.crates.io-6f17d22bba15001f/solana-program-test-1.18.26/src/lib.rs:708:17:
Program file data not available for steel (z7msBPQHDJjTvdQRoEcKyENgXDhSRYeHieN1ZMTqo35)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    run_test

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s

error: test failed, to rerun pass `--test test`

Using cargo test -p steel-program run_test Screenshot 2024-10-24 at 2 21 14 AM

Perelyn-sama commented 2 weeks ago

figured it out, I used the wrong program name in program/tests/test.rs

right around here

async fn setup() -> (BanksClient, Keypair, Hash) {
    let mut program_test = ProgramTest::new(
        "hello_solana_program", // where I made the mistake
        hello_solana_api::ID,
        processor!(hello_solana_program::process_instruction),
    );
    program_test.prefer_bpf(true);
    program_test.start().await
}