Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(ci): select jest tests for changed packages files (#125287)

Sam Pennington7cc8b87d84bf
diff --git a/.github/scripts/jest-select.js b/.github/scripts/jest-select.js
index c6ab98202572..dbd22ea510bc 100644
--- a/.github/scripts/jest-select.js
+++ b/.github/scripts/jest-select.js
@@ -64,7 +64,7 @@ function classifyChanges({ files, diffOutcome, isDraft }) {
}
const sources = files
.filter((file) => /\.(ts|tsx|js|jsx|mjs|cjs|json)$/.test(file))
- .filter((file) => /^(frontend|products|common|ee\/frontend)\//.test(file))
+ .filter((file) => /^(frontend|products|packages|common|ee\/frontend)\//.test(file))
.map((file) => (file.startsWith('frontend/') ? file.slice('frontend/'.length) : `../${file}`))
// Listing must use the same space-separated arguments as the test job.
const changedFiles = sources.join(' ').split(' ').filter(Boolean)
diff --git a/.github/scripts/jest-select.test.js b/.github/scripts/jest-select.test.js
index 2e99319c8617..786b5770cefc 100644
--- a/.github/scripts/jest-select.test.js
+++ b/.github/scripts/jest-select.test.js
@@ -40,6 +40,7 @@ test('selection resolves source paths from the frontend package and retains the
files: [
'frontend/src/a.ts',
'products/example/frontend/a.tsx',
+ 'packages/quill/packages/charts/src/a.ts',
'common/example/data.json',
'ee/frontend/a.js',
'frontend/src/a.scss',
@@ -52,10 +53,11 @@ test('selection resolves source paths from the frontend package and retains the
changedFiles: [
'src/a.ts',
'../products/example/frontend/a.tsx',
+ '../packages/quill/packages/charts/src/a.ts',
'../common/example/data.json',
'../ee/frontend/a.js',
],
- changedFileCount: 7,
+ changedFileCount: 8,
}
)
})