Skip to content
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

Tests with sqlite in-memory #104

Conversation

CyberiaResurrection
Copy link
Contributor

No direct bug fixes here, but laying the ground work to easily write (and use) more comprehensive and aggressive tests. As a nice side effect, migrations and seeds get a workout with each test run.

The immediate use case I had in mind when making these changes was tackling #95, since that looks like it might need a functional test to fully characterise underlying issue - I have no doubt blank first and/or last name is part of issue, but it might not be all of it.

This diff renders database as used in automated test suite
independent of configured production database connection - you can
freely run tests without affecting your production database.

I tested the above by turning off my local MySQL server - test suite
did not complain and ran exactly as it had before I turned my local
server off.

I am aiming to enable more aggressive and comprehensive automated
testing, at unit, integration and functional levels.  For example,
assuming Laravel's functionality is up to it, it now should be possible
to write a functional test that creates a new user (possibly with
some problems) and verify that the new user gets created cleanly or
not at all..
@CyberiaResurrection CyberiaResurrection changed the title Tests with sqlite memory Tests with sqlite in-memory Jul 18, 2016
@chintanbanugaria
Copy link
Owner

@CyberiaResurrection You have changed the default DB to sqlite. Is it working for you with left and inner joins with tables ?

@CyberiaResurrection
Copy link
Contributor Author

I haven't changed the default for production - that remains at whatever has already been set (currently mysql), only for running tests.

Give me a bit and I'll push up a test case.

@CyberiaResurrection
Copy link
Contributor Author

As promised, a test case illustrating how to do a basic join using Laravel's database abstraction layer.

@CyberiaResurrection
Copy link
Contributor Author

Sorry, that was a rather long-winded way of saying yes, they work. I was also trying to give you a way to independently check that joins work.

@CyberiaResurrection
Copy link
Contributor Author

Is there anything else you want me to provide?

@chintanbanugaria chintanbanugaria merged commit 18fcaa9 into chintanbanugaria:master Jul 21, 2016
@CyberiaResurrection CyberiaResurrection deleted the Tests-with-SQLite-Memory branch July 21, 2016 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants