Skip to content

fix: make worker tests more reliable and skip on unrelated PRs#5534

Merged
chitalian merged 1 commit intomainfrom
jusitn/fix-tests
Jan 21, 2026
Merged

fix: make worker tests more reliable and skip on unrelated PRs#5534
chitalian merged 1 commit intomainfrom
jusitn/fix-tests

Conversation

@chitalian
Copy link
Contributor

  • Add path filters to PR trigger so worker tests only run when worker/packages code changes (not on unrelated PRs)
  • Add singleWorker: true to avoid isolated storage conflicts with Durable Objects in parallel test execution
  • Increase testTimeout to 30s for Durable Object tests

Ticket

Link to the ticket(s) this pull request addresses.

Component/Service

What part of Helicone does this affect?

  • Web (Frontend)
  • Jawn (Backend)
  • Worker (Proxy)
  • Bifrost (Marketing)
  • AI Gateway
  • Packages
  • Infrastructure/Docker
  • Documentation

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Performance improvement
  • Refactoring

Deployment Notes

  • No special deployment steps required
  • Database migrations need to run
  • Environment variable changes required
  • Coordination with other teams needed

Screenshots / Demos

Before After

Extra Notes

Any additional context, considerations, or notes for reviewers.

Context

Why are you making this change?

Screenshots / Demos

- Add path filters to PR trigger so worker tests only run when
  worker/packages code changes (not on unrelated PRs)
- Add singleWorker: true to avoid isolated storage conflicts
  with Durable Objects in parallel test execution
- Increase testTimeout to 30s for Durable Object tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
helicone Ready Ready Preview, Comment Jan 21, 2026 4:27am
helicone-bifrost Building Building Preview, Comment Jan 21, 2026 4:27am
helicone-eu Ready Ready Preview, Comment Jan 21, 2026 4:27am

Request Review

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@supabase
Copy link

supabase bot commented Jan 21, 2026

This pull request has been ignored for the connected project bolqqmqbrciybnypvklh because there are no changes detected in supbase/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@supabase
Copy link

supabase bot commented Jan 21, 2026

This pull request has been ignored for the connected project lmahfbbnchpworytrrqk because there are no changes detected in .supabase/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@claude
Copy link
Contributor

claude bot commented Jan 21, 2026

Claude finished @chitalian's task —— View job


PR Review Complete ✅

Reviewing PR #5534: "fix: make worker tests more reliable and skip on unrelated PRs"

Todo List:

  • Read and analyze changed files
  • Review workflow path filter changes
  • Review vitest configuration changes
  • Provide comprehensive feedback with suggestions
  • Assign confidence score and summary

Score: 9/10 - Excellent improvements with minor optimization suggestions

This PR makes solid improvements to test reliability and CI efficiency. The changes are well-targeted and address real issues with worker test execution.

Suggestions Summary:

  • Consider adding worker test output retention for debugging
  • Minor workflow optimization opportunity with job conditions

Detailed Review

Workflow Changes (.github/workflows/worker-test.yml:8-18)

Excellent addition - Adding path filters to both push and pull_request triggers is a smart optimization that will:

  • Reduce unnecessary CI runs when changes don't affect worker or package code
  • Save CI resources and provide faster feedback on unrelated changes
  • Follow best practices for monorepo CI optimization

Suggestion: Consider adding artifact retention for test outputs to help with debugging failures:

- name: Upload test results
  if: failure()
  uses: actions/upload-artifact@v4
  with:
    name: worker-test-results
    path: worker/test-results/
    retention-days: 7

Vitest Configuration (worker/test/ai-gateway/vitest.config.mts:6,9)

singleWorker: true (line 9) - This is a crucial fix for Durable Object tests:

  • Durable Objects have isolated storage that can conflict in parallel execution
  • Sequential execution ensures proper test isolation
  • Trade-off between speed and reliability is appropriate here

testTimeout: 30000 (line 6) - Increasing timeout to 30 seconds is reasonable:

  • Durable Object initialization can be slower than regular unit tests
  • 30s provides adequate buffer without being excessive
  • Good balance between reliability and fast feedback

Configuration Quality

The vitest configuration is well-structured with:

  • Proper alias mappings for monorepo packages
  • Comprehensive KV namespace bindings for testing
  • Appropriate retry logic (retry: 2)
  • Good use of setup files

Minor Optimizations

  1. Workflow efficiency: You could add a job-level condition to skip the entire job when no relevant files changed, though the current approach with path filters is already quite effective.

  2. Test parallelization: While singleWorker: true is necessary for Durable Objects, consider whether some test suites could be split to run certain tests in parallel while keeping Durable Object tests sequential.

Security & Best Practices

  • ✅ No security concerns
  • ✅ Follows CI best practices with proper caching
  • ✅ Uses appropriate Cloudflare Workers testing patterns
  • ✅ Maintains existing security configurations

The changes are focused, well-reasoned, and directly address the stated problems. Great work on improving test reliability while optimizing CI resource usage!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant