Add test-env setup script and skill for Claude Code cloud sessions#8065
Open
phacops wants to merge 2 commits into
Open
Add test-env setup script and skill for Claude Code cloud sessions#8065phacops wants to merge 2 commits into
phacops wants to merge 2 commits into
Conversation
Add an on-demand setup script (scripts/setup-test-env.sh) plus a companion skill that prepare an ephemeral Linux container (e.g. a Claude Code cloud session) for running the test suite: - install sentry-devenv via the official bash installer - run `uv sync` (builds the venv and compiles the rust_snuba extension) - start the Docker daemon if needed - bring up devservices (clickhouse, redis, kafka) This is a standalone script rather than a session-start hook so the multi-minute cost is only paid when tests are actually needed. Lower the clickhouse `nofile` ulimit in devservices/config.yml to soft 1024 / hard 4096 so the container can start in environments without CAP_SYS_RESOURCE (the previous 262144 cannot be applied there). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01CutWwsFwLDtczduJzjvF8Y
…devenv-install-2m7nbg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an on-demand script + skill that prepares an ephemeral Linux container (e.g. a Claude Code cloud session) for running the Snuba test suite, where nothing is installed and the Docker daemon is not running.
This is intentionally a standalone script rather than a session-start hook —
uv syncplus pulling the clickhouse/redis/kafka images takes several minutes, so we only pay that cost on demand when tests are actually needed.Changes
scripts/setup-test-env.sh— idempotent setup script that:sentry-devenvvia the official bash installeruv sync --frozen --active, which creates.venvand compiles the nativerust_snubaextension into it (no separatematurin developneeded);devservicescomes along as a dev dependencysudo dockerd) if it isn't already runningdevservices(clickhouse, redis, kafka).claude/skills/setup-test-env/SKILL.md— companion skill so the environment can be set up on demand, documenting the correct test invocation.devservices/config.yml— lower the clickhousenofileulimit from262144to soft1024/ hard4096so the container can start in environments withoutCAP_SYS_RESOURCE(the previous value cannot be applied there and made clickhouse fail to start).Notes / gotchas
tests/. Invoking it from the repo root loadstest_distributed_migrations/conftest.py, whosepytest_configureconnects to a multi-node clickhouse host (clickhouse-query) that single-node devservices doesn't provide, causing anINTERNALERRORbefore any test runs. Documented in the skill:devenvrefuses to run as root anddevenv syncis Homebrew-based, so in the cloud container the functional path isuv sync+devservices, notdevenv sync. The globaldevenvinstall is included only for parity with local laptop setups.Validation
ruff checkpasses2 passed) using the documented invocation🤖 Generated with Claude Code
https://claude.ai/code/session_01CutWwsFwLDtczduJzjvF8Y
Generated by Claude Code