diff --git a/packages/transcribe/README.md b/packages/transcribe/README.md index 431fc01fe1..94075c5eeb 100644 --- a/packages/transcribe/README.md +++ b/packages/transcribe/README.md @@ -29,7 +29,13 @@ For further customization look at `.env-sample-transcribe` ## Testing -The integration tests that require the full model to run **don't run on the CI**. It is necessary to be extra careful when changing the model or the prompt because of that. The specific test that has been disabled is at `workers/JobProcessor.test.ts` +The integration tests that require the full model to run **don't run by default, including on CI**. It is necessary to be extra careful when changing the model or the prompt because of that. The specific test that has been disabled is at `workers/JobProcessor.test.ts` + +To run all tests, use the command: + +``` +yarn test-all +``` ## Setup up the database diff --git a/packages/transcribe/package.json b/packages/transcribe/package.json index 21e3fb1810..2762c6c51c 100644 --- a/packages/transcribe/package.json +++ b/packages/transcribe/package.json @@ -8,6 +8,7 @@ "start": "node dist/src/api/app.js", "tsc": "tsc --project tsconfig.json", "test": "jest --verbose=false", + "test-all": "TRANSCRIBE_RUN_ALL=1 jest --verbose=false", "test-ci": "yarn test", "clean": "gulp clean", "watch": "tsc --watch --preserveWatchOutput --project tsconfig.json" diff --git a/packages/transcribe/src/workers/JobProcessor.test.ts b/packages/transcribe/src/workers/JobProcessor.test.ts index 0620fa4bb5..d919eb4484 100644 --- a/packages/transcribe/src/workers/JobProcessor.test.ts +++ b/packages/transcribe/src/workers/JobProcessor.test.ts @@ -12,7 +12,7 @@ const cleanUpResult = (result: string) => { return result.replace('“', '"').replace('”', '"'); }; -const skipIfCI = process.env.IS_CONTINUOUS_INTEGRATION ? it.skip : it; +const skipByDefault = (process.env.IS_CONTINUOUS_INTEGRATION || process.env.TRANSCRIBE_RUN_ALL !== '1') ? it.skip : it; describe('JobProcessor', () => { let queue: BaseQueue; @@ -31,7 +31,7 @@ describe('JobProcessor', () => { await cleanUpDb('./JobProcessor.test.sqlite3'); }); - skipIfCI('should execute work on job in the queue', async () => { + skipByDefault('should execute work on job in the queue', async () => { jest.useRealTimers(); const tw = new JobProcessor(queue, new HtrCli('joplin/htr-cli:0.0.2', 'images'), 1000); await tw.init(); @@ -53,7 +53,7 @@ describe('JobProcessor', () => { } }, 6 * Minute); - skipIfCI('should execute work on job in the queue even if one fails', async () => { + skipByDefault('should execute work on job in the queue even if one fails', async () => { jest.useRealTimers(); const tw = new JobProcessor(queue, new HtrCli('joplin/htr-cli:0.0.2', 'images'), 1000); await tw.init();