buck2-local-resources

Automates end-to-end local-resource testing in Buck2 with broker scripts and LocalResourceInfo.

11|1|Updated Apr 9, 2025
One-click install
npx skills add https://github.com/thoughtpolice/a --skill buck2-local-resources
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: buck2-local-resources
Source: https://github.com/thoughtpolice/a/tree/main/.claude/skills/buck2-local-resources
Command: npx skills add https://github.com/thoughtpolice/a --skill buck2-local-resources

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Buck2 tests often require external resources (databases, HTTP servers, message queues); this skill shows how to orchestrate local resources using Buck2 LocalResourceInfo and ExternalRunnerTestInfo, managing lifecycle and environment pass-through.

Core Features & Use Cases

  • Create Buck2 tests with local resources (databases, HTTP servers, and more) and manage their lifecycle automatically.
  • Pass connection details to tests via environment variables using LocalResourceInfo.
  • Compose multi-resource test scenarios (e.g., HTTP server + database) with ExternalRunnerTestInfo.

Quick Start

Create a broker script that outputs JSON with pid and resource details, then wire it into a broker rule and a test rule to run under Buck2.

Frequently Asked Questions about buck2-local-resources

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Buck2 tests with local resources like databases and HTTP servers?

To set up Buck2 tests with local resources, you orchestrate broker scripts, LocalResourceInfo, and ExternalRunnerTestInfo to manage the lifecycle of external processes and pass connection details via environment variables.

How does Buck2 LocalResourceInfo pass environment variables to test rules?

Buck2 LocalResourceInfo passes connection details and environment variables to test rules by capturing outputs from a broker script, which outputs JSON containing pid and resource details for the test environment.

Can I compose multi-resource test scenarios in Buck2 for an HTTP server and database?

You can compose multi-resource test scenarios in Buck2 using ExternalRunnerTestInfo to coordinate setups like an HTTP server alongside a database, managing multiple local resources simultaneously.

What is the best way to manage dynamic port allocation and readiness checks for Buck2 integration tests?

The best way to manage dynamic port allocation and readiness checks for Buck2 integration tests is by orchestrating local resources through broker scripts that handle service readiness before propagating environment variables to the test rules.

Does Buck2 external runner testing support Unix sockets and message queues?

Buck2 external runner testing supports local resources requiring external processes or services, including message queues and Unix sockets, by coordinating their setup through broker scripts and LocalResourceInfo.