Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
69196d6
007 S007-10+15: Tests 1 and 2 with the shape module, and tests 5, 6 a…
brettheap Nov 15, 2026
8ff07b5
P07 follow-up 1: T273k, lane 2's change to the partitioned_estate fix…
brettheap Nov 15, 2026
8192451
T273j: Read REGISTER_SCHEMA_VERSION from T124's module beside the fli…
brettheap Nov 15, 2026
4e9821a
T273l: Drop each rollback fixture's database whatever ends its build,…
brettheap Nov 15, 2026
51aae86
T270o: End a renderer that never reached its held push with its proce…
brettheap Nov 16, 2026
c15c1f3
T273m: Drop RollbackRegister's database whatever ends any step of its…
brettheap Nov 16, 2026
4051ec7
T270m: Own every launcher and FIFO end in RenderEstate.race with a fi…
brettheap Nov 16, 2026
c2c7530
T273o: Kill the rollback that never reached its held push, let the FI…
brettheap Nov 16, 2026
fe1c8ba
T270n: Release the held burst's render only once at least four forks …
brettheap Nov 16, 2026
a8446eb
T241m: Run the pending hand edit's recovery command split by shlex wi…
brettheap Nov 16, 2026
fec6b59
T241n: Require the pending hand edit's recovery command to restore ex…
brettheap Nov 16, 2026
973a2ed
T270p: Own each held renderer to the end, unlink a let-go FIFO, close…
brettheap Nov 16, 2026
6d47941
T273p: Own the held rollback to the end in the marker-removal case, l…
brettheap Nov 16, 2026
61cbdf1
T270q: Let every hold FIFO go by unlinking it before its last write e…
brettheap Nov 17, 2026
f31f8c0
T273q: Tear down every rollback case through one helper that kills it…
brettheap Nov 17, 2026
18529e5
T241o: Require the pending hand edit's refusal to exit 2, with nothin…
brettheap Nov 17, 2026
12cd187
T241p: Forbid a printed `lanes-edit.sh commit` in the pending hand ed…
brettheap Nov 17, 2026
66ce53e
T270r: Signal clean-up processes only through pidfds pinned to their …
brettheap Nov 17, 2026
ae408cd
T273r: Signal the rollback teardown's processes only through pidfds p…
brettheap Nov 17, 2026
46cac74
T273s: Seek each process the rollback teardown owns as its pid and st…
brettheap Nov 17, 2026
ed0bef2
T270s: Own each clean-up process by a launch nonce in its environment…
brettheap Nov 17, 2026
f776b43
T273t: Own each rollback teardown process by a launch nonce in its en…
brettheap Nov 17, 2026
035c336
T270t: Keep the clean-up engine renderer_git and rollback share in on…
brettheap Nov 17, 2026
071f978
T273u: Import the shared clean-up engine from tests/sql_register_clea…
brettheap Nov 17, 2026
d34c7ea
T270u: Make the clean-up engine's group discovery, pidfd ownership an…
brettheap Nov 17, 2026
5a12064
T273v: Put the case's nonce on every rollback launch before the first…
brettheap Nov 17, 2026
b96ff01
T273w: Read the left process's stat once a pass in the construction-f…
brettheap Nov 17, 2026
7b4b45d
T270v: Make the clean-up's stop, kill, confirm and read-again one loo…
brettheap Nov 17, 2026
1b6d25e
T273x: Run rollback's teardown steps 1 and 5 on the clean-up's one lo…
brettheap Nov 17, 2026
c2371be
T273y: State the rule of RollbackEstate's environment window: while i…
brettheap Nov 17, 2026
73279c1
T270w: Split the clean-up's one loop into a class whose steps each st…
brettheap Nov 17, 2026
e5aa44e
T270x: Wait for the child's environment to carry the nonce before the…
brettheap Nov 17, 2026
464f7f3
T270y: Show the stop-forks model's late member only once its parent i…
brettheap Nov 17, 2026
bb190f7
T270z: Wait for each child's environment to carry the nonce before th…
brettheap Nov 17, 2026
84c5276
T273z: Wait for each child's environment to carry the nonce before th…
brettheap Nov 17, 2026
4789068
T270za: Check the one loop's deadline right after each read, before i…
brettheap Nov 17, 2026
3267d6d
T270zb: Keep every error the git wrapper's kill meets, and raise the …
brettheap Nov 17, 2026
be88b3c
T273za: Wait for the logged push's environment to carry the nonce, an…
brettheap Nov 17, 2026
3bb1265
T270zc: Wait for the logged renderer's environment to carry the nonce…
brettheap Nov 17, 2026
cab8fcf
T270zd: Make the one loop's deadline error true where its last pass c…
brettheap Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/fixtures/lanes-edit-v1.1.0/SHA256SUMS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b68d0cbac35ac3bbac9e70790cafe63538821be582ca28cec0f7ec0f5c4745d2 lanes-edit.sh
18,977 changes: 18,977 additions & 0 deletions tests/fixtures/lanes-edit-v1.1.0/lanes-edit.sh

Large diffs are not rendered by default.

768 changes: 768 additions & 0 deletions tests/sql_register_cleanup.py

Large diffs are not rendered by default.

Empty file added tests/sql_register_landed/T210
Empty file.
Empty file added tests/sql_register_landed/T240
Empty file.
Empty file added tests/sql_register_landed/T241
Empty file.
Empty file added tests/sql_register_landed/T270
Empty file.
Empty file added tests/sql_register_landed/T271
Empty file.
Empty file added tests/sql_register_landed/T273
Empty file.
1,619 changes: 1,619 additions & 0 deletions tests/test_sql_register_divergence.py

Large diffs are not rendered by default.

2,837 changes: 2,837 additions & 0 deletions tests/test_sql_register_render.py

Large diffs are not rendered by default.

3,854 changes: 3,854 additions & 0 deletions tests/test_sql_register_renderer_git.py

Large diffs are not rendered by default.

3,246 changes: 3,246 additions & 0 deletions tests/test_sql_register_rollback.py

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions tests/test_sql_register_shape.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# SPDX-License-Identifier: Apache-2.0
"""Feature 007's register shape (opensoft/openRepoTools#165): what each register
call looks like from outside, its argv, its credentials and its text.

THIS MODULE TODAY holds test 2's FP case, lane 2's T241 (AT-2, the test plan's
lines 646-781; FR-018, FR-059):
`test_an_unreachable_store_is_69_naming_the_store_and_never_the_files[<verb>]`.
Lane 1's T106 and T111 select their own cases here by `sql_register_shape`
and their words (B10 tasks:275 and :399); those cases are other tasks', which
add them to this module.

THE CASE runs each of S1's writes but `commit` as `lanes-edit.sh <verb>` on a
`mode=primary` workstation (`test_sql_register_writes.py`'s
`PrimaryWorkstation` and `WRITE_VERBS`), with T203's register fake first on
`PATH` answering every call that carries a request with `psql`'s exit 2 and
its "connection to server ... failed" text (AT-2, "Unreachable (FP)"). It
needs no engine, and fails until lane 4's L4-B3 (T415's attempt loop) lands,
by its own assertion: today's `lanes-edit.sh` writes the files whatever
`mode=` says.
"""

from __future__ import annotations

import re
import shutil

import pytest

from conftest import WINDOWS_SKIP
from test_sql_register_render import fake_calls, fake_psql_dir
from test_sql_register_writes import (PREPS, SECRET, WRITE_VERBS, PrimaryWorkstation,
unreachable_answers)

pytestmark = [WINDOWS_SKIP, pytest.mark.skipif(
shutil.which("bash") is None or shutil.which("git") is None,
reason="the lane tooling is bash over git")]

#: THE LANDING GATE'S TABLE (T280; `tests/sql_register_gate.py` reads it, and
#: T281 removes it in the last set): every id of this module waits for the
#: tasks T241's Order names, L4-B3's, L4-B4's and L4-B11's (tasks.md at
#: 204145ae). Lane 2's plan GP-24 wrote it (task sets 12b's rule 11).
SQL_REGISTER_GATE_TABLE = {
"*": ("T413", "T414", "T415", "T420"), # every id: the tasks all its rows share
}

#: What a writer that fell back to the files, or offered to, would say: the
#: register's file paths as a target, or the files mode by name. None may
#: appear in a refusal on primary (P213-215: "nothing ever written to the
#: files instead").
FILES_WORDS = re.compile(r"lanes/LANES\.md|lanes/log/|mode=files|files mode|files-mode"
r"|fall(ing)? ?back", re.I)


@pytest.mark.parametrize("verb", list(WRITE_VERBS))
def test_an_unreachable_store_is_69_naming_the_store_and_never_the_files(tmp_path, verb):
"""AT-2's FP oracle for the refusal's text (P213-214; contract section
2.6): `lanes-edit.sh <verb>` on primary, with the database unreachable,
exits 69; stderr names the store, `psql`'s own first line with the socket
it tried, and the error, with no password, no `PGPASSWORD` and no URL;
it never names the files as a target or a fallback; no call follows the
failed one; and the files under `lanes/` are as they were."""
ws = PrimaryWorkstation(tmp_path, prep=PREPS.get(verb))
fake = fake_psql_dir(ws.fakebin, answers=unreachable_answers(ws.dead))
ws.env.update(fake)
argv, lane = WRITE_VERBS[verb]
lanes_before = ws.git_state()[1]
proc = ws.run(argv, lane)
said = proc.stdout + proc.stderr
assert proc.returncode == 69, (
f"lanes-edit.sh {verb} on primary exited {proc.returncode}, not 69, with the store "
f"unreachable (L4-B3, T415's attempt loop): {proc.stderr[-800:]}")
assert str(ws.dead) in proc.stderr and "connection to server" in proc.stderr, (
f"stderr does not name the store and the error: {proc.stderr!r}")
assert SECRET not in said and "PGPASSWORD" not in said, "a credential reached the output"
assert not re.search(r"postgres(ql)?://", said), f"a URL reached the output: {said!r}"
assert not FILES_WORDS.search(proc.stderr), (
f"the refusal names the files: {FILES_WORDS.search(proc.stderr).group(0)!r} in "
f"{proc.stderr!r}")
assert len(fake_calls(fake)) == 1, f"calls after the failed one: {fake_calls(fake)}"
assert ws.git_state()[1] == lanes_before, "a file under lanes/ changed"
1,086 changes: 1,086 additions & 0 deletions tests/test_sql_register_writes.py

Large diffs are not rendered by default.

Loading