Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

test: nothing enforces the docs half of the scrape schema-bump checklist (PIN-109)

Luigi Agostic1ba02c6a339
diff --git a/internal/scrape/types_test.go b/internal/scrape/types_test.go
index 1d2bba5e..2c50fed7 100644
--- a/internal/scrape/types_test.go
+++ b/internal/scrape/types_test.go
@@ -1,6 +1,10 @@
package scrape
-import "testing"
+import (
+ "os"
+ "strings"
+ "testing"
+)
// The literal here is deliberately a second copy of SchemaVersion, and it is the
// point of the test. Every other assertion compares the report's field to the
@@ -22,3 +26,31 @@ func TestSchemaVersionIsPinnedSoABumpMustBeAcknowledged(t *testing.T) {
SchemaVersion, pinned)
}
}
+
+// Item 2 of the checklist above is the only one nothing enforces: the pin itself
+// carries item 1 and the Docker e2e carries item 3, so a bump documented nowhere
+// passes every suite. This ties the docs to the constant rather than to the pinned
+// literal, so it fires exactly when the history was not written.
+func TestSchemaHistoryDocumentsTheCurrentVersion(t *testing.T) {
+ const heading = "### Schema history"
+
+ raw, err := os.ReadFile("../../docs/scrape.md")
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ section := string(raw)
+ start := strings.Index(section, heading)
+ if start < 0 {
+ t.Fatalf("docs/scrape.md has no %q section, so a schema bump has nowhere a report consumer would look", heading)
+ }
+ section = section[start+len(heading):]
+ if end := strings.Index(section, "\n## "); end >= 0 {
+ section = section[:end]
+ }
+
+ if !strings.Contains(section, SchemaVersion) {
+ t.Errorf("the %q section of docs/scrape.md never mentions the current version %q — a consumer holding an older report has the version to compare against and nowhere to learn what changed",
+ heading, SchemaVersion)
+ }
+}