fix: e2e caddy test after changing the config header

This commit is contained in:
Pasha Sviderski
2025-12-22 21:22:56 +10:00
parent 2345ee9856
commit aa71ab0220
+5 -1
View File
@@ -480,7 +480,11 @@ myapp.example.com {
// Check that the Caddy config hasn't changed. // Check that the Caddy config hasn't changed.
newConfig, err := cli.Caddy.GetConfig(ctx, nil) newConfig, err := cli.Caddy.GetConfig(ctx, nil)
require.NoError(t, err) require.NoError(t, err)
assert.Equal(t, validConfig, newConfig.Caddyfile,
// Compare stable parts of the Caddyfile only (skip autogenerated comment with timestamp).
_, stableValidConfig, _ := strings.Cut(validConfig, "\n")
_, stableNewConfig, _ := strings.Cut(newConfig.Caddyfile, "\n")
assert.Equal(t, stableValidConfig, stableNewConfig,
"Caddy config should not change when an invalid user-defined Caddy config is deployed") "Caddy config should not change when an invalid user-defined Caddy config is deployed")
}) })