-
Notifications
You must be signed in to change notification settings - Fork 5
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
Integration tests #5
Comments
I'd like to see what I can do with this. |
Awesome! Let me know if you have any questions!
…On Sun, 21 Oct 2018, 22:51 Michael Overall, ***@***.***> wrote:
I'd like to see what I can do with this.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABOXx_5eujJ8lNINBSCJU1BtA7Uuyzjks5unN5ogaJpZM4Xyj8o>
.
|
@Michael-Overall how's it going? Anything I can do to help? |
A couple of things (sorry if I was holding things up): I was running into an issue where the server would display the text "not found" when building the original static-filez repo via the instructions in README.md. This is on a VM running Ubuntu 18.04, and trying to open the page in Firefox. from the static-filez directory:
Full disclosure: I was also being a bit ambitious trying to use this issue as an excuse to learn Rust, so I'm running into some scope issues trying to generate temporary files with tempfiles_in() inside a for loop. Although I try to push the file handles to a vector, the files don't seem to persist in the temporary directory (tempfiles claims it will clean up files after their handles go out of scope). |
Oh sorry, didn't mean to imply that -- I'm not actively working this project this week!
Let me try and see if this works on a fresh container with nothing but Debian and Rust 1.29 in it: pascal@~/P/static-filez> docker run -it --rm -v (pwd):/source rust:1.29.2
root@b2f94a80c295:/# cd /source/
root@b2f94a80c295:/source# cargo install --path .
[… a minute or five later (in which I really regret giving the docker vm only two cores) …]
root@b2f94a80c295:/source# mkdir temp
root@b2f94a80c295:/source# echo 'foo' > temp/foo
root@b2f94a80c295:/source# echo 'bar' > temp/bar
root@b2f94a80c295:/source# static-filez build temp temp.archive
root@b2f94a80c295:/source# static-filez serve temp.archive -p 3000 & # & to run in background which also makes the next prompt look weird
[1] 6643
root@b2f94a80c295:/source# Server listening on http://127.0.0.1:3000
root@b2f94a80c295:/source# curl http://127.0.0.1:3000/foo | gunzip # curl doesn't handle compressed responses by default
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 24 100 24 0 0 10371 0 --:--:-- --:--:-- --:--:-- 12000
foo
root@b2f94a80c295:/source# Looks okay? (Heh, this is actually an okay-ish integration test!) Ohhhh, did you only try
That's awesome! I can't promise I have much time this week, but if you like, open a PR with what you have -- including broken code, a text file full of questions, whatever you have right now -- and we can chat about that and I'll try to help answer your questions! (Feel free to contact me in your preferred way, my username is killercup on most platform, be it Twitter, IRC, Discord, or GMail :)) |
Thanks for the feedback, and thanks especially for the open and supportive stance you're taking to your contributors. I'll try to post a pull request tomorrow at the latest (I'd still like to make an effort to clean some things up slightly), as having code up would probably also make it easier to discuss the details of the change. I actually have more questions the more I look at the code. Questions like:
|
Sound good. Don't feel pressured to get something done by then, though. I'm in UTC+2, and I'll be out tomorrow evening anyway :)
It works without index.html files -- they are only needed when request a directory. E.g., you can load So you don't need to create index.html files, if the test only tries to fetch the files. It would, however, be great to have a test that checks that mathcing index.html files are returned when requesting a directory.
Debug sounds fine. Btw, since this will just call out to cargo, it'll have the same cached files available, so it should actually build instantly in most cases. (Assuming you have ever build the project before.) |
We need to ensure that we don't regress the main guarantee we give: That we can serve files without corruption.
To test as much of the code as possible, I propose this test:
I'd write this in a
tests/roundtrip.rs
usingtempfile
to generate files,escargot
andduct
to run the main binary of this crate, andreqwest
to get the data from the server.The text was updated successfully, but these errors were encountered: