Files
archived-frankenphp/caddy/watcher_test.go
Alliballibaba2 072151dfee feat: Adds automatic thread scaling at runtime and php_ini configuration in Caddyfile (#1266)
Adds option to scale threads at runtime

Adds php_ini configuration in Caddyfile
2025-02-19 20:39:33 +01:00

39 lines
715 B
Go

//go:build !nowatcher
package caddy_test
import (
"net/http"
"testing"
"github.com/caddyserver/caddy/v2/caddytest"
)
func TestWorkerWithInactiveWatcher(t *testing.T) {
tester := caddytest.NewTester(t)
tester.InitServer(`
{
skip_install_trust
admin localhost:2999
http_port `+testPort+`
frankenphp {
worker {
file ../testdata/worker-with-counter.php
num 1
watch ./**/*.php
}
}
}
localhost:`+testPort+` {
root ../testdata
rewrite worker-with-counter.php
php
}
`, "caddyfile")
tester.AssertGetResponse("http://localhost:"+testPort, http.StatusOK, "requests:1")
tester.AssertGetResponse("http://localhost:"+testPort, http.StatusOK, "requests:2")
}