beads/internal/storage/dbproxy/proxy/BUILD.bazel
Julian Knutsen d90823480a
ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414)
* ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files

//scripts:scripts_test declared //:repo_files (the whole checkout), so every
PR re-ran it, and it took ~181s on rbe-west. Most of that (60-79s) was
TestBazelGatedLanesNeverRetryFlakyTests line-regexping the --run_under
wrapper's pinned dolt binary (tools/bazel/hermetic_bin/dolt, in every
test's runfiles); it now skips binary files, as git grep -I does.

tools/bazel/go_srcs.py's per-package repo_files block now partitions each
package's files into repo_go_srcs, repo_go_test_srcs, repo_doc_files and
repo_other_files, aggregated at the root; //:repo_files is their union
(same 4679 files). The //scripts tests are split into go_test targets by
what they read (traced per test with strace over a runfiles-shaped tree):

  scripts_test          CI/Bazel policy: //:repo_other_files (+1 Go file)
  shell_scripts_test    script fixtures: //scripts files, a few root files
  go_test_sources_test  _test.go scans: //:repo_go_test_srcs + shard files
  go_sources_test       check-testing-short.sh: every .go file
  tracked_files_test    every tracked file: //:repo_files

Shared helpers move to helpers-only files; TestScriptsTestTargetsPartition-
TheTests fails on a test file in no target or in two. //test/docsync and
the //scripts/repochecks slices declare partitions or single files instead
of //:repo_files where they can.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* ci(bazel): skip only the non-checkout hermetic_bin dir in the flaky-retry walk

Skipping every binary file also stopped scanning tracked binaries (images,
.binpb fixtures). Skip just tools/bazel/hermetic_bin, the --run_under
wrapper's runfiles directory, which is not in the checkout, so the walk's
coverage of tracked files is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-09 05:13:07 +00:00

171 lines
4.4 KiB
Python

load("@rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "proxy",
srcs = [
"backend.go",
"control.go",
"endpoint.go",
"endpoint_unix.go",
"endpoint_windows.go",
"force_stop.go",
"process_executable_darwin.go",
"process_executable_linux.go",
"process_executable_windows.go",
"proxy.go",
"read_status.go",
"server.go",
"shutdown.go",
"stats.go",
"unverified_process_darwin.go",
"unverified_process_linux.go",
"unverified_process_unsupported.go",
"unverified_process_windows.go",
"upstream_error.go",
],
importpath = "github.com/steveyegge/beads/internal/storage/dbproxy/proxy",
visibility = ["//:__subpackages__"],
deps = [
"//internal/atomicfile",
"//internal/configfile",
"//internal/debug",
"//internal/fdhygiene",
"//internal/lockfile",
"//internal/procid",
"//internal/storage/dbproxy/identity",
"//internal/storage/dbproxy/pidfile",
"//internal/storage/dbproxy/server",
"//internal/storage/dbproxy/util",
"@com_github_cenkalti_backoff_v4//:backoff",
"@com_github_go_sql_driver_mysql//:mysql",
"@org_golang_x_sync//errgroup",
] + select({
"@rules_go//go/platform:android": [
"@org_golang_x_sys//unix",
],
"@rules_go//go/platform:darwin": [
"@org_golang_x_sys//unix",
],
"@rules_go//go/platform:ios": [
"@org_golang_x_sys//unix",
],
"@rules_go//go/platform:linux": [
"@org_golang_x_sys//unix",
],
"@rules_go//go/platform:windows": [
"@org_golang_x_sys//windows",
],
"//conditions:default": [],
}),
)
go_test(
name = "proxy_test",
srcs = [
"backend_dial_timeout_test.go",
"control_test.go",
"endpoint_mismatch_test.go",
"endpoint_no_data_probe_test.go",
"endpoint_security_test.go",
"endpoint_spawn_stop_unix_test.go",
"external_transport_lifecycle_internal_test.go",
"force_stop_linux_test.go",
"server_epoch_internal_test.go",
"server_test.go",
"upstream_error_test.go",
],
embed = [":proxy"],
deps = [
"//internal/configfile",
"//internal/procid",
"//internal/storage/dbproxy/identity",
"//internal/storage/dbproxy/pidfile",
"//internal/storage/dbproxy/server",
"//internal/storage/dbproxy/util",
"@com_github_go_sql_driver_mysql//:mysql",
"@com_github_stretchr_testify//assert",
"@com_github_stretchr_testify//require",
] + select({
"@rules_go//go/platform:android": [
"//internal/testutil/bazeltest",
],
"@rules_go//go/platform:linux": [
"//internal/testutil/bazeltest",
],
"//conditions:default": [],
}),
)
# --- begin go_srcs (managed by tools/bazel/go_srcs.py; run `make bazel-sync`) ---
filegroup(
name = "go_srcs",
srcs = glob(
["**/*.go"],
allow_empty = True,
),
visibility = ["//:__subpackages__"],
)
# --- end go_srcs ---
# --- begin repo_files (managed by tools/bazel/go_srcs.py; run `make bazel-sync`) ---
filegroup(
name = "repo_doc_files",
srcs = glob(
[
"**/*.md",
"**/*.mdx",
],
allow_empty = True,
exclude = ["**/node_modules/**"],
),
visibility = ["//:__subpackages__"],
)
filegroup(
name = "repo_go_srcs",
srcs = glob(
["**/*.go"],
allow_empty = True,
exclude = [
"**/*_test.go",
"**/node_modules/**",
],
),
visibility = ["//:__subpackages__"],
)
filegroup(
name = "repo_go_test_srcs",
srcs = glob(
["**/*_test.go"],
allow_empty = True,
exclude = ["**/node_modules/**"],
),
visibility = ["//:__subpackages__"],
)
filegroup(
name = "repo_other_files",
srcs = glob(
["**"],
exclude = [
"**/*.db",
"**/*.exe",
"**/*.go",
"**/*.md",
"**/*.mdx",
"**/*.out",
"**/*.prof",
"**/*.pyc",
"**/*.test",
"**/__pycache__/**",
"**/node_modules/**",
],
),
visibility = ["//:__subpackages__"],
)
# --- end repo_files ---