babylonlabs-io / babylon-contract

CosmWasm smart contracts for Babylon integration
Other
10 stars 7 forks source link

OP: integration test vs. unit test #18

Closed maurolacy closed 2 weeks ago

maurolacy commented 4 months ago

@bap2pecs cloned issue babylonchain/babylon-contract#175 on 2024-06-19:

Context

I see babylon and btc-staking contracts both use integration tests like


// need to add dep `cosmwasm_vm`

static WASM: &[u8] = include_bytes!("../../../artifacts/my_contract.wasm");

#[test]

fn proper_initialization() {

  let mut deps = mock_instance(WASM, &[]);

」

why not just use unit test which is simpler and does not depend on the binary?


#[test]

fn proper_initialization() {

  let mut deps = mock_dependencies();

}

cc @maurolacy @SebastianElvis

Tasks

  • [ ] decide the missing integration/uint tests

  • [ ] implement those tests

maurolacy commented 4 months ago

@bap2pecs commented on 2024-07-08:

https://www.github.com/babylonchain/pm-integration/issues/5

maurolacy commented 4 months ago

@SebastianElvis commented on 2024-07-09:

This integration test is supposed to (almost) simulate the real scenario for executing a wasm contract on the wasm runtime. The unit test is still in our laptop/CI's runtime, e.g., x86. We at least need a simple integration test like that to ensure we don't screw up the wasm vm

SebastianElvis commented 2 weeks ago

@bap2pecs is this sill relevant?

bap2pecs commented 2 weeks ago

we can close it