mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
feat: improve session management and PM2 support in startup scripts (#22420)
New feature to manage service restart policies and refactors crash logging paths for better flexibility and clarity. The most significant changes include adding support for configurable restart policies (`on-failure` and `always`), updating documentation to reflect these changes, and improving crash path handling in multiple scripts.
This commit is contained in:
@@ -118,6 +118,31 @@ teardown() {
|
||||
[[ "$output" =~ "Missing required arguments" ]] || [[ "$output" =~ "Error:" ]]
|
||||
}
|
||||
|
||||
@test "service-manager: should validate restart policy values" {
|
||||
run "$SCRIPT_DIR/service-manager.sh" create auth test-auth --bin-path /nonexistent --restart-policy invalid
|
||||
[ "$status" -ne 0 ]
|
||||
[[ "$output" =~ "Invalid restart policy" ]]
|
||||
}
|
||||
|
||||
@test "service-manager: should accept valid restart policy values" {
|
||||
# Test on-failure (should be accepted)
|
||||
run "$SCRIPT_DIR/service-manager.sh" create auth test-auth --bin-path /nonexistent --restart-policy on-failure
|
||||
# Should fail due to missing binary, not restart policy validation
|
||||
[[ ! "$output" =~ "Invalid restart policy" ]]
|
||||
|
||||
# Test always (should be accepted)
|
||||
run "$SCRIPT_DIR/service-manager.sh" create auth test-auth2 --bin-path /nonexistent --restart-policy always
|
||||
# Should fail due to missing binary, not restart policy validation
|
||||
[[ ! "$output" =~ "Invalid restart policy" ]]
|
||||
}
|
||||
|
||||
@test "service-manager: should include restart policy in help output" {
|
||||
run "$SCRIPT_DIR/service-manager.sh" help
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" =~ "--restart-policy" ]]
|
||||
[[ "$output" =~ "on-failure|always" ]]
|
||||
}
|
||||
|
||||
# ===== EXAMPLE SCRIPTS TESTS =====
|
||||
|
||||
@test "examples: restarter-world should show configuration error" {
|
||||
|
||||
Reference in New Issue
Block a user