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

Enable WASI tests on Windows CI #2699

Merged

Conversation

zoraaver
Copy link
Contributor

@zoraaver zoraaver commented Nov 1, 2023

I've split this up change into two commits to make it (hopefully!) easier to review.

  • the first commit adds the ability to filter tests in the WASI test runner.
  • the second commit actually enables the WASI tests in CI and implements some additional WASI functions on Windows. Without implementing these additional APIs, it's not possible to run any of the tests since most of them need to at least create/delete a file/directory.

@zoraaver zoraaver force-pushed the enable-wasi-tests branch 3 times, most recently from ba70ea5 to 19af6f3 Compare November 1, 2023 16:04
tests/wamr-test-suites/test_wamr.sh Outdated Show resolved Hide resolved
DWORD win_error = GetLastError();
if (win_error != ERROR_IO_PENDING) {
error = convert_windows_error_code(win_error);
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this an error, shall we check whether i == iovcnt or error after the for loop to check whether there was an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if I'm understanding fully but even if there is an error for one of the read operations, we should still wait on the previous successful read operations. successful_read_count is used to make sure we only wait on the operations which were started successfully.

GetOverlappedResult(handle, &read_operations[j],
&bytes_transferred, true);
}
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

DWORD win_error = GetLastError();
if (win_error != ERROR_IO_PENDING) {
error = convert_windows_error_code(win_error);
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

@zoraaver zoraaver force-pushed the enable-wasi-tests branch 4 times, most recently from d60fbff to da5ce7f Compare November 2, 2023 16:04
In order to start running WASI tests in CI on Windows, add the ability
to filter WASI tests in the test runner scripts. The WASI libc
implementation is not yet complete on Windows so not all the tests are
passing. Once the implementation is complete, we can remove the filter
(although it's probably still useful to keep the filtering functionality
in the test runner either way).
@zoraaver zoraaver force-pushed the enable-wasi-tests branch 6 times, most recently from 29656c6 to 1997ef6 Compare November 2, 2023 18:37
#define PATH_SEPARATORS "/\\"
#else
#define PATH_SEPARATORS "/"
#endif
Copy link
Contributor Author

@zoraaver zoraaver Nov 2, 2023

Choose a reason for hiding this comment

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

Not strictly related to this PR but I realized we'll need it on Windows so paths with backslashes are split into components properly. It would probably be good to verify the behaviour of backslashes with an additional WASI test.

@zoraaver zoraaver force-pushed the enable-wasi-tests branch 6 times, most recently from f0ae5aa to ced80c9 Compare November 2, 2023 19:39
Most of the WASI filesystem tests require at least creating/deleting a
file to test filesystem functionality so some additional filesystem APIs
have been implemented on Windows so we can test what has been
implemented so far. For those WASI functions which haven't been
implemented, we skip the tests. These will be implemented in a future PR
after which we can remove the relevant filters.

Additionally, in order to run the WASI socket and thread tests, we need
to install the wasi-sdk in CI and build the test source code prior to
running the tests.
Copy link
Collaborator

@loganek loganek left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

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

LGTM

@wenyongh wenyongh merged commit 13875f4 into bytecodealliance:dev/wasi-libc-windows Nov 6, 2023
383 checks passed
@zoraaver zoraaver deleted the enable-wasi-tests branch November 6, 2023 11:26
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Most of the WASI filesystem tests require at least creating/deleting a
file to test filesystem functionality so some additional filesystem APIs
have been implemented on Windows so we can test what has been
implemented so far. For those WASI functions which haven't been
implemented, we skip the tests. These will be implemented in a future PR
after which we can remove the relevant filters.

Additionally, in order to run the WASI socket and thread tests, we need
to install the wasi-sdk in CI and build the test source code prior to
running the tests.
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.

3 participants