evomimic / map-holons

3 stars 1 forks source link

76 add match db content dance test step #82

Closed dauphin3 closed 2 months ago

dauphin3 commented 2 months ago

cargo test -p dances --test dance_tests -- --show-output 1 test passing.

fixture changes so far not needed... EssentialHolonContent fixed the issue of passing 'expected_holons' from test_case.created_holons into execute_match_db_content DanceTestStep, since it takes a mutable reference.

This PR might benefit from further assertions and tests. There may be value in returning the fixture_holons from the fixture anyways, and we could run some match checks on the created and fetched holons.. although there may be a more simplified check, and perhaps not necessary for the current stage.

evomimic commented 2 months ago

When I run the dance_tests, I get the following error on the match_db_content test step:

--- TEST STEP: Ensuring database matches expected holons ---
Dance Request: Ok(
    DanceRequest {
        dance_name: MapString(
            "get_holon_by_id",
        ),
        dance_type: Standalone,
        body: HolonId(
            HolonId(
                ActionHash(uhCkkczwt7di7Slm53CWnPsMOeGAJ4roOjUAoBQ6e6D0HYUhjMGcN),
            ),
        ),
        staging_area: StagingArea {
            staged_holons: [],
            index: {},
        },
    },
)
FATAL PANIC PanicInfo {
    payload: Any { .. },
    message: Some(
        called `Result::unwrap()` on an `Err` value: Other(WasmRuntimeError(RuntimeError { source: User(WasmError { file: "/Users/stevemelville/dev/map-proto/map-dev/map-holons/.cargo/registry/src/index.crates.io-6f17d22bba15001f/holochain_wasmer_host-0.0.92/src/guest.rs", line: 224, error: CallError("RuntimeError: unreachable") }), wasm_trace: [] })),
    ),
    location: Location {
        file: "/Users/stevemelville/dev/map-proto/map-dev/map-holons/.cargo/registry/src/index.crates.io-6f17d22bba15001f/holochain-0.2.8/src/sweettest/sweet_conductor_handle.rs",
        line: 19,
        col: 58,
    },
    can_unwind: true,
    force_no_backtrace: false,
}
thread 'rstest_dance_tests::case_1_simple_undescribed_create_holon_test' panicked at /Users/stevemelville/dev/map-proto/map-dev/map-holons/.cargo/registry/src/index.crates.io-6f17d22bba15001f/holochain-0.2.8/src/sweettest/sweet_conductor_handle.rs:19:58:
called `Result::unwrap()` on an `Err` value: Other(WasmRuntimeError(RuntimeError { source: User(WasmError { file: "/Users/stevemelville/dev/map-proto/map-dev/map-holons/.cargo/registry/src/index.crates.io-6f17d22bba15001f/holochain_wasmer_host-0.0.92/src/guest.rs", line: 224, error: CallError("RuntimeError: unreachable") }), wasm_trace: [] }))
evomimic commented 2 months ago

Generally, these "unreachable" errors are indications of some problem in the guest-side (i.e., zome) code. They are difficult to debug without guest-side logging. This is exactly why I added guest-side tracing support in Issue #81.

So I am going to approve this PR and merge it, then merge PR #74 (which contains the guest-side tracing enhancement).

At that point, we can debug the get_holon_by_id issue more easily.