0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 00:47:50 +01:00
posthog/plugin-server/jest.config.functional.js
Harry Waye 1e6c062095
feat(plugin-server): distribute scheduled tasks i.e. runEveryX (#13124)
* chore(plugin-server): disrtibute scheduled tasks

Changes I've made here from the original PR:

 1. add some logging of task run times
 2. add concurrency, except only one task of a plugin will run at a time
 3. add a timeout to task run times

This reverts commit 23db43a0dc.

* chore: add timings for scheduled tasks runtime

* chore: add timeouts for scheduled tasks

* chore: clarify duration unit

* chore: deduplicate tasks in a batch, add partition concurrency

* chore: add flag to switch between old and new behaviour

This defaults to new, but can be set to old by setting environment
variable `USE_KAFKA_FOR_SCHEDULED_TASKS=false`

* fix tests

* enable USE_KAFKA_FOR_SCHEDULED_TASKS in tests
2022-12-05 12:30:52 +00:00

22 lines
579 B
JavaScript

module.exports = {
transform: {
'^.+\\.(t|j)s$': [
'@swc/jest',
{
jsc: {
target: 'es2021',
},
sourceMaps: true,
},
],
},
coverageProvider: 'v8',
testEnvironment: 'node',
testMatch: ['<rootDir>/functional_tests/**/*.test.ts'],
setupFilesAfterEnv: ['<rootDir>/functional_tests/jest.setup.ts'],
globalTeardown: '<rootDir>/functional_tests/jest.global-teardown.ts',
testTimeout: 60000,
maxConcurrency: 10,
maxWorkers: 6,
}