Open jaulz opened 2 months ago
What are the steps to actually use SQLite testing? Do all tests pass with it?
It's quite easy:
sqlite test
(make sure you select anything, e.g. SELECT 1;
, so it creates the file)phpunit.xml
:
<env name="LIGHTHOUSE_TEST_DB_DRIVER" value="sqlite"/>
Unfortunately, not all tests pass but they help me to develop in an environment (gitpod.io) to quickly iterate on ideas. These tests fail:
There were 3 failures:
1) Tests\Integration\Cache\CacheDirectiveTest::testCacheHasManyResolver
This query should only run once and be cached on the second run.
Failed asserting that 0 is identical to 1.
/workspace/lighthouse/tests/Integration/Cache/CacheDirectiveTest.php:397
2) Tests\Integration\Cache\CacheDirectiveTest::testAttachTagsToCache
This query should only run once and be cached on the second run.
Failed asserting that 0 is identical to 1.
/workspace/lighthouse/tests/Integration/Cache/CacheDirectiveTest.php:467
3) Tests\Integration\Schema\Directives\LikeDirectiveTest::testLikeClientWildcardsAreEscapedFromTemplate
Unable to find JSON fragment:
[{"users":[{"name":"Aar%on"}]}]
within
[{"data":{"users":[]}}].
Failed asserting that false is true.
/workspace/lighthouse/vendor/laravel/framework/src/Illuminate/Testing/AssertableJsonString.php:142
/workspace/lighthouse/vendor/laravel/framework/src/Illuminate/Testing/TestResponse.php:761
/workspace/lighthouse/tests/Integration/Schema/Directives/LikeDirectiveTest.php:108
Changes
This PR allows developers to easily use SQLite during testing without setting up a MySQL database.
Breaking changes
n/a