Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,24 @@ jobs:
run: cargo clippy --tests

test:
runs-on: ubuntu-latest
name: test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Run tests
run: cargo test

build:
runs-on: ubuntu-latest
name: build (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Build
Expand Down
10 changes: 8 additions & 2 deletions integration_tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ fn build_example(name: &str) -> Result<()> {
}

static FUNCTION_RUNNER_PATH: LazyLock<anyhow::Result<PathBuf>> = LazyLock::new(|| {
let path = workspace_root().join(format!("tmp/function-runner-{FUNCTION_RUNNER_VERSION}"));
let path = workspace_root().join(format!(
"tmp/function-runner-{FUNCTION_RUNNER_VERSION}{}",
std::env::consts::EXE_SUFFIX
));

if !path.exists() {
std::fs::create_dir_all(workspace_root().join("tmp"))?;
Expand All @@ -57,7 +60,10 @@ static FUNCTION_RUNNER_PATH: LazyLock<anyhow::Result<PathBuf>> = LazyLock::new(|
});

static TRAMPOLINE_PATH: LazyLock<anyhow::Result<PathBuf>> = LazyLock::new(|| {
let path = workspace_root().join(format!("tmp/trampoline-{TRAMPOLINE_VERSION}"));
let path = workspace_root().join(format!(
"tmp/trampoline-{TRAMPOLINE_VERSION}{}",
std::env::consts::EXE_SUFFIX
));
if !path.exists() {
std::fs::create_dir_all(workspace_root().join("tmp"))?;
download_trampoline(&path)?;
Expand Down
15 changes: 12 additions & 3 deletions integration_tests/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,19 @@ fn test_example_with_panic() -> Result<()> {
let err = run_example(path.clone(), "target_panic", input)
.unwrap_err()
.to_string();
let expected_err =
"Function runner returned non-zero exit code: exit status: 1, logs: panicked at example_with_targets/src/main.rs:57:5:\nSomething went wrong\nerror while executing at wasm backtrace:";
// `ExitStatus` is displayed differently on Windows, and the panic location
// uses the platform's path separator.
let exit_status = if cfg!(windows) {
"exit code: 1"
} else {
"exit status: 1"
};
let sep = std::path::MAIN_SEPARATOR;
let expected_err = format!(
"Function runner returned non-zero exit code: {exit_status}, logs: panicked at example_with_targets{sep}src{sep}main.rs:57:5:\nSomething went wrong\nerror while executing at wasm backtrace:"
);
assert!(
err.contains(expected_err),
err.contains(&expected_err),
"Expected error message to contain:\n`{expected_err}`\nbut was:\n`{err}`"
);
Ok(())
Expand Down
Loading