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

feat(PocketIC): make PocketIC library run on Windows seamlessly #2138

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mraszyk
Copy link
Contributor

@mraszyk mraszyk commented Oct 20, 2024

This PR makes canister tests using the PocketIC library run seamlessly on Windows:

  • this PR removes the CLI option --pid of the PocketIC server and makes the CLI option --port-file behave like --pid: only one PocketIC server process listens at a port and writes that port to the specified port file. This change was necessary because the (implicit) port file created using --pid in a WSL temporary directory cannot be read from a native Windows cargo test invokation;
  • this PR disables doc tests of the PocketIC library since they fail on both Linux and Windows at the moment.

This PR has been tested manually by running cargo test -p pocket-ic on a Windows laptop. It is not possible to have a CI test on a Windows runner because they only support WSLv1, but WSLv2 is required (see forum post).

@mraszyk mraszyk requested a review from a team as a code owner October 20, 2024 10:54
@github-actions github-actions bot added the feat label Oct 20, 2024
@@ -1354,6 +1355,7 @@ fn subnet_metrics() {
assert!((1 << 16) < metrics.canister_state_bytes && metrics.canister_state_bytes < (1 << 17));
}

#[cfg(unix)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note for reviewers: this test fails on Windows because localhost subdomains (http://<canister-id>.localhost) are not supported on Windows.

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

Successfully merging this pull request may close these issues.

1 participant