ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / internal/integration/connector_icims_integration_test.go

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / internal/integration/connector_icims_integration_test.go
DateNot specified in source
RepositoryJanady13/missionmatch
Revision720d47fae476b0d38477ae4401697d372b1ea2bc
Branchfeature/opportunity-to-outcome
Path or archive memberinternal/integration/connector_icims_integration_test.go
Original SHA-256a4a236480337ac8bfa93348c15a0a5fdabe97e5938673a883abc9a72b8288d16
Git blob SHA058bda622a2e70b3f993ceab9cf2b16a993bf388
Reading-copy SHA-256a4a236480337ac8bfa93348c15a0a5fdabe97e5938673a883abc9a72b8288d16

Original source ↗

Every recorded occurrence

These 9 records contain identical original source bytes. Their paths and revisions remain part of the archive.

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/missionmatch / internal/integration/connector_icims_integration_test.gofeature/opportunity-to-outcome720d47fae476b0d38477ae4401697d372b1ea2bcOpen original
Janady13/missionmatch / internal/integration/connector_icims_integration_test.gocollision-deconfliction4ee5a09972608ed89f8377c6665542d5f450f0a6Open original
Janady13/missionmatch / internal/integration/connector_icims_integration_test.gomaster1e9249840a4302ec82e123b9c9cb6f75badea3e4Open original
Janady13/missionmatch / internal/integration/connector_icims_integration_test.gotime-to-fill-survivalb66e1e505863d4f17741a4b9ede73509e45bd6c6Open original
Janady13/missionmatch / internal/integration/connector_icims_integration_test.gopresentation-readinesseb574acaa29d71ce4d0f852572e87c275c79fdb7Open original
Janady13/missionmatch / internal/integration/connector_icims_integration_test.govendor-intelligencefe9796a19c261951d3f2565206c0c1b5ac294465Open original
Janady13/missionmatch / internal/integration/connector_icims_integration_test.gophase2-connectorse038d4c687aec16f8bd9bc4d907eea14d91f8704Open original
Janady13/missionmatch / internal/integration/connector_icims_integration_test.gofeature/aioe-upgrade2178e7298d0e5d9af83afa12402fd587f0ba6ed8Open original
Janady13/missionmatch / internal/integration/connector_icims_integration_test.gocapture-readinessbae6af7cb2997e819174a9e9cfff5e16067a1975Open original

Recovered source transcript

//go:build integration // Enterprise connector (iCIMS) integration. Proves at runtime against a REAL Postgres and a fake iCIMS server // what the unit tests cannot: connector.Sync ingests a page of candidates as STRUCTURED scoring inputs (skills // as rows) plus a sourcing_log provenance row each, advances the connector_sync_state watermark, and is // idempotent (a re run dedupes rather than duplicating), all through the proven sourcing path with clearance // left unknown. Migration 0038 (connector_sync_state) must be applied. // // Run: go test -tags=integration ./internal/integration/ -run ConnectorICIMS -v // Env: MM_MIGRATOR_DSN. package integration import ( "context" "net/http" "net/http/httptest" "testing" "github.com/google/uuid" "github.com/missionworkforce/missionmatch/internal/platform/connector" "github.com/missionworkforce/missionmatch/internal/platform/extraction" ) // fakeICIMSServer serves a bearer token and one page of two candidates (ignoring updatedSince, so a re run sees // the same records and must dedupe). func fakeICIMSServer() *httptest.Server { mux := http.NewServeMux() mux.HandleFunc("/oauth/token", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") _, _ = w.Write([]byte(`{"access_token":"tok","expires_in":3600}`)) }) mux.HandleFunc("/customers/CUST1/search/people", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") _, _ = w.Write([]byte(`{"people":[ {"id":"ic-1","name":"Connector Alpha","title":"RMF Engineer","location":"Honolulu HI","skills":["rmf","cloud security"],"years":7,"updated":"2026-02-01T00:00:00Z"}, {"id":"ic-2","name":"Connector Beta","title":"ISSO","location":"Santa Fe NM","skills":["ato"],"years":9,"updated":"2026-03-10T00:00:00Z"} ],"nextPage":""}`)) }) return httptest.NewServer(mux) } func TestConnectorICIMSSyncIngestsAndAdvancesWatermark(t *testing.T) { ctx := context.Background() org := seedOrg(t) srv := fakeICIMSServer() defer srv.Close() c := connector.NewICIMS("CUST1", "cid", "secret", srv.URL, srv.Client()) ext := extraction.NewDeterministic() res, err := connector.Sync(ctx, migrator, org, c, ext, "test legal basis", 1000) if err != nil { t.Fatalf("sync: %v", err) } if res.Synced != 2 { t.Fatalf("the first sync must ingest 2 candidates, got %d", res.Synced) } // Two external candidates exist for the org, tagged with the iCIMS external ids. if n := countExternal(t, org); n != 2 { t.Fatalf("2 external candidates must be created, got %d", n) } // Their structured skills were attached (a connector record is a real scoring input, not a headline). var skillCount int if err := migrator.QueryRow(ctx, `SELECT count(*) FROM candidate_skills cs JOIN candidates c ON c.id = cs.candidate_id WHERE c.organization_id=$1 AND c.external_id IN ('ic-1','ic-2')`, org).Scan(&skillCount); err != nil { t.Fatalf("count skills: %v", err) } if skillCount < 3 { t.Fatalf("the structured skills must be attached (rmf, cloud security, ato), got %d", skillCount) } // A sourcing_log provenance row exists per record. var logCount int if err := migrator.QueryRow(ctx, `SELECT count(*) FROM sourcing_log WHERE organization_id=$1 AND external_id IN ('ic-1','ic-2') AND provider='icims'`, org).Scan(&logCount); err != nil { t.Fatalf("count sourcing_log: %v", err) } if logCount != 2 { t.Fatalf("a sourcing_log row must be written per record, got %d", logCount) } // The watermark advanced to the max updated timestamp seen (compared as an instant, timezone independent). var watermarkOK bool if err := migrator.QueryRow(ctx, `SELECT watermark = '2026-03-10T00:00:00Z'::timestamptz FROM connector_sync_state WHERE organization_id=$1 AND connector_name='icims'`, org).Scan(&watermarkOK); err != nil { t.Fatalf("read watermark: %v", err) } if !watermarkOK { t.Fatal("the watermark must advance to the max updated instant 2026-03-10T00:00:00Z") } // Idempotency: a second sync over the same records dedupes (enriches), it does not create duplicates. res2, err := connector.Sync(ctx, migrator, org, c, ext, "test legal basis", 1000) if err != nil { t.Fatalf("second sync: %v", err) } if res2.Synced != 2 { t.Fatalf("the second sync still processes 2 records, got %d", res2.Synced) } if n := countExternal(t, org); n != 2 { t.Fatalf("a re run must not duplicate candidates, still expect 2, got %d", n) } } // countExternal counts the org's external candidates carrying the iCIMS ids. func countExternal(t *testing.T, org uuid.UUID) int { t.Helper() var n int if err := migrator.QueryRow(context.Background(), `SELECT count(*) FROM candidates WHERE organization_id=$1 AND external_id IN ('ic-1','ic-2')`, org).Scan(&n); err != nil { t.Fatalf("count external candidates: %v", err) } return n }

Search equations, builds, manuscript text, and recovered sources.