MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / pool_fixture

Function pool_fixture

libatomic/tests/query_view_service_test.rs:364–385  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

362}
363
364async fn pool_fixture() -> (tempfile::TempDir, LocalService, pb::RepositoryRef, String) {
365 let (dir, service, repository) = fixture().await;
366 let repo = Repository::open(dir.path()).unwrap();
367 let wc = repo.require_working_copy_id().unwrap();
368 let memory = "01ARZ3NDEKTSV4RRFFQ69G5FAV";
369 repo.vault_store(
370 &format!("memory/{memory}.md"),
371 VaultEntryType::Memory,
372 b":::memory\nPool starvation regression.\n:::\n".to_vec(),
373 serde_json::json!({"id": memory, "kind": "context", "status": "active"}).to_string(),
374 )
375 .unwrap();
376 let memory_id = iri::mint_memory(&repo.project_id().unwrap(), memory);
377 for index in 0..12 {
378 let path = format!("src/pool_{index}.rs");
379 std::fs::write(dir.path().join(&path), format!("// {memory}\n")).unwrap();
380 repo.add(wc, &path, TrackingOptions::default()).unwrap();
381 }
382 record(&repo, "record higher-scored pool candidates");
383 drop(repo);
384 (dir, service, repository, memory_id)
385}
386
387#[tokio::test]
388async fn kind_filter_precedes_the_mixed_candidate_pool() {

Calls 10

openFunction · 0.85
vault_storeMethod · 0.80
fixtureFunction · 0.70
writeFunction · 0.70
recordFunction · 0.70
unwrapMethod · 0.45
pathMethod · 0.45
project_idMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected