mirror of
https://codeberg.org/secana/Forji.git
synced 2026-06-16 05:13:55 -07:00
The integration seeder gave no visible progress and could hang indefinitely. A `docker compose exec` for the admin-user step wedged on a transient Docker-on-macOS flake, and `DockerExec.run` waited on it with no timeout, blocking the whole UI test suite forever with no output (stdout was block-buffered, so the existing phase prints never flushed). - Line-buffer the seeder's stdout so phase progress streams live instead of being dumped all at once when stdout is a pipe. - Add numbered "[n/7] <phase> (Ns elapsed)" headers for a clear progress and timing signal. - Add a 60s timeout to `docker compose exec` and retry the admin-user step, so a hung exec fails fast and recovers instead of wedging the suite. Reviewed-on: https://codeberg.org/secana/Forji/pulls/69
34 lines
964 B
Swift
34 lines
964 B
Swift
import Foundation
|
|
|
|
@main
|
|
struct ForgejeSeed {
|
|
static func main() async throws {
|
|
// Line-buffer stdout so seed progress streams live instead of being held in a
|
|
// block buffer (and dumped all at once) when stdout is a pipe rather than a TTY.
|
|
setvbuf(stdout, nil, _IOLBF, 0)
|
|
|
|
let args = CommandLine.arguments
|
|
guard args.count >= 3 else {
|
|
throw SeedError.missingArguments
|
|
}
|
|
|
|
let baseURL = args[1]
|
|
let serviceName = args[2]
|
|
|
|
// Compose file path: passed as 3rd arg, or derived from cwd
|
|
let composeFile: String = if args.count >= 4 {
|
|
args[3]
|
|
} else {
|
|
FileManager.default.currentDirectoryPath
|
|
+ "/integration/docker-compose.yml"
|
|
}
|
|
|
|
let seeder = Seeder(
|
|
baseURL: baseURL,
|
|
serviceName: serviceName,
|
|
composeFile: composeFile,
|
|
)
|
|
|
|
try await seeder.seed()
|
|
}
|
|
}
|