Skip to content

Migrate old shell-based wasix tests to the new format in wasmer-wasix#6552

Open
Arshia001 wants to merge 11 commits intomainfrom
chore/migrate-old-wasix-tests
Open

Migrate old shell-based wasix tests to the new format in wasmer-wasix#6552
Arshia001 wants to merge 11 commits intomainfrom
chore/migrate-old-wasix-tests

Conversation

@Arshia001
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates a large set of legacy shell-driven WASIX tests into the Rust-based lib/wasix/tests/wasm_tests and CLI integration suites, so these fixtures are built and run through the newer test harness instead of tests/wasix/test.sh.

Changes:

  • Moves many old tests/wasix/* shell tests into structured wasm_tests fixture directories plus Rust test modules.
  • Expands the WASIX test harness with per-test runner configuration, build.env support, extra mount setup, and trace capture.
  • Removes the old shell test driver/Make target and ports a few cases into CLI integration tests.

Reviewed changes

Copilot reviewed 115 out of 157 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/wasix/vfork/run.sh Removed legacy shell runner for vfork tests
tests/wasix/vfork/.no-build Legacy no-build marker touched/removed with migration
tests/wasix/udp/run.sh Removed legacy shell runner for UDP tests
tests/wasix/test.sh Removed old top-level WASIX shell test driver
tests/wasix/symlink-open-read-write/run.sh Removed legacy shell runner
tests/wasix/signal/run.sh Removed legacy shell runner
tests/wasix/shared-fd/run.sh Removed legacy shell runner
tests/wasix/share-tmp-after-proc-exec2/run.sh Removed legacy shell runner
tests/wasix/share-tmp-after-proc-exec/run.sh Removed legacy shell runner
tests/wasix/share-tmp-after-fork/run.sh Removed legacy shell runner
tests/wasix/setjmp-longjmp/run.sh Removed legacy shell runner
tests/wasix/setjmp-longjmp/.flags Removed legacy ad-hoc build flags
tests/wasix/read-after-munmap/run.sh Removed legacy shell runner
tests/wasix/pwrite-and-size/run.sh Removed legacy shell runner
tests/wasix/proc-exec2/run.sh Removed legacy shell runner
tests/wasix/proc-exec/run.sh Removed legacy shell runner
tests/wasix/posix_spawn/run.sh Removed legacy shell runner
tests/wasix/posix_spawn/.no-build Legacy no-build marker touched/removed with migration
tests/wasix/popen/run.sh Removed legacy shell runner
tests/wasix/popen/.no-build Legacy no-build marker touched/removed with migration
tests/wasix/pipes/run.sh Removed legacy shell runner
tests/wasix/open-under-file/run.sh Removed legacy shell runner
tests/wasix/munmap-sync-start-of-file/run.sh Removed legacy shell runner
tests/wasix/munmap-sync-middle-of-file/run.sh Removed legacy shell runner
tests/wasix/munmap-sync-end-of-file/run.sh Removed legacy shell runner
tests/wasix/msync-start-of-file/run.sh Removed legacy shell runner
tests/wasix/msync-middle-of-file/run.sh Removed legacy shell runner
tests/wasix/msync-end-of-file/run.sh Removed legacy shell runner
tests/wasix/mount-tmp-locally/run.sh Removed legacy shell runner
tests/wasix/fstatat-with-chdir/run.sh Removed legacy shell runner
tests/wasix/fs-mount/wasmer.toml Removed old shell-era fixture copy
tests/wasix/fs-mount/run.sh Removed legacy shell runner
tests/wasix/fork/run.sh Removed legacy shell runner
tests/wasix/fd-close/run.sh Removed legacy shell runner
tests/wasix/exception/run.sh Removed legacy shell runner
tests/wasix/dlopen/run.sh Removed legacy shell runner
tests/wasix/dlopen/.no-build Legacy no-build marker touched/removed with migration
tests/wasix/dl-tls/run.sh Removed legacy shell runner
tests/wasix/dl-tls/.no-build Legacy no-build marker touched/removed with migration
tests/wasix/dl-needed/run.sh Removed legacy shell runner
tests/wasix/dl-needed/.no-build Legacy no-build marker touched/removed with migration
tests/wasix/dl-cache/run.sh Removed legacy shell runner
tests/wasix/dl-cache/.no-build Legacy no-build marker touched/removed with migration
tests/wasix/distinct-inodes-same-basename/run.sh Removed legacy shell runner
tests/wasix/cwd-to-home/run.sh Removed legacy shell runner
tests/wasix/cross-fs-rename/run.sh Removed legacy shell runner
tests/wasix/create-dir-at-cwd/run.sh Removed legacy shell runner
tests/wasix/create-dir-at-cwd-with-chdir/run.sh Removed legacy shell runner
tests/wasix/create-and-remove-dirs/run.sh Removed legacy shell runner
tests/wasix/context-switching/run.sh Removed legacy shell runner
tests/wasix/closing-pre-opened-dirs/run.sh Removed legacy shell runner
tests/wasix/cloexec/run.sh Removed legacy shell runner
tests/wasix/cloexec/.no-build Legacy no-build marker touched/removed with migration
tests/wasix/.gitignore Removed old shell-suite artifact ignore file
tests/integration/cli/tests/run.rs Adds CLI integration coverage for migrated fs-mount/shared-fd cases and helper utilities
tests/integration/cli/tests/packages/shared-fd/main.c Minor fixture comment cleanup
tests/integration/cli/tests/packages/fs-mount/testfile.txt Adds package fixture data file
tests/integration/cli/tests/packages/fs-mount/main.c Adds CLI package fs-mount fixture program
Makefile Removes legacy test-wasix target
lib/wasix/tests/wasm_tests/threadlocal_tests/dl-tls/side.c Adds migrated TLS side-module fixture
lib/wasix/tests/wasm_tests/threadlocal_tests/dl-tls/main.c Adds migrated TLS main fixture
lib/wasix/tests/wasm_tests/threadlocal_tests/dl-tls/common.c Adds shared TLS data fixture
lib/wasix/tests/wasm_tests/threadlocal_tests/dl-tls/build.sh Adds build script for TLS fixture
lib/wasix/tests/wasm_tests/threadlocal_tests.rs Registers new TLS migration test
lib/wasix/tests/wasm_tests/socket_tests/udp/main.c Adds migrated UDP fixture
lib/wasix/tests/wasm_tests/socket_tests.rs Registers UDP migration test
lib/wasix/tests/wasm_tests/process_tests/vfork/main.c Adds migrated vfork fixture
lib/wasix/tests/wasm_tests/process_tests/vfork/build.sh Adds vfork build script
lib/wasix/tests/wasm_tests/process_tests/share-tmp-after-proc-exec2/main.c Adds migrated proc-exec tmp-sharing fixture
lib/wasix/tests/wasm_tests/process_tests/share-tmp-after-proc-exec2/build.sh Adds build script
lib/wasix/tests/wasm_tests/process_tests/share-tmp-after-proc-exec2/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/process_tests/share-tmp-after-proc-exec/main.c Adds migrated proc-exec tmp-sharing fixture
lib/wasix/tests/wasm_tests/process_tests/share-tmp-after-proc-exec/build.sh Adds build script
lib/wasix/tests/wasm_tests/process_tests/share-tmp-after-proc-exec/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/process_tests/share-tmp-after-fork/main.c Adds migrated fork tmp-sharing fixture
lib/wasix/tests/wasm_tests/process_tests/share-tmp-after-fork/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/process_tests/posix-spawn/main.c Updates migrated posix_spawn fixture paths/setup
lib/wasix/tests/wasm_tests/process_tests/posix-spawn/build.sh Adds build script for posix_spawn fixture
lib/wasix/tests/wasm_tests/process_tests/popen/main.c Adds migrated popen fixture
lib/wasix/tests/wasm_tests/process_tests/popen/build.sh Adds build script
lib/wasix/tests/wasm_tests/process_tests/popen/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/process_tests/legacy-proc-exec2/main.c Adds migrated legacy proc-exec2 fixture
lib/wasix/tests/wasm_tests/process_tests/legacy-proc-exec2/build.sh Adds build script
lib/wasix/tests/wasm_tests/process_tests/legacy-proc-exec2/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/process_tests/legacy-proc-exec/main.c Adds migrated legacy proc-exec fixture
lib/wasix/tests/wasm_tests/process_tests/legacy-proc-exec/build.sh Adds build script
lib/wasix/tests/wasm_tests/process_tests/legacy-proc-exec/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/process_tests/fork/main.c Adds migrated fork fixture
lib/wasix/tests/wasm_tests/process_tests/fork/build.sh Adds build script
lib/wasix/tests/wasm_tests/process_tests/fork/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/process_tests/cross-fs-rename/main.c Adds migrated cross-filesystem rename fixture
lib/wasix/tests/wasm_tests/process_tests/cloexec/main.c Updates migrated cloexec fixture artifact naming
lib/wasix/tests/wasm_tests/process_tests/cloexec/build.sh Adds build script
lib/wasix/tests/wasm_tests/process_tests/cloexec/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/process_tests.rs Adds Rust test module for many migrated process fixtures
lib/wasix/tests/wasm_tests/path_tests/symlink-open-read-write/main.c Adapts fixture away from hardcoded /host path
lib/wasix/tests/wasm_tests/path_tests/open-under-file/main.c Adds migrated open-under-file fixture
lib/wasix/tests/wasm_tests/path_tests/mount-tmp-locally/main.c Adds migrated tmp-mount fixture
lib/wasix/tests/wasm_tests/path_tests/fstatat-with-chdir/main.c Adapts fixture away from hardcoded /home path
lib/wasix/tests/wasm_tests/path_tests/fs-mount/testfile.txt Adds fs-mount fixture data
lib/wasix/tests/wasm_tests/path_tests/fs-mount/main.c Minor fixture formatting touch
lib/wasix/tests/wasm_tests/path_tests/distinct-inodes-same-basename/main.c Adds migrated inode-distinction fixture
lib/wasix/tests/wasm_tests/path_tests/cwd-to-home/main.c Adds migrated cwd fixture
lib/wasix/tests/wasm_tests/path_tests/create-dir-at-cwd/main.c Adapts fixture away from hardcoded /home path
lib/wasix/tests/wasm_tests/path_tests/create-dir-at-cwd-with-chdir/main.c Adapts fixture away from hardcoded /home path
lib/wasix/tests/wasm_tests/path_tests/create-and-remove-dirs/main.c Adapts fixture away from hardcoded /home path
lib/wasix/tests/wasm_tests/path_tests/closing-pre-opened-dirs/main.c Updates expected directory contents for new harness
lib/wasix/tests/wasm_tests/path_tests.rs Adds Rust coverage/helpers for migrated path fixtures
lib/wasix/tests/wasm_tests/mod.rs Extends harness with build.env support, runner config, extra mounts, and trace capture
lib/wasix/tests/wasm_tests/longjmp_tests/legacy-setjmp-longjmp/main.cpp Adds migrated legacy setjmp/longjmp fixture
lib/wasix/tests/wasm_tests/longjmp_tests/legacy-setjmp-longjmp/build.sh Adds build script
lib/wasix/tests/wasm_tests/longjmp_tests.rs Registers legacy setjmp/longjmp migration test
lib/wasix/tests/wasm_tests/libc_tests/signal/main.c Adds migrated signal fixture
lib/wasix/tests/wasm_tests/libc_tests/signal/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/libc_tests/read-after-munmap/main.c Adapts/reads migrated mmap fixture for new harness
lib/wasix/tests/wasm_tests/libc_tests/read-after-munmap/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/libc_tests/munmap-sync-start-of-file/main.c Adapts migrated mmap fixture
lib/wasix/tests/wasm_tests/libc_tests/munmap-sync-start-of-file/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/libc_tests/munmap-sync-middle-of-file/main.c Adapts migrated mmap fixture
lib/wasix/tests/wasm_tests/libc_tests/munmap-sync-middle-of-file/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/libc_tests/munmap-sync-end-of-file/main.c Adapts migrated mmap fixture
lib/wasix/tests/wasm_tests/libc_tests/munmap-sync-end-of-file/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/libc_tests/msync-start-of-file/main.c Adapts migrated mmap fixture
lib/wasix/tests/wasm_tests/libc_tests/msync-start-of-file/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/libc_tests/msync-middle-of-file/main.c Adapts migrated mmap fixture
lib/wasix/tests/wasm_tests/libc_tests/msync-middle-of-file/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/libc_tests/msync-end-of-file/main.c Adapts migrated mmap fixture
lib/wasix/tests/wasm_tests/libc_tests/msync-end-of-file/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/libc_tests.rs Adds Rust coverage/helpers for migrated libc fixtures
lib/wasix/tests/wasm_tests/fd_tests/pwrite-and-size/main.c Adds migrated pwrite/file-size fixture
lib/wasix/tests/wasm_tests/fd_tests/pipes/main.c Adapts subprocess exec path for new harness output name
lib/wasix/tests/wasm_tests/fd_tests/pipes/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/fd_tests/fd-close/main.c Adapts directory-open fixture to new harness cwd
lib/wasix/tests/wasm_tests/fd_tests.rs Adds Rust coverage/helpers for migrated fd fixtures
lib/wasix/tests/wasm_tests/exception_tests/legacy-exception/main.cpp Adds migrated legacy exception fixture
lib/wasix/tests/wasm_tests/exception_tests/legacy-exception/build.sh Adds build script
lib/wasix/tests/wasm_tests/exception_tests/legacy-exception/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/exception_tests.rs Registers legacy exception migration test
lib/wasix/tests/wasm_tests/dynamic_library_tests/dlopen/side.c Adds migrated dlopen side library fixture
lib/wasix/tests/wasm_tests/dynamic_library_tests/dlopen/main.c Adds migrated dlopen main fixture
lib/wasix/tests/wasm_tests/dynamic_library_tests/dlopen/build.sh Adds build script
lib/wasix/tests/wasm_tests/dynamic_library_tests/dl-needed/side.c Adds migrated dl-needed side fixture
lib/wasix/tests/wasm_tests/dynamic_library_tests/dl-needed/side-needed.c Adds dependent side-library fixture
lib/wasix/tests/wasm_tests/dynamic_library_tests/dl-needed/main.c Adds migrated dl-needed main fixture
lib/wasix/tests/wasm_tests/dynamic_library_tests/dl-needed/main-needed.c Adds dependent main-library fixture
lib/wasix/tests/wasm_tests/dynamic_library_tests/dl-needed/build.sh Adds build script
lib/wasix/tests/wasm_tests/dynamic_library_tests/dl-cache/side2.c Adds migrated dl-cache side fixture
lib/wasix/tests/wasm_tests/dynamic_library_tests/dl-cache/side1.c Adds migrated dl-cache side fixture
lib/wasix/tests/wasm_tests/dynamic_library_tests/dl-cache/main.c Adds migrated dl-cache main fixture
lib/wasix/tests/wasm_tests/dynamic_library_tests/dl-cache/build.sh Adds build script
lib/wasix/tests/wasm_tests/dynamic_library_tests.rs Registers migrated dynamic-library tests
lib/wasix/tests/wasm_tests/context_switching/legacy_process_switching/main.c Adds migrated legacy context/process-switching fixture
lib/wasix/tests/wasm_tests/context_switching/legacy_process_switching/build.sh Adds build script
lib/wasix/tests/wasm_tests/context_switching/legacy_process_switching/build.env Adds fixture env overrides
lib/wasix/tests/wasm_tests/context_switching.rs Registers migrated legacy context-switching test
.github/workflows/test.yaml Removes dedicated legacy WASIX workflow/job

Comment thread lib/wasix/tests/wasm_tests/libc_tests.rs
Comment thread lib/wasix/tests/wasm_tests/context_switching.rs Outdated
@@ -22,7 +22,7 @@ int main() {
fstat(fd, &statbuf);
size_t filesize = statbuf.st_size;

data = mmap(NULL, 3, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 3);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are these changes needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

They're not, the mmap/msync tests don't really work, so it doesn't really matter what we put in them... once we fix msync, we can go back to these and make sure they're in the right shape. I'm keeping them around in the interest of not losing the C sources completely.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we add a comment here than that this test is basically broken?

Comment thread lib/wasix/tests/wasm_tests/fd_tests.rs Outdated
Comment thread lib/wasix/tests/wasm_tests/libc_tests.rs Outdated
Comment thread lib/wasix/tests/wasm_tests/mod.rs
Comment thread lib/wasix/tests/wasm_tests/path_tests.rs Outdated
fn test_create_move_open() {
let wasm = run_build_script(file!(), "create-move-open").unwrap();
fn test_closing_pre_opened_dirs() {
run_path_test_stdout_0("closing-pre-opened-dirs", &[]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What prevents us migrating that to the newly introduced wasm_test macro?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the fact that the old tests have C code that prints a "0" to stdout and we check for it... which is weird, granted, but also changing the sources is more work, which I decided against since my goal of "move stuff to proper rust-based tests" is already achieved. Can do the extra work if you feel it's necessary, @marxin

Copy link
Copy Markdown
Collaborator

@theduke theduke left a comment

Choose a reason for hiding this comment

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

Can you write a wasm_tests/README.md that explains how tests are structured, how to add tests and how to run them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants