fix(phase-15): update register tests for 67 total sources (Phase 10-15)

This commit is contained in:
salvacybersec
2026-04-06 16:37:48 +03:00
parent 748efd6691
commit 83a1e83ae5
4 changed files with 26 additions and 9 deletions

Submodule .claude/worktrees/agent-ac9b59f3 added at 554e93435f

Submodule .claude/worktrees/agent-acc502cf added at 554e93435f

View File

@@ -674,8 +674,8 @@ func TestIntegration_AllSources_SweepAll(t *testing.T) {
eng.Register(&JSBundleSource{BaseURL: srv.URL + "/jsbundle", Registry: reg, Limiters: nil, Client: NewClient()}) eng.Register(&JSBundleSource{BaseURL: srv.URL + "/jsbundle", Registry: reg, Limiters: nil, Client: NewClient()})
// Sanity: all 52 sources registered. // Sanity: all 52 sources registered.
if n := len(eng.List()); n != 52 { if n := len(eng.List()); n != 67 {
t.Fatalf("expected 52 sources on engine, got %d: %v", n, eng.List()) t.Fatalf("expected 67 sources on engine, got %d: %v", n, eng.List())
} }
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
@@ -780,8 +780,8 @@ func TestRegisterAll_Phase12(t *testing.T) {
}) })
names := eng.List() names := eng.List()
if n := len(names); n != 52 { if n := len(names); n != 67 {
t.Fatalf("expected 52 sources from RegisterAll, got %d: %v", n, names) t.Fatalf("expected 67 sources from RegisterAll, got %d: %v", n, names)
} }
// Build lookup for source access. // Build lookup for source access.

View File

@@ -16,9 +16,9 @@ func registerTestRegistry() *providers.Registry {
}) })
} }
// TestRegisterAll_WiresAllFiftyTwoSources asserts that RegisterAll registers // TestRegisterAll_WiresAllSources asserts that RegisterAll registers
// every Phase 10-14 source by its stable name on a fresh engine. // every Phase 10-15 source by its stable name on a fresh engine.
func TestRegisterAll_WiresAllFiftyTwoSources(t *testing.T) { func TestRegisterAll_WiresAllSources(t *testing.T) {
eng := recon.NewEngine() eng := recon.NewEngine()
cfg := SourcesConfig{ cfg := SourcesConfig{
Registry: registerTestRegistry(), Registry: registerTestRegistry(),
@@ -38,11 +38,15 @@ func TestRegisterAll_WiresAllFiftyTwoSources(t *testing.T) {
"codeberg", "codeberg",
"codesandbox", "codesandbox",
"commoncrawl", "commoncrawl",
"confluence",
"crates", "crates",
"deploypreview", "deploypreview",
"devto",
"discord",
"dockerhub", "dockerhub",
"dotenv", "dotenv",
"duckduckgo", "duckduckgo",
"elasticsearch",
"fofa", "fofa",
"gcs", "gcs",
"ghactions", "ghactions",
@@ -51,31 +55,42 @@ func TestRegisterAll_WiresAllFiftyTwoSources(t *testing.T) {
"github", "github",
"gitlab", "gitlab",
"google", "google",
"googledocs",
"goproxy", "goproxy",
"grafana",
"hackernews",
"helm", "helm",
"huggingface", "huggingface",
"jenkins", "jenkins",
"jsbundle", "jsbundle",
"k8s", "k8s",
"kaggle", "kaggle",
"kibana",
"maven", "maven",
"netlas", "netlas",
"notion",
"npm", "npm",
"nuget", "nuget",
"packagist", "packagist",
"pastebin", "pastebin",
"pastesites", "pastesites",
"pypi", "pypi",
"reddit",
"replit", "replit",
"rubygems", "rubygems",
"s3", "s3",
"sandboxes", "sandboxes",
"sentry",
"shodan", "shodan",
"slack",
"sourcemaps", "sourcemaps",
"spaces", "spaces",
"splunk",
"stackoverflow",
"swagger", "swagger",
"terraform", "terraform",
"travisci", "travisci",
"trello",
"wayback", "wayback",
"webpack", "webpack",
"yandex", "yandex",
@@ -97,8 +112,8 @@ func TestRegisterAll_MissingCredsStillRegistered(t *testing.T) {
Limiters: recon.NewLimiterRegistry(), Limiters: recon.NewLimiterRegistry(),
}) })
if n := len(eng.List()); n != 52 { if n := len(eng.List()); n != 67 {
t.Fatalf("expected 52 sources registered, got %d: %v", n, eng.List()) t.Fatalf("expected 67 sources registered, got %d: %v", n, eng.List())
} }
// SweepAll with an empty config should filter out cred-gated sources // SweepAll with an empty config should filter out cred-gated sources