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

Add E2E tests for wasm workload running #2132

Open
YJDoc2 opened this issue Jul 5, 2023 · 5 comments
Open

Add E2E tests for wasm workload running #2132

YJDoc2 opened this issue Jul 5, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request kind/test

Comments

@YJDoc2
Copy link
Collaborator

YJDoc2 commented Jul 5, 2023

Continuing from #2087 (comment)
Currently we simply merge PRs which update dependencies related to wasm such was wasmer , wasm-edge etc. as long as they compile and pass the unit tests and e2e tests. However, there are no specific e2e tests which test that wasm workload is correctly run and does not fail to to our package version update. Adding tests for that would be useful to maintain an overall sanity check on such dependencies update.

Currently I'm thinking of tests as this :

  • compile with wasm-wasmer and run a wasm workload which o/p a specific string, check that it works
  • same for wasm-wasmedge and wasm-wasmtime
  • Add some invalid workload/failing wasm and expect that to fail in the testcase
  • Add a k8s based tests similar to runwasi, that deploys a wasm based pod and checks that it works , using youki as a runtime.

Currently I'm thinking how to implement the first 3 types of tests, we can use the test-framework and write them similar to how we are doing the rust e2e tests. It'll be a bit tedious to spwan the process and get its output, but nothing that we haven't done before.

Other way would be to add a Js based script running via node js, and use that, which makes spawning process a bit simpler, but adds node as a overall dev dependency. I might prefer the first approach due to that.

Finally we might also add a sanity validation for tests themselves by running the tests on podman+crun and expecting them to pass, as that is currently only other one that supports wasm workload (I think).

Comments and suggestions welcome. @utam0k @yihuaf

@YJDoc2 YJDoc2 self-assigned this Jul 5, 2023
@YJDoc2 YJDoc2 added enhancement New feature or request kind/test labels Jul 5, 2023
@utam0k
Copy link
Member

utam0k commented Jul 9, 2023

I don't recommend this way. I don't think there is anything existing yet that use WASM container in the real world. It should not be relied upon because it has no proven track record.

Finally we might also add a sanity validation for tests themselves by running the tests on podman+crun and expecting them to pass, as that is currently only other one that supports wasm workload (I think).

@utam0k
Copy link
Member

utam0k commented Jul 9, 2023

I prefer this for the same reason you do.

we can use the test-framework and write them similar to how we are doing the rust e2e tests. It'll be a bit tedious to spwan the process and get its output, but nothing that we haven't done before.

@YJDoc2
Copy link
Collaborator Author

YJDoc2 commented Jul 10, 2023

I don't recommend this way. I don't think there is anything existing yet that use WASM container in the real world. It should not be relied upon because it has no proven track record.

Very well, then they'd be youki-specific tests 👍

I prefer this for the same reason you do.

👍 I'll go this way then!

@utam0k
Copy link
Member

utam0k commented Jul 10, 2023

Let's go!!! 🚀 🚀

@yihuaf
Copy link
Collaborator

yihuaf commented Jul 11, 2023

It'll be a bit tedious to spwan the process and get its output, but nothing that we haven't done before.

Someone mentioned this crate to me. Not sure if that helps us to remove some of the tedious bits. https://github.com/assert-rs/assert_cmd

The first 3 types of test is a very good start. I agree for now let's re-use the existing framework we have. I think we will have a better idea if there is any better alternative after writing those tests first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kind/test
Projects
None yet
Development

No branches or pull requests

3 participants