getting started integration tests #4083
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Working on adding integration tests per #777 . I've created a quick example of how I'm planning to implement this in examples/sqlite/getting_started_step_2 . Initial thought is to add a tests directory with a test that uses assert_cmd to run the relevant binaries for each step. Considering writing in some calls to diesel to examine the database as well, let me know if that's the correct route or if just verifying binary output is sufficient.
In examples/sqlite/getting_started_step_2 I ran the following to test
echo "DATABASE_URL=file:/tmp/test.db" > .env; rm -f /tmp/test.db ; diesel migration run; cargo test; rm -f .env