-
Notifications
You must be signed in to change notification settings - Fork 28
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
test: add test cases for serve #15
Conversation
src/lib.rs
Outdated
@@ -66,6 +66,7 @@ fn serve(req: Request) -> Result<Response> { | |||
.get(PATH_INFO_HEADER) | |||
.expect("PATH_INFO header must be set by the Spin runtime") | |||
.to_str()?; | |||
println!("path: {}", path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stray println
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it. Thank you.
Hi reviewers, this is my first time writing test cases for a wasm target. Thanks for your review and guidance. I have two questions.
|
Thanks for the PR! It doesn't look like these tests really depend on being run in a Wasm environment; I tested locally by replacing |
I don't see anything obvious in the cargo docs to simplify it, but for the purposes of this PR I think we can use this slightly awkward command in the Makefile: |
Yeah, this is a good idea. I just saw that cargo merged multiple targets a few days ago. Probably, we can also try it? |
Signed-off-by: Frank Yang <[email protected]>
Hi @lann, I update test cases and add CI. Please help me review when you have time. Thank you. |
.github/workflows/build.yml
Outdated
@@ -0,0 +1,52 @@ | |||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified a lot for this repo - much of what we want to test for spin doesn't apply here. If you'd like to drop this from your PR I can add something simple in a followup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgive me if I'm misreading, but it looks like you dropped this line and kept the rest of the file. If we keep the file (which is what I think @lann was questioning), then we should keep this line. The reason is that this declaration avoids squigglies when editing the workflow in VS Code if you have the YAML extension installed. The YAML language server seems to recognise certain filenames and infer a schema, and for build.yaml
it infers something other than GH workflow and complains about the 'wrong' entries.
Again, if I've misunderstood then please ignore me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Frank Yang <[email protected]>
Thanks for the PR! |
resolves #1 #2