Skip to content

Commit 72a97a7

Browse files
brawerclaude
andcommitted
chore: rename scripts/test-branch-on-hetzner to test-on-hetzner
It's not just for testing a branch anymore -- deploy --image/--branch, start --containerized, validate, and the bucket lifecycle all work identically whether the container was built from a dev branch or pulled as an already-built release image (verified end-to-end: the #749 investigation ran the fix straight from main, and the very next smoke test used a real v0.8.0 release image, through the exact same containerized path). 'test-branch-on-hetzner' undersold that for a while. Pure rename plus reference updates (README.md/cloud_test.py's own opening lines included, since those undersold it too) -- no logic changes. git mv preserved history; CI workflow triggers didn't need touching (scripts/**, **/*.sh globs, not hardcoded to the old path). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent f8522b3 commit 72a97a7

26 files changed

Lines changed: 24 additions & 20 deletions

.github/workflows/shellcheck.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
name: ShellCheck
55

6-
# Lints every shell script in the repo (scripts/, including
7-
# scripts/test-branch-on-hetzner/remote/) with shellcheck -- a hard gate,
6+
# Lints every shell script in the repo with shellcheck -- a hard gate,
87
# same style as cargo-deny.yml: the job fails outright on any finding,
98
# not just an informational annotation.
109

.github/workflows/test-scripts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Test scripts
55

66
# Runs pytest over scripts/ -- currently just
7-
# scripts/test-branch-on-hetzner/tests/, see #737. Path-filtered and not
7+
# scripts/test-on-hetzner/tests/, see #737. Path-filtered and not
88
# added to the branch protection required-checks list, same reasoning as
99
# shellcheck.yml: a plain context-name-matched required check expects a
1010
# status on every PR, which a path-filtered workflow can't guarantee for

docs/TESTING.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ two copies going stale independently.
1313
- **Integration tests**: [`tests/`](../tests) — a full pipeline run
1414
against a real OSM extract (a Swiss shopping mall) plus minimal
1515
AllThePlaces data. Fast enough to run on every `cargo test`.
16-
- **Script tests**: [`scripts/test-branch-on-hetzner/tests/`](../scripts/test-branch-on-hetzner/tests)
17-
run `uv run pytest` from `scripts/`.
16+
- **Script tests**: [`scripts/test-on-hetzner/tests/`](../scripts/test-on-hetzner/tests)
17+
run `uv run pytest` from `scripts/`. Writing tests for a script whose
18+
own job is testing things sounds like a step too far at first, but
19+
it’s paid for itself every time that script itself needed a change:
20+
the alternative feedback loop is a real Hetzner VM, minutes per
21+
iteration and real money, versus a sub-second local test run.
1822

1923
## CI
2024

@@ -29,7 +33,7 @@ pushes touching `scripts/**/*.sh` run
2933
`scripts/**` run
3034
[`test-scripts.yml`](../.github/workflows/test-scripts.yml) (`pytest`
3135
for the scripts that have real test coverage — currently just
32-
`scripts/test-branch-on-hetzner/`). PRs and pushes that touch
36+
`scripts/test-on-hetzner/`). PRs and pushes that touch
3337
`Cargo.toml`, `Cargo.lock`, or `deny.toml` run
3438
[`cargo-deny.yml`](../.github/workflows/cargo-deny.yml) — dependency
3539
licenses, banned/duplicated crates, sources, and known RUSTSEC/OSV
@@ -75,7 +79,7 @@ real hardware before a change lands, not automated gates:
7579

7680
- [`scripts/test-branch-on-macos/`](../scripts/test-branch-on-macos)
7781
full pipeline on your dev machine. Free, fast to iterate with.
78-
- [`scripts/test-branch-on-hetzner/`](../scripts/test-branch-on-hetzner)
82+
- [`scripts/test-on-hetzner/`](../scripts/test-on-hetzner)
7983
— full pipeline on real cloud hardware, either built from your
8084
feature branch or pulled as an already-built image (e.g. a released
8185
container), optionally run containerized under a real cgroup

scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ process these fit into.
4242
Unrelated to how `osm-diffs` actually ships to production — this is for
4343
ad hoc validation of a branch before it lands.
4444

45-
- [`test-branch-on-hetzner/`](test-branch-on-hetzner/README.md): spins
45+
- [`test-on-hetzner/`](test-on-hetzner/README.md): spins
4646
up a Hetzner Cloud VM, builds a given git branch on it, runs the
4747
pipeline against it, and pulls back logs — one command instead of
4848
repeating the manual setup by hand each time. See

scripts/test-branch-on-macos/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Build the current checkout, run the pipeline against a workdir, and
44
monitor `vm_stat`/RSS alongside it -- so testing a change doesn't mean
55
re-typing the same monitoring loop by hand each time.
66

7-
Much smaller than [`../test-branch-on-hetzner/`](../test-branch-on-hetzner)
7+
Much smaller than [`../test-on-hetzner/`](../test-on-hetzner)
88
on purpose: no VM lifecycle to manage, no branch to clone -- everything
99
runs on the machine you're already on, against whatever's currently
1010
checked out. It also doesn't build via the project's `Containerfile`
1111
the way that tool does: plain `cargo build --release` here, not
1212
matching production's exact toolchain, because the point is fast
1313
turnaround on a local edit-run loop, not comparable-to-production
14-
numbers. Use `test-branch-on-hetzner` when the toolchain match or real
14+
numbers. Use `test-on-hetzner` when the toolchain match or real
1515
hardware actually matters.
1616

1717
## Usage
@@ -50,6 +50,6 @@ during the run -- every subsequent `ps -p` call just failed with
5050
useless log. `monitor.sh` re-resolves it via `pgrep` on every 5-second
5151
tick instead.
5252

53-
`scripts/test-branch-on-hetzner/analyze.py` can be pointed at
53+
`scripts/test-on-hetzner/analyze.py` can be pointed at
5454
`pipeline.log` from a local run here too -- the log format is identical
5555
either way.

scripts/test-branch-on-macos/test_macos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
against a workdir, and monitor vm_stat/RSS alongside it -- so testing a
44
change doesn't mean re-typing the same vm_stat loop by hand each time.
55
6-
See scripts/test-branch-on-hetzner/ for the equivalent against real
6+
See scripts/test-on-hetzner/ for the equivalent against real
77
cloud hardware; this is deliberately much smaller -- no VM lifecycle to
88
manage, no branch to clone, since the whole point is fast iteration on
99
whatever's currently checked out on this machine. It also doesn't build
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Testing a branch on cloud machines
1+
# Testing on cloud machines
22

33
Two small tools: `cloud_test.py` runs the full `osm-diffs` pipeline on
44
real Hetzner Cloud hardware, without repeating the manual VM setup by

scripts/test-branch-on-hetzner/cloud_test.py renamed to scripts/test-on-hetzner/cloud_test.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/usr/bin/env python3
2-
"""Spins up a Hetzner Cloud VM, builds osm-diffs from a given git branch,
3-
and runs the full pipeline against it -- so testing a development branch
4-
on real cloud hardware doesn't mean re-deriving the VM setup dance by
5-
hand each time. See README.md in this directory for the full story,
6-
including prerequisites and a worked example.
2+
"""Spins up a Hetzner Cloud VM and runs the full osm-diffs pipeline on it
3+
-- either built from a given git branch or pulled as an already-built
4+
image (e.g. a released `ghcr.io` container) -- so testing on real cloud
5+
hardware doesn't mean re-deriving the VM setup dance by hand each time.
6+
See README.md in this directory for the full story, including
7+
prerequisites and a worked example.
78
89
Every `hcloud`/`ssh`/`scp` command this runs is echoed to stderr first,
910
so a flag mismatch against your installed `hcloud` version should be

0 commit comments

Comments
 (0)