Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wasmer run not interpreting URLs correctly + display fixes #3370

Merged
merged 31 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5d1d4f3
Fix #3366 - file paths could get interpreted as URLs in wasmer run
fschutt Nov 24, 2022
351b0a6
Add integration test, use different spinner library to fix #3346
fschutt Nov 24, 2022
3e4a08f
Use with_context with proper formatting
fschutt Nov 24, 2022
8674d8c
Adress review comments and fix test
fschutt Nov 24, 2022
4ec584c
Install cowsay properly
fschutt Nov 24, 2022
2145c2d
Disable test from running locally
fschutt Nov 24, 2022
cded3ac
Install wapm before running integration tests
fschutt Nov 24, 2022
75aeeda
Install wapm via cargo if not available (Windows)
fschutt Nov 24, 2022
b5c4952
Remove dependency on wapm
fschutt Nov 24, 2022
3d4c34b
Undo installing wapm automatically
fschutt Nov 24, 2022
b5be679
Remove dependency on wapm in unit tests
fschutt Nov 24, 2022
8676105
Merge branch 'master' into fix-3366
fschutt Nov 24, 2022
6eca5b9
Do not use home_dir
fschutt Nov 24, 2022
95d77d5
Update wrong error message
fschutt Nov 24, 2022
ddf1903
Fix unit test
fschutt Nov 24, 2022
429229f
Remove unnecessary fs::copy
fschutt Nov 24, 2022
4b4214d
Remove unnecessary line from gitignore
fschutt Nov 24, 2022
4040320
Make sure that the test is being run on Windows
fschutt Nov 24, 2022
3db9ac6
Fix "wasmer" -> get_wasmer_path()
fschutt Nov 25, 2022
854f9be
Fix Makefile on Windows
fschutt Nov 25, 2022
7df82ec
Merge branch 'master' into fix-3366
fschutt Nov 25, 2022
1969692
Windows: make path complex by canonicalizing
fschutt Nov 25, 2022
6d559c2
Fix wasmer_run_complex_url on Windows GitHub CI
fschutt Nov 25, 2022
c352e1c
Fix compilation error in complex_url test
fschutt Nov 25, 2022
9285031
Remove temporary out.tar.gz
fschutt Nov 25, 2022
808bcca
Fix last compile error on Windows
fschutt Nov 25, 2022
468c587
Windows: test that path actually conflicts with URL
fschutt Nov 25, 2022
fda1a3f
Replace \\ with / on Windows
fschutt Nov 25, 2022
1594c88
Debug why Windows can't find qjs.wasm
fschutt Nov 25, 2022
a0668f9
Get better at locating wasmer.exe for running integration tests
fschutt Nov 25, 2022
83a3854
Remove printlns in test_wasmer_run_complex_url
fschutt Nov 25, 2022
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
17 changes: 17 additions & 0 deletions .github/workflows/test-sys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,23 @@ jobs:
CARGO_TARGET: --target ${{ matrix.target }}
WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test integration CLI
if: matrix.run_test && matrix.os == 'windows-2019'
shell: bash
run: |
make build-wasmer &&
make build-capi &&
make package-capi &&
make package &&
export WASMER_DIR=`pwd`/package &&
cargo test --package wasmer-integration-tests-cli --test run -- test_wasmer_run_complex_url --exact --nocapture
env:
TARGET: ${{ matrix.target }}
TARGET_DIR: target/${{ matrix.target }}/release
CARGO_TARGET: --target ${{ matrix.target }}
WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# cargo test --package wasmer-integration-tests-cli --test run -- test_wasmer_run_complex_url --exact --nocapture
#- name: Test integration CLI
# if: matrix.run_test && matrix.os == 'windows-2019'
# shell: bash
Expand Down
14 changes: 9 additions & 5 deletions tests/integration/cli/tests/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@ use std::process::Command;
use wasmer_integration_tests_cli::{get_repo_root_path, get_wasmer_path, ASSET_PATH, C_ASSET_PATH};

fn wasi_test_python_path() -> String {
format!("{}/{}", C_ASSET_PATH, "python-0.1.0.wasmer")
let slash = if C_ASSET_PATH.ends_with('/') { "" } else { "/" };
format!("{}{slash}{}", C_ASSET_PATH, "python-0.1.0.wasmer")
}

fn wasi_test_wasm_path() -> String {
format!("{}/{}", C_ASSET_PATH, "qjs.wasm")
let slash = if C_ASSET_PATH.ends_with('/') { "" } else { "/" };
format!("{}{slash}{}", C_ASSET_PATH, "qjs.wasm")
}

fn test_no_imports_wat_path() -> String {
format!("{}/{}", ASSET_PATH, "fib.wat")
let slash = if ASSET_PATH.ends_with('/') { "" } else { "/" };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the correct way of joining paths. We should use the std os path join and return a Path

format!("{}{slash}{}", ASSET_PATH, "fib.wat")
}

fn test_no_start_wat_path() -> String {
format!("{}/{}", ASSET_PATH, "no_start.wat")
let slash = if ASSET_PATH.ends_with('/') { "" } else { "/" };
format!("{}{slash}{}", ASSET_PATH, "no_start.wat")
}

#[cfg(any(target_os = "linux", target_os = "macos"))]
Expand Down Expand Up @@ -564,7 +568,7 @@ fn test_wasmer_run_complex_url() -> anyhow::Result<()> {

let mut cmd = Command::new("wasmer");
cmd.arg("run");
cmd.arg(&wasm_test_path);
cmd.arg(wasi_test_wasm_path());
cmd.arg("--");
cmd.arg("-q");

Expand Down