diff --git a/.github/workflows/e2e-1c1d.yml b/.github/workflows/e2e-1c1d.yml index 5f01d42..2cb20be 100644 --- a/.github/workflows/e2e-1c1d.yml +++ b/.github/workflows/e2e-1c1d.yml @@ -2,9 +2,9 @@ name: E2E Tests (1C1D) on: push: - branches: [ main, dev/* ] + branches: [ develop, dev/* ] pull_request: - branches: [ main ] + branches: [ develop ] jobs: e2e-1c1d: diff --git a/.github/workflows/e2e-1c3d.yml b/.github/workflows/e2e-1c3d.yml index d2bfd81..8c336e7 100644 --- a/.github/workflows/e2e-1c3d.yml +++ b/.github/workflows/e2e-1c3d.yml @@ -2,9 +2,9 @@ name: E2E Tests (1C3D) on: push: - branches: [ main, dev/* ] + branches: [ develop, dev/* ] pull_request: - branches: [ main ] + branches: [ develop ] jobs: e2e-1c3d: diff --git a/jest.config.js b/jest.config.js index 7c61c56..5be6d6c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -4,6 +4,13 @@ module.exports = { roots: ['/tests'], testMatch: ['**/*.test.ts'], moduleFileExtensions: ['ts', 'js', 'json'], + // thrift@0.23 pulls in uuid@13, which ships ESM-only (type: "module"). + // ts-jest must compile it to CommonJS, so allow .js transforms and stop + // ignoring the uuid package under node_modules. + transform: { + '^.+\\.[tj]s$': ['ts-jest', { tsconfig: { allowJs: true } }], + }, + transformIgnorePatterns: ['/node_modules/(?!uuid/)'], collectCoverageFrom: [ 'src/**/*.ts', '!src/**/*.d.ts', diff --git a/tests/e2e/Redirection.test.ts b/tests/e2e/Redirection.test.ts index e9a41a6..5a4dccb 100644 --- a/tests/e2e/Redirection.test.ts +++ b/tests/e2e/Redirection.test.ts @@ -156,12 +156,17 @@ describe("Redirection E2E Tests", () => { "root.test_redirect.device5", ]; - for (const deviceId of devices) { + const baseTime = Date.now(); + for (const [index, deviceId] of devices.entries()) { const tablet = { deviceId, measurements: ["temperature", "humidity"], dataTypes: [TSDataType.FLOAT, TSDataType.FLOAT], - timestamps: [Date.now()], + // Offset each device's timestamp so the fast write loop cannot + // assign the same millisecond to two devices. Tree-model queries + // align rows by timestamp, so colliding timestamps would merge + // rows and make the row count fall short of the device count. + timestamps: [baseTime + index], values: [[25.5 + Math.random() * 5, 60.0 + Math.random() * 10]], };