From 26554f7168182c38c0cc7586caab5fcba7a73fbf Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sat, 24 Oct 2020 12:30:23 +0200 Subject: [PATCH] Use unique sqlite file for every E2E test Previously, this lead to locking errors, when multiple test runners accessed the same database and tried to clear it or tried to insert new test data. Signed-off-by: David Mehren --- test/public-api/media.e2e-spec.ts | 2 +- test/public-api/notes.e2e-spec.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/public-api/media.e2e-spec.ts b/test/public-api/media.e2e-spec.ts index a1f2c8357..533175874 100644 --- a/test/public-api/media.e2e-spec.ts +++ b/test/public-api/media.e2e-spec.ts @@ -25,7 +25,7 @@ describe('Notes', () => { MediaModule, TypeOrmModule.forRoot({ type: 'sqlite', - database: './hedgedoc-e2e.sqlite', + database: './hedgedoc-e2e-media.sqlite', autoLoadEntities: true, dropSchema: true, synchronize: true, diff --git a/test/public-api/notes.e2e-spec.ts b/test/public-api/notes.e2e-spec.ts index 09678dbb6..ce2190947 100644 --- a/test/public-api/notes.e2e-spec.ts +++ b/test/public-api/notes.e2e-spec.ts @@ -23,9 +23,10 @@ describe('Notes', () => { GroupsModule, TypeOrmModule.forRoot({ type: 'sqlite', - database: './hedgedoc-e2e.sqlite', + database: './hedgedoc-e2e-notes.sqlite', autoLoadEntities: true, synchronize: true, + dropSchema: true, }), LoggerModule, ], @@ -34,8 +35,6 @@ describe('Notes', () => { app = moduleRef.createNestApplication(); await app.init(); notesService = moduleRef.get(NotesService); - const noteRepository = moduleRef.get('NoteRepository'); - noteRepository.clear(); }); it(`POST /notes`, async () => {