From 6e065521c5952f9460382f8c1bdd56714c702ddc Mon Sep 17 00:00:00 2001 From: vivu <46775082+ufelmann@users.noreply.github.com> Date: Fri, 10 Apr 2026 23:04:45 +0200 Subject: [PATCH 1/2] fix: stabilize flaky integration tests (audio pacing timing) - Remove exact chunk count assertion in audio stream test (pacing is async) - Increase Eagle identification wait in E2E-8 speaker security test --- tests/integration-e2e.test.ts | 2 +- tests/integration.test.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/integration-e2e.test.ts b/tests/integration-e2e.test.ts index 7ab0a71..5102c79 100644 --- a/tests/integration-e2e.test.ts +++ b/tests/integration-e2e.test.ts @@ -597,7 +597,7 @@ describe('End-to-End: Speaker & Security', () => { // Stream audio → Eagle identifies alice (owner) await client.streamAudio(15, 640, 2); - await new Promise((r) => setTimeout(r, 300)); + await new Promise((r) => setTimeout(r, 500)); // xAI should have received a session.update with owner-level tools const sessionUpdates = mockXai.receivedMessages.filter((m) => m.type === 'session.update'); diff --git a/tests/integration.test.ts b/tests/integration.test.ts index 30fbe7a..3385ab0 100644 --- a/tests/integration.test.ts +++ b/tests/integration.test.ts @@ -327,8 +327,7 @@ describe('Integration: Realistic Audio Streams', () => { await client.waitForMessageType('audio-start'); await client.waitForMessageType('audio-stop'); - const audioChunks = client.getMessagesByType('audio-chunk'); - expect(audioChunks.length).toBe(5); // mock sends 5 chunks + // Audio pacing delivers chunks asynchronously; total bytes must match expect(client.getTotalAudioBytes()).toBe(5 * 640); // 5 × 640 bytes // Verify transcript arrived From cb9a67a082e9a758cf50e39e5056216e9c1a4d8a Mon Sep 17 00:00:00 2001 From: vivu <46775082+ufelmann@users.noreply.github.com> Date: Fri, 10 Apr 2026 23:06:10 +0200 Subject: [PATCH 2/2] ci: add CI workflow with typecheck + tests on PRs Separate CI (build/test on PRs) from addon image push (on main only). Required status check is now the 'test' job. --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b0deffd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI + +on: + pull_request: + branches: [main] + push: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - run: npm ci + - run: npm run typecheck + - run: npm test