Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fd6d229
docs(test): design daemon fixture extraction
munezaclovis Jul 15, 2026
035d1a4
docs(test): plan daemon fixture extraction
munezaclovis Jul 15, 2026
f7890a6
docs(test): make fixture verification range robust
munezaclovis Jul 15, 2026
7eacaa3
test(daemon): cover managed fixture CLI contracts
munezaclovis Jul 15, 2026
957ca33
refactor(daemon): extract SQL and Mailpit test fixtures
munezaclovis Jul 15, 2026
985cf63
refactor(daemon): extract Redis and RustFS test fixtures
munezaclovis Jul 15, 2026
12538ca
refactor(gateway): extract FrankenPHP test fixtures
munezaclovis Jul 15, 2026
b469a3d
refactor(supervisor): extract Python ownership fixture
munezaclovis Jul 15, 2026
8be302f
fix(daemon): preserve fixture CLI contracts
munezaclovis Jul 15, 2026
249488c
docs(test): align fixture plan with final contracts
munezaclovis Jul 15, 2026
5fde492
docs(test): approve fixture review corrections
munezaclovis Jul 16, 2026
4900f34
docs(test): plan fixture review corrections
munezaclovis Jul 16, 2026
b07cb79
fix(daemon): bound fixture contract subprocesses
munezaclovis Jul 16, 2026
07e07ce
docs(test): correct timeout RED cleanup
munezaclovis Jul 16, 2026
89affe2
fix(daemon): daemonize fixture request handlers
munezaclovis Jul 16, 2026
7efda23
fix(daemon): bound fixture child cleanup
munezaclovis Jul 16, 2026
fafd3c4
test(daemon): synchronize fixture handler shutdown
munezaclovis Jul 16, 2026
2fb213f
docs(test): align fixture lifecycle verification
munezaclovis Jul 16, 2026
c36e976
docs(test): plan final fixture review fixes
munezaclovis Jul 16, 2026
98ef5fe
test(daemon): allow fixture timeout scheduling margin
munezaclovis Jul 16, 2026
4af83bc
test(daemon): require complete fixture handler markers
munezaclovis Jul 16, 2026
15e13b8
docs(test): target fixture snapshot acceptance
munezaclovis Jul 16, 2026
7186152
fix(daemon): capture fixture output without pipe backpressure
munezaclovis Jul 16, 2026
5ec23ac
docs(test): plan fixture signal preservation
munezaclovis Jul 16, 2026
5ce9e12
fix(daemon): make postgres fixture shutdown deterministic
munezaclovis Jul 16, 2026
5945a08
fix(daemon): preserve single-server fixture signal status
munezaclovis Jul 17, 2026
3023efc
fix(daemon): avoid stale fixture process-group cleanup
munezaclovis Jul 17, 2026
5da0ebc
fix(daemon): preserve multi-server fixture signal status
munezaclovis Jul 17, 2026
1c79637
test(daemon): clean up RustFS allocation failure runtime
munezaclovis Jul 17, 2026
f932b9f
refactor(gateway): close fixture config file explicitly
munezaclovis Jul 17, 2026
386b7f9
test(daemon): avoid timeout fixture startup race
munezaclovis Jul 17, 2026
3058dc1
test(daemon): require injected postgres signal status
munezaclovis Jul 17, 2026
244b06f
docs(test): harden daemon fixture final verification
munezaclovis Jul 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
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Avoid `panic!`, `unreachable!`, `.unwrap()`, and `.expect()` in production code.

For running tests, we recommend [nextest](https://nexte.st/).

Daemon tests that exercise Managed Resource, gateway, and supervisor fixtures require `python3` on `PATH`. These fixtures use only Python's standard library; no Python packages or virtual environment is required.

To run a specific test by name:

```shell
Expand Down
78 changes: 6 additions & 72 deletions crates/daemon/src/managed_resources/mysql_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ const MYSQL_TRACK: &str = "8.0";
const MYSQL_ARTIFACT_VERSION: &str = "8.0.35-pv1";
const MYSQL_ARCHIVE_FILE_NAME: &str = "mysql-8.0.35-pv1-any.tar.gz";
const OFFLINE_TEST_MANIFEST_URL: &str = "https://127.0.0.1:9/manifest.json";
const MYSQL_FIXTURE_SCRIPT: &str = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/test-fixtures/managed-resources/mysql.py"
));

#[test]
fn mysql_runtime_port_prefers_3306() -> Result<()> {
Expand Down Expand Up @@ -307,7 +311,7 @@ fn seed_mysql_fixture_artifact(paths: &PvPaths, track: &str) -> Result<()> {
.join(format!("releases/{MYSQL_ARTIFACT_VERSION}"));
let executable = release_path.join("bin/mysqld");

state::fs::write_sensitive_file(&executable, mysql_fixture_script())?;
state::fs::write_sensitive_file(&executable, MYSQL_FIXTURE_SCRIPT)?;
set_executable(&executable)?;
let mut database = Database::open(paths)?;
database.record_managed_resource_track_installed(
Expand Down Expand Up @@ -344,7 +348,7 @@ fn create_mysql_archive(tempdir: &Utf8Path, archive_path: &Utf8Path) -> Result<(
let root = archive_parent.join(&root_name);
let executable = root.join("bin/mysqld");

state::fs::write_sensitive_file(&executable, mysql_fixture_script())?;
state::fs::write_sensitive_file(&executable, MYSQL_FIXTURE_SCRIPT)?;
set_executable(&executable)?;
run_fixture_command(
"/usr/bin/tar",
Expand Down Expand Up @@ -437,76 +441,6 @@ fn mysql_manifest(sha256: &str, size: u64) -> String {
)
}

fn mysql_fixture_script() -> &'static str {
r#"#!/bin/sh
set -eu

datadir=""
port=""
first_arg="${1:-}"

while [ "$#" -gt 0 ]; do
case "$1" in
--initialize-insecure)
initialize=1
shift
;;
--datadir)
datadir="$2"
shift 2
;;
--basedir)
shift 2
;;
--port)
port="$2"
shift 2
;;
--bind-address|--socket)
shift 2
;;
--no-defaults)
shift
;;
*)
shift
;;
esac
done

if [ "${initialize:-0}" = "1" ]; then
if [ "${first_arg:-}" != "--no-defaults" ]; then
echo "mysqld initialization must start with --no-defaults" >&2
exit 64
fi
mkdir -p "$datadir/mysql"
exit 0
fi

python3 - "$port" <<'PY'
import signal
import socketserver
import sys

class Handler(socketserver.BaseRequestHandler):
def handle(self):
self.request.recv(1024)

class TcpServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
allow_reuse_address = True

def stop(_signum, _frame):
sys.exit(0)

signal.signal(signal.SIGTERM, stop)
signal.signal(signal.SIGINT, stop)

server = TcpServer(("127.0.0.1", int(sys.argv[1])), Handler)
server.serve_forever()
PY
"#
}

fn assert_mysql_snapshot(
tempdir: &Utf8Path,
name: &'static str,
Expand Down
Loading
Loading