目录
Anthony Shew

test: Add regression tests and OutputWatcher trait to prepare for daemon removal from turbo watch (#12171)

Summary

  • Defines the OutputWatcher trait that will replace DaemonClient in RunCache/TaskCache when we remove the daemon from watch mode
  • Adds regression tests that characterize current watch behavior and must stay green throughout the daemon removal refactor

What’s here

OutputWatcher trait (turborepo-run-cache): Abstracts get_changed_outputs and notify_outputs_written — the two operations TaskCache uses to prevent infinite rebuild loops in watch mode. Currently these go through the daemon’s gRPC interface; the trait lets us swap in an in-process GlobWatcher without changing TaskCache.

8 mock-based unit tests (turborepo-run-cache): Characterize the trait contract — empty results, partial changes, error recovery for both get and notify, lifecycle round-trips, per-hash independence, and `Send

  • Sync` compliance.

3 GlobWatcher delegation tests (turborepo-filewatch): Verify that GlobWatcher::watch_globs/get_changed_globs satisfy the OutputWatcher contract when called with raw strings and GlobSet::from_raw — the exact path the future InProcessOutputWatcher will use. Tests cover unchanged outputs, changed outputs, and exclusion glob handling.

2 E2E watch tests (watch_test.rs):

  • watch_no_spurious_rebuild_after_settle — After the initial build, no further rebuilds occur when no files change. Guards against infinite rebuild loops from cache restores triggering the file watcher.
  • watch_same_content_write_does_not_rebuild — Writing identical content to a source file does not trigger a rebuild. Guards against hash-based deduplication regression.

Testing

All 13 new tests pass locally. The 2 E2E tests are automatically serialized via the existing nextest turbo-watch-serial group.

2个月前9043次提交

Turborepo

Turborepo is a high-performance build system for JavaScript and TypeScript codebases, written in Rust.

Getting Started

Visit https://turborepo.dev to get started with Turborepo.

Contributing

See CONTRIBUTING.md for more information.

Community

The Turborepo community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects.

To chat with other community members, you can join Vercel Community’s #turborepo tag.

Our Code of Conduct applies to all Turborepo community channels.

Who is using Turborepo?

Turborepo is used by the world’s leading companies. Check out the Turborepo Showcase to learn more.

Updates

Follow @turborepo on X for project updates.

Security

If you believe you have found a security vulnerability in Turborepo, we encourage you to responsibly disclose this and not open a public issue. We will investigate all legitimate reports. Email security@vercel.com to disclose any security vulnerabilities.

https://vercel.com/security

邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号