-
Notifications
You must be signed in to change notification settings - Fork 821
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
Improvement/nginx integraton test #91
Conversation
tests/integration_tests.rs
Outdated
|
||
|
||
#[test] | ||
fn test_nginx() { |
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.
I think for the integrations simpler might be easier to do it directly with a shell script that can run in CircleCI.
(rather than a rust test itself, that we need to compile first to execute later).
Thoughts?
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.
Yes! @lachlansneff and I talked about writing it in rust. I said I would try it out and this is my stab/iteration.
It does seem a little overkill. My first thought was to write a shell script.
A benefit is our testing lives all under-one-roof. Cargo is the sole program we interact with for running tests. We get the benefit of assertions, cargo visualization, control flow, etc.
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.
I think it could be as simple as a shell script like this. @syrusakbary , if you prefer the simplicity of the shell script, I can drop this PR and make something like this:
# nginx.sh
#! /bin/bash
# Build the release and run nginx
make release
nohup ./target/release/wasmer run examples/nginx/nginx.wasm -- -p examples/nginx/ -c nginx.conf &
sleep 1s
curl localhost:8080 > ./nginx.out
if grep "<title>Nginx running with Wasmer</title>" ./nginx.out
then
echo "SUCCESS"
exit 0
else
echo "FAILURE"
exit 1
fi
rm ./nginx.out
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.
I went ahead and switched it to a shell script.
Makefile
Outdated
@@ -28,7 +28,7 @@ precommit: lint test | |||
|
|||
test: | |||
# We use one thread so the emscripten stdouts doesn't collide | |||
cargo test -- --test-threads=1 $(runargs) | |||
cargo test test_nginx # -- --test-threads=1 $(runargs) |
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.
I think you committed this one by mistake.
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.
I went ahead and switched it to a shell script. This should be reverted now :)
6756053
to
30f87d0
Compare
30f87d0
to
0a38245
Compare
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.
Looks great!
Added first compiler target iteration
Add an integration test for running nginx with wasmer.
This is a brute-force, straight-forward solution. A shell script that starts the nginx server, and then curls it.