-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 integration tests for examples #777
Comments
Hi, I'd like to get familiar with this project so I want to help with this issue. This could be written as a Rust integration test or is something like .py script for each backend more preferable? |
I'm interested in this issue because I'm trying to figure out how to test my own application that uses diesel. Will I have to run my own CI server with a DB to connect to and verify after every command? There has to be a better way. Hopefully tests in the examples will give me an idea. |
Since there hasn't been any activity on this since 2017, I'd like to tackle this issue 😄 |
@heyztb sure, go for it! Maybe open a PR with a rough idea what you want to test and then iterate on that? This way, we can give you feedback as early as possible. Alternatively, feel free to ask questions here or (preferred) on Gitter. |
@killercup - Sounds good. I'll open a PR once I've got a tentative test up and running. I'm going to work on the Postgres example first, mainly because I'm not sure exactly which library I need to install in order to work with MySQL (I'm on macOS Mojave, btw). I do have a question, and I figured this would be an appropriate place to ask but I'm also going to link this issue to the Gitter channel and get some feedback there - I understand that this issue asks for Integration tests, and I've taken a look at the assert_cmd crate, but I'm not too sure how I'd pass in arguments to the various binaries. I'd rather the tests not require actual user input, and I would like to simulate that instead. My question is, how do I go about passing in things like the title and body of a post in my tests? There's no straightforward way from what I can tell, so are we sure that unit tests aren't more appropriate for this? Thanks for the help. I look forward to contributing more! |
@heyztb cool! Very good question regarding the interativity! I actually totally forgot about that. It would be nice to test that, but it's totally fine to start with unit tests: We are trying to make sure the diesel examples are fine, not that In my capacity as author of assert_cli and CLI working group lead, I am very interested in making sure we can write those tests, however! There is assert-rs/assert_cmd#28 which tracks this in some fashion. For all things CLI (testing or otherwise) you are also very welcome to join https://gitter.im/rust-lang/WG-CLI (or |
Hello, is this still a need? Found this issue on goodfirstissue.dev and would be interested in working on this. |
@mwspracklen We are still looking for help here. Feel free to start working on this issue. Just let us know if you hit a roadblock and need help somewhere. |
No longer working on this since VicVerevita has begun working on it. |
We currently have the app from the Getting Started guide implemented for all backends, but there are no tests to ensure they all behave the same.
The app implements several simple binaries to create/display/publish/delete posts. Writings some tests that interact with all the binaries and assert their output is good would be great (it doesn't even have to cover all failure cases).
I wrote the assert_cli crate for a similar use-case. There might be better crates for that now, though. Or actually, it might be possible to do that in a shell script. (Don't know how well that works on Windows, though.)
The text was updated successfully, but these errors were encountered: