Skip to content

test: add maintenance mode test suite#122

Open
goravel-coder wants to merge 1 commit into
masterfrom
test/maintenance-mode
Open

test: add maintenance mode test suite#122
goravel-coder wants to merge 1 commit into
masterfrom
test/maintenance-mode

Conversation

@goravel-coder

Copy link
Copy Markdown

Summary

  • Adds maintenance mode configuration (APP_MAINTENANCE_DRIVER, APP_MAINTENANCE_STORE) to config/app.go and env files
  • Adds comprehensive test suite covering artisan down/up commands, HTTP middleware responses, file persistence, cache driver, and secret bypass

Closes goravel/docs#192

Why

This adds the maintenance mode configuration block and a full test suite to the example app, demonstrating the down/up artisan commands and the CheckForMaintenanceMode middleware that ships with goravel/gin and goravel/fiber. The test suite covers all major behaviors documented in the v1.18 configuration docs: reason text, custom status codes, redirect, view rendering, secret bypass, generated secrets, file persistence, and cache driver support.

// config/app.go
"maintenance": map[string]any{
    "driver": config.Env("APP_MAINTENANCE_DRIVER", "file"),
    "store":  config.Env("APP_MAINTENANCE_STORE", ""),
},
# Put app into maintenance mode
./artisan down --reason="Upgrading database" --status=503

# Allow bypass with a secret
./artisan down --secret=let-me-in

# Bring app back online
./artisan up

Add maintenance configuration, env vars, and comprehensive tests for
the Maintenance Mode feature including artisan down/up commands,
middleware behavior, file persistence, cache driver, and secret bypass.
@goravel-coder goravel-coder requested a review from a team as a code owner June 15, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants