1 Commits
Author SHA1 Message Date
sneak cde2f14535 Core Rule Set tests: load each set of settings once (closes #252)
check / check (push) Successful in 3m41s
Tests now share one Core Rule Set for each set of settings, loaded once
through sync.OnceValues in shared(). Exclusions-file tests and
TestCorazaWritesNoFile still load their own: loading is what they check.

Loading was not most of the time: the WordPress and Drupal recorded
requests, inspected one after another, were. Each recorded request now
runs as its own parallel subtest, with the same request and outcome.

Model: opus-5-5
2026-11-09 21:27:35 +00:00
+2 -1
View File
@@ -36,7 +36,8 @@ var loaded = struct {
}{loaders: map[string]func() (*coreruleset.CoreRuleSet, error){}}
// shared returns the Core Rule Set with params, loaded once for every
// test that asks for the same settings.
// test that asks for the same settings. Loading takes most of the time
// the tests take.
func shared(t *testing.T, params coreruleset.Params) *coreruleset.CoreRuleSet {
t.Helper()