-
-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
It seems that src/packages/emmett-sqlite/src/eventStore/consumers/sqliteEventStoreConsumer.handling.int.spec.ts is using a database called test for the test.
However its path is in the same location as its test and the filename is fixed. This causes two issues:
- Test isolation: Running the tests in parallel for the same checkout directory of Emmett could cause a race condition. For instance a test could try cleaning up the database while tests are still running in the other process.
- Missing
.gitignore: The database is not ignored in git, which makes it prone to accidentally committing it
Also as of 65d846e the tests do not pass on my machine.
Suggestion for fixing
- Use a temporary path / filename with a random suffix per test run as a best practice to integration tests, e.g. https://nodejs.org/api/fs.html#fspromisesmkdtempprefix-options
- Add database files (wal and shm) to .gitignore