Skip to content

Restructure integration tests #951

@ludfjig

Description

@ludfjig

We currently have 2 different integration test files: integration_test.rs and sandbox_host_test.rs. The difference between these is unclear.

Certain integration tests are tested against both two types of guests (c and rust) by using new_uninit helper function, which will return either rust/c guests depending on an environment variable. We should consolidate all integration tests that need to run against both rust and c guests into its own separate file. Additionally, we should not depend on environment variables for testing, and instead using something like this (just an example)

#[test]
fn some_test() {
    with_c_or_rust_sandbox(|sandbox: MultiUseSandbox| {
        /// test logic here
    });
}

Where with_c_or_rust_sandbox will run twice, one with c guest and one with rust guests.

The rest of the integration tests (that only exercises rust or only exercises c) can live in a separate files.

In addition, running just test will right now run the same WIT tests twice, because it's ran with both GUEST=c and GUEST=rust, even though it of course only uses the rust guests. This is slow and unnecessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions