Compare commits

...

16 Commits

Author SHA1 Message Date
Ashwin Bhatkal
a542bbc0e2 ci(jsci): run jest in one shard on PRs and three in the merge queue 2026-12-04 00:48:05 +05:30
Ashwin Bhatkal
787a57ae9e ci(jsci): run the full suite when the boot-guard script changes 2026-12-04 00:12:04 +05:30
Ashwin Bhatkal
33f2500cfb ci(jsci): run jest through the primus js-test workflow in 3 shards 2026-12-03 20:42:58 +05:30
Ashwin Bhatkal
a67ffa0508 fix(query-builder): ignore a failed key suggestions request instead of leaving it unhandled 2026-12-03 19:16:20 +05:30
Ashwin Bhatkal
1f48c6f49d ci(jsci): run the full suite when the shared userEvent helper changes 2026-12-03 19:16:01 +05:30
Ashwin Bhatkal
c711d678ce ci(jsci): run only the tests a PR changes, keep the full sharded run in the merge queue 2026-12-03 19:16:01 +05:30
Ashwin Bhatkal
e7884557e0 ci(jsci): run jest on PRs in one job, shard only in the merge queue 2026-12-03 19:16:01 +05:30
Ashwin Bhatkal
3d86d84940 ci(jsci): drop the slow and flaky test reports and the storybook shard timeout 2026-12-03 19:16:01 +05:30
Ashwin Bhatkal
6b754a556d ci(jsci): run jest only in the merge queue 2026-12-03 19:16:01 +05:30
Ashwin Bhatkal
8319d25faa ci(flakyci): post the week's flaky jest tests to Slack instead of an issue 2026-12-03 19:16:01 +05:30
Ashwin Bhatkal
e81c5dad50 ci(jsci): run jest shards only in the merge queue 2026-12-03 19:16:01 +05:30
Ashwin Bhatkal
02c2980f85 ci(storybook): give each shard 15 minutes instead of 10 2026-12-03 19:16:01 +05:30
Ashwin Bhatkal
06d50ed763 ci(flakyci): post the week's flaky jest tests and their last author to an issue 2026-12-03 19:16:01 +05:30
Ashwin Bhatkal
b1543a33db ci(jsci): cache jest transforms across runs of a PR 2026-12-03 19:16:01 +05:30
Ashwin Bhatkal
dc11ad9e4c ci(jsci): list jest tests over 2 s in the job summary 2026-12-03 19:16:01 +05:30
Ashwin Bhatkal
eb5e839501 ci(jsci): run jest in 3 shards behind a stable test / js check 2026-12-03 19:16:00 +05:30
2 changed files with 31 additions and 2 deletions

View File

@@ -28,12 +28,14 @@ jobs:
github.event_name == 'merge_group' ||
(github.event_name == 'pull_request' && ! github.event.pull_request.head.repo.fork && github.event.pull_request.user.login != 'dependabot[bot]' && ! contains(github.event.pull_request.labels.*.name, 'safe-to-test')) ||
(github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe-to-test'))
uses: signoz/primus.workflows/.github/workflows/js-test.yaml@main
uses: signoz/primus.workflows/.github/workflows/js-test.yaml@feat/js-test-shards
secrets: inherit
with:
PRIMUS_REF: main
PRIMUS_REF: feat/js-test-shards
JS_SRC: frontend
JS_PKG_MANAGER: pnpm
JS_TEST_SHARDS: ${{ github.event_name == 'merge_group' && '[1, 2, 3]' || '[1]' }}
JS_TEST_RUN_ALL: '^(\.github/workflows/jsci\.yaml|frontend/(jest\.(config\.ts|setup\.ts|environment\.cjs)|package\.json|pnpm-lock\.yaml|tsconfig[^/]*\.json|babel\.config\.cjs|__mocks__/|src/mocks-server/|src/tests/userEventWithDefaults\.ts|vite-plugins/boot-guard/))'
fmt:
if: |
github.event_name == 'merge_group' ||

View File

@@ -226,6 +226,33 @@ describe('QuerySearch (Integration with Real CodeMirror)', () => {
);
});
it('leaves no unhandled rejection when the key suggestions request fails', async () => {
const unhandled =
jest.fn() as jest.MockedFunction<NodeJS.UnhandledRejectionListener>;
process.on('unhandledRejection', unhandled);
const mockedGetKeys = jest.mocked(getFieldKeySuggestions);
mockedGetKeys.mockClear();
mockedGetKeys.mockRejectedValueOnce(
new Error('Request failed with status code 500'),
);
render(
<QuerySearch
onChange={jest.fn()}
queryData={initialQueriesMap.logs.builder.queryData[0]}
dataSource={DataSource.LOGS}
/>,
);
await waitFor(() => expect(mockedGetKeys).toHaveBeenCalled(), {
timeout: 2000,
});
await act(() => new Promise((resolve) => setTimeout(resolve, 0)));
process.off('unhandledRejection', unhandled);
expect(unhandled).not.toHaveBeenCalled();
});
it('calls provided onRun on Mod-Enter', async () => {
const onRun = jest.fn() as jest.MockedFunction<(q: string) => void>;