Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

ci: run the full test suite (#1858)

Kevina5609f22697f
diff --git a/.github/full-suite-known-failures.txt b/.github/full-suite-known-failures.txt
new file mode 100644
index 00000000..7ee9975b
--- /dev/null
+++ b/.github/full-suite-known-failures.txt
@@ -0,0 +1,222 @@
+# Tests that already fail on an unmodified tree.
+#
+# The `Run the full test suite` step in .github/workflows/ci.yml deselects
+# every node id in this file, so that step gates on new breakage instead of on
+# these pre-existing defects. Nothing here is caused by wiring the suite into
+# CI, and none of it is fixed here on purpose: the step reports the gap, it
+# does not paper over it.
+#
+# Provenance. Generated on a clean checkout of
+#
+# 4f4a0031776cb3fa873a77bdbd0148b658254bb2
+#
+# with the repository's own requirements-ci.txt installed, from the repository
+# root, with the LLM API keys removed from the environment and the Hugging
+# Face cache forced offline:
+#
+# pytest -q tests -m "not integration" # -> the 49 further down
+# pytest -q tests -m integration \ # -> the 7 integration entries
+# --ignore tests/integrations/google_adk/ \
+# --ignore tests/integrations/open_ontologies/
+# # HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1, no OPENAI/ANTHROPIC/GEMINI key
+#
+# Both runs were Windows 11 / CPython 3.11; CI is ubuntu-latest / CPython 3.11.
+# That measurement is not a superset of a Linux run: the entries appended below
+# from the suite's first Linux run are failures it could not see, so this list
+# is the union of the two runs rather than an upper bound from either. The
+# entries marked `# windows-only` are expected to pass on Linux and are
+# deselected on Windows only. The rest are expected to reproduce.
+#
+# Format: one pytest node id per line. The step ignores a line only when it is
+# empty or its first character is `#`, so keep comments flush left — an indented
+# comment would be read as a node id and deselected as the empty string. A
+# trailing `# windows-only` marker means the step deselects that id when it runs
+# on Windows, and runs it everywhere else.
+#
+# Delete a line to re-enable a test. Fixing the defect behind it is what should
+# drive that, not convenience.
+
+# --- The test double patches a call the ingest path does not make -------------
+# Each of these stubs `requests` at a layer the ingestors do not use: they fetch
+# through `request_with_ssrf_guard()`, which issues `session.request(...)` —
+# neither `requests.get()` nor `Session.get()`. The stub therefore intercepts
+# nothing, the request is really sent, and the guard
+# pins the connection to the address it resolved. `tests/ingest/conftest.py`
+# installs an autouse fixture that stubs `ssrf.socket.getaddrinfo` to map *every*
+# hostname to the single literal 93.184.216.34, so all four calls aim at that
+# one address regardless of the URL the test passes. Windows refuses to connect
+# to it (`[WinError 10049] 在其上下文中,该请求的地址无效`); on the Linux runner
+# the connection times out instead. They fail on both platforms, so they are
+# deselected unconditionally rather than on Windows only.
+# What each one stubs, and why it misses:
+# test_ingest_feed — `requests.get`; the feed fetch goes through
+# `request_with_ssrf_guard()`, so the stub misses and GET /feed.xml is sent.
+tests/ingest/test_ingestors.py::TestFeedIngestor::test_ingest_feed
+# test_ingest_url_happy — `requests.Session.get`; the page fetch calls
+# `request_with_ssrf_guard(..., session=...)`, which uses `session.request`,
+# so the stub misses and GET / is sent.
+tests/ingest/test_web_ingestor.py::test_ingest_url_happy
+# test_sitemap_fallback_parsing — `requests.get`; `SitemapCrawler.parse_sitemap`
+# goes through `request_with_ssrf_guard()`, so the stub misses and GET / is sent.
+tests/ingest/test_web_ingestor.py::test_sitemap_fallback_parsing
+# test_sitemap_index_recursion — `requests.get`; `SitemapCrawler.crawl_sitemap_index`
+# goes through `request_with_ssrf_guard()`, so the stub misses and GET /index.xml
+# is sent.
+tests/ingest/test_web_ingestor.py::test_sitemap_index_recursion
+
+# --- Windows-only: symlink creation needs a privilege -------------------------
+# `OSError: [WinError 1314] 客户端没有所需的特权` — creating the symlink the
+# test needs requires Developer Mode or an elevated shell on Windows. On Linux
+# it runs, which is where the rejection is actually covered.
+tests/semantic_extract/test_cache_backends.py::test_sqlite_rejects_symlinked_db # windows-only
+
+# --- A MagicMock reaches code that compares or parses it ----------------------
+# `TypeError: '>' not supported between instances of 'MagicMock' and 'int'`, or
+# `TypeError: expected string or bytes-like object, got 'MagicMock'`. The
+# doubles these tests install no longer satisfy the signatures the production
+# code now uses, so the call raising is the production code behaving correctly.
+tests/ingest/test_ingestors.py::TestUnifiedIngest::test_ingest_web_dispatch
+tests/ingest/test_ingestors.py::TestWebIngestor::test_ingest_url
+tests/semantic_extract/test_extractors.py::TestExtractors::test_event_detector_batch_via_detect_events
+tests/semantic_extract/test_extractors.py::TestExtractors::test_ner_extraction_batch_via_extract_entities
+tests/semantic_extract/test_extractors.py::TestExtractors::test_relation_extraction_batch_via_extract_relations
+tests/semantic_extract/test_extractors.py::TestExtractors::test_semantic_analyzer_batch_parallel
+tests/semantic_extract/test_extractors.py::TestExtractors::test_semantic_network_batch_via_extract_network
+tests/semantic_extract/test_extractors.py::TestExtractors::test_triplet_extraction_batch_via_extract_triplets
+tests/semantic_extract/test_performance.py::TestSemanticExtractImprovements::test_ner_parallel_processing
+tests/semantic_extract/test_performance.py::TestSemanticExtractImprovements::test_relation_parallel_processing
+tests/semantic_extract/test_performance.py::TestSemanticExtractImprovements::test_triplet_parallel_processing
+tests/semantic_extract/test_regression_performance_edge_cases.py::test_pattern_batch_defaults_to_single_worker_low_latency
+tests/semantic_extract/test_retry_logic.py::TestRetryLogic::test_chunked_extraction_propagation
+tests/semantic_extract/test_retry_logic.py::TestRetryLogic::test_relations_chunked_propagation
+tests/semantic_extract/test_retry_logic.py::TestRetryLogic::test_triplets_chunked_propagation
+tests/semantic_extract/test_robustness_fallback.py::TestRobustnessFallback::test_batch_metadata_propagation
+tests/test_semantic_extract_batch_provenance.py::TestSemanticExtractBatch::test_event_detector_batch
+tests/test_semantic_extract_batch_provenance.py::TestSemanticExtractBatch::test_semantic_analyzer_batch
+tests/test_semantic_extract_batch_provenance.py::TestSemanticExtractBatch::test_semantic_network_batch
+
+# --- Provider pool: the assertions describe an older key-resolution contract ---
+# e.g. `unexpectedly identical: <MagicMock name='OpenAIProvider-0'>` — the test
+# wants a fresh provider per API key, the pool returns a shared one.
+tests/semantic_extract/test_provider_pool_isolation.py::TestCredentialIsolation::test_env_key_rotation_creates_fresh_provider
+tests/semantic_extract/test_provider_pool_isolation.py::TestCredentialIsolation::test_env_key_rotation_via_create_provider
+tests/semantic_extract/test_provider_pool_isolation.py::TestCredentialIsolation::test_explicit_key_matches_env_key_reuses_provider
+tests/semantic_extract/test_provider_pool_isolation.py::TestProviderPoolInternals::test_resolve_api_key_env_var_fallback
+
+# --- Provider fallback path: the doubles no longer drive the branch -----------
+# All six assert on generate_typed falling back to generate; the fallback never
+# fires under these doubles (`AssertionError: Exception not raised`, `0 != 2`).
+tests/test_issue_554_fixes.py::TestBug3GenerateTypedFallbackToPlainGenerate::test_error_raised_when_both_paths_fail
+tests/test_issue_554_fixes.py::TestBug3GenerateTypedFallbackToPlainGenerate::test_fallback_preserves_error_on_bad_json
+tests/test_issue_554_fixes.py::TestBug3GenerateTypedFallbackToPlainGenerate::test_fallback_to_plain_generate_when_structured_fails
+tests/test_issue_554_fixes.py::TestBug3GenerateTypedFallbackToPlainGenerate::test_generate_structured_fallback_warning_has_exc_info
+tests/test_issue_554_fixes.py::TestBug3GenerateTypedFallbackToPlainGenerate::test_generate_structured_is_attempted_first
+tests/test_issue_554_fixes.py::TestBug3GenerateTypedFallbackToPlainGenerate::test_schema_validation_wraps_plain_list
+
+# --- Local embedding backend unavailable offline ------------------------------
+# `128 != 384` and `'fallback' != 'sentence_transformers'`: the real model could
+# not be loaded in this environment, so the fallback backend answers instead.
+tests/test_embedding_providers.py::TestEmbeddingProviders::test_embedding_generator_config
+tests/test_embedding_providers.py::TestEmbeddingProviders::test_sentence_transformers_default
+tests/test_model_selection.py::TestModelSelection::test_dynamic_switching
+tests/test_model_selection.py::TestModelSelection::test_generator_switching
+
+# --- Order-dependent: these pass in isolation, fail in a full run -------------
+# The progress tracker is process-wide state; whichever test enables it first
+# decides what the next one observes.
+tests/test_arrow_exporter.py::TestArrowExporter::test_progress_tracking
+tests/vector_store/test_backward_compatibility.py::TestVectorStoreBackwardCompatibility::test_progress_tracking_unchanged
+
+# --- Assertion drift in the test or its expectation ---------------------------
+tests/context/test_decision_causal_edge_regression.py::test_add_causal_relationship_returns_false_for_duplicate
+tests/export/test_distance_exporter.py::test_hop_distance_no_warning_when_kg_unavailable
+tests/ingest/test_repo_ingestor_security.py::TestIsReservedNAT64Regression::test_nat64_local_prefix_not_blocked
+tests/integrations/agno/test_context_store.py::TestAgnoContextStoreUpsertNERAttributes::test_upsert_indexes_entity_label_as_type
+tests/integrations/agno/test_context_store.py::TestAgnoContextStoreUpsertNERAttributes::test_upsert_indexes_entity_text_not_repr
+tests/semantic_extract/test_cache_backends.py::test_zero_ttl_expires_immediately_on_both_backends
+tests/test_mcp_decisions_link.py::TestLinkDecisionsEndToEnd::test_duplicate_link_returns_false
+tests/vector_store/test_hybrid_similarity.py::TestHybridSimilarityCalculator::test_pearson_similarity_calculation
+tests/vector_store/test_vector_store.py::test_backend_mirroring_and_save
+
+# --- Integration tests outside the two dedicated integration directories ------
+# These carry the `integration` marker but live outside tests/integrations/
+# google_adk/ and tests/integrations/open_ontologies/, so the step runs them
+# with everything else. They need no service and no network: they already fail
+# on an unmodified tree for the same local reasons as the groups above — a
+# MagicMock double that no longer fits the production signature, an optional
+# `sqlalchemy` extra this job does not install, a fallback backend answering
+# because the real embedding model is offline, and two expectation drifts in
+# the deepdive suite.
+tests/ingest/test_notebook_02.py::TestNotebook02DataIngestion::test_03_web_ingestion
+tests/ingest/test_notebook_02.py::TestNotebook02DataIngestion::test_08_database_ingestion
+tests/test_all_features.py::TestSemanticaFeatures::test_03_model_switching
+tests/test_all_features.py::TestSemanticaFeatures::test_06_hybrid_search
+tests/test_semantic_extract_deepdive.py::TestSemanticExtractDeepDive::test_ner_extractor_pattern
+tests/test_semantic_extract_deepdive_part2.py::TestSemanticExtractDeepDivePart2::test_coreference_resolver_pronouns
+tests/test_semantic_extract_deepdive_part2.py::TestSemanticExtractDeepDivePart2::test_event_detector_basic
+
+# -----------------------------------------------------------------------------
+# Added 2026-10-02 from CI run 36860808592 (job `build`, ubuntu-latest /
+# CPython 3.11), when the suite first ran there. The Windows measurement above
+# could not see these: the process-wide config keeps a double that only leaks
+# in the single-process run this step uses, and the rest are environment and
+# expectation drift. No file any of them lives in is touched by the change that
+# added this step, so nothing here is caused by wiring the suite into CI.
+# -----------------------------------------------------------------------------
+
+# --- Provider key resolution: a double supplies the key in a full run ---------
+# `config.get_api_key` hands the client a key whose repr is a `<MagicMock ...>`:
+# a double left by another test is still in the process-wide config when these
+# run. `is_available()` then reports True with no key set, and generation
+# reaches the live client instead of raising `ProcessingError` — 401s from
+# openai/deepseek/groq, a 404 from novita, `EphemeralTokenAPIKeyError` from
+# gemini, and a `TypeError` from anthropic where the `MagicMock` is joined into
+# a string. They pass in the two-invocation Windows measurement above, so they
+# are absent from the groups it produced.
+tests/test_llm_anthropic.py::test_is_available_false_with_no_key
+tests/test_llm_anthropic.py::test_generate_raises_clear_error_when_unavailable
+tests/test_llm_anthropic.py::test_generate_structured_raises_clear_error_when_unavailable
+tests/test_llm_anthropic.py::test_generate_typed_raises_clear_error_when_unavailable
+tests/test_llm_deepseek.py::test_is_available_false_with_no_key
+tests/test_llm_deepseek.py::test_generate_raises_clear_error_when_unavailable
+tests/test_llm_deepseek.py::test_generate_structured_raises_clear_error_when_unavailable
+tests/test_llm_deepseek.py::test_generate_typed_raises_clear_error_when_unavailable
+tests/test_llm_gemini.py::test_is_available_false_with_no_key
+tests/test_llm_gemini.py::test_generate_raises_clear_error_when_unavailable
+tests/test_llm_gemini.py::test_generate_structured_raises_clear_error_when_unavailable
+tests/test_llm_gemini.py::test_generate_typed_raises_clear_error_when_unavailable
+tests/test_llm_groq.py::test_is_available_false_with_no_key
+tests/test_llm_groq.py::test_generate_raises_clear_error_when_unavailable
+tests/test_llm_groq.py::test_generate_structured_raises_clear_error_when_unavailable
+tests/test_llm_groq.py::test_generate_typed_raises_clear_error_when_unavailable
+tests/test_llm_novita.py::test_is_available_false_with_no_key
+tests/test_llm_novita.py::test_generate_raises_clear_error_when_unavailable
+tests/test_llm_novita.py::test_generate_structured_raises_clear_error_when_unavailable
+tests/test_llm_novita.py::test_generate_typed_raises_clear_error_when_unavailable
+tests/test_llm_openai.py::test_is_available_false_with_no_key
+tests/test_llm_openai.py::test_generate_raises_clear_error_when_unavailable
+tests/test_llm_openai.py::test_generate_structured_raises_clear_error_when_unavailable
+tests/test_llm_openai.py::test_generate_typed_raises_clear_error_when_unavailable
+
+# --- The CLI wraps the paths it reports mid-token -----------------------------
+# `test_reports_the_files_it_wrote` looks for the written filename in the
+# command's output, but the reporter hard-wraps that output every ~44 columns,
+# so a path is split mid-token (`graph_entities.ar\nrow`). The assertion is a
+# substring check, so the wrap decides whether it passes.
+tests/test_cli_commands.py::TestExportMultiFileFormats::test_reports_the_files_it_wrote[arrow-.arrow]
+tests/test_cli_commands.py::TestExportMultiFileFormats::test_reports_the_files_it_wrote[csv-.csv]
+tests/test_cli_commands.py::TestExportMultiFileFormats::test_reports_the_files_it_wrote[parquet-.parquet]
+
+# --- faiss PQ training hits a SIMD constraint in this environment -------------
+# `'ksub % 8 == 0' failed` inside `faiss::compute_PQ_dis_tables_dsub2` on the
+# AVX2 path: the training parameters the test passes do not satisfy the
+# constraint the installed faiss build enforces.
+tests/vector_store/test_faiss_index.py::test_builder_trains_pq_index
+
+# --- Count and mock-call drift ------------------------------------------------
+# `expected call not found`: the call the Weaviate test records no longer
+# matches what the store issues. `assert 2 == 5`: the Jena empty-graph test
+# counts operations that all complete only once every concurrent writer has
+# landed.
+tests/vector_store/test_backend_metadata_filtering.py::TestBackendMetadataFiltering::test_weaviate_store_filter_by_metadata_native_filter
+tests/triplet_store/test_jena_store_empty_graph.py::TestJenaStoreEmptyGraph::test_empty_graph_with_concurrent_operations
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b63f33d4..f673d9d5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -146,6 +146,66 @@ jobs:
- name: Install pinned Python dependencies
run: |
pip install -r requirements-ci.txt --require-hashes
+ # The steps around this one each cover a slice: the reasoning suite above,
+ # the two integration directories at the end of the job. Everything else
+ # under tests/ has no gate at all, so a regression there is only found by
+ # whoever happens to run the suite by hand. This step closes that gap by
+ # running the whole suite against the pinned tree.
+ #
+ # It sits right after requirements-ci.txt on purpose: that is the
+ # environment the baseline in full-suite-known-failures.txt was measured
+ # in. The open-ontologies extra is layered on later in the job and would
+ # change which modules import, so running the suite before it keeps the
+ # two consistent.
+ #
+ # .github/full-suite-known-failures.txt lists the tests that already fail
+ # on an unmodified checkout. They are deselected here, so this step gates
+ # on new breakage instead of on those pre-existing defects. The file is
+ # the record of the gap: fixing a defect means deleting its line. It is
+ # LF-only — the loop below feeds each line to --deselect verbatim, so a
+ # stray CR would make every node id miss.
+ - name: Run the full test suite
+ run: |
+ # A node id that no longer collects is a no-op for --deselect rather
+ # than an error, so a stale line cannot break the job; it just stops
+ # deselecting, and the test it named runs again.
+ #
+ # A line may carry a trailing `# windows-only` marker. That means the
+ # id fails only on Windows and is deselected there alone — a symlink
+ # that needs a privilege, for instance. On Linux it runs, which is the
+ # only place the symlink rejection in
+ # tests/semantic_extract/test_cache_backends.py gets exercised at all;
+ # deselecting it unconditionally would drop a security check on the
+ # platform where it works.
+ deselect=()
+ while IFS= read -r line; do
+ case "$line" in
+ ''|'#'*) continue ;;
+ *windows-only*)
+ if [ "${RUNNER_OS:-}" != "Windows" ]; then continue; fi
+ ;;
+ esac
+ node="${line%%#*}"
+ node="${node#"${node%%[![:space:]]*}"}"
+ node="${node%"${node##*[![:space:]]}"}"
+ deselect+=(--deselect "$node")
+ done < .github/full-suite-known-failures.txt
+ echo "deselecting known failures: ${#deselect[@]}"
+
+ # The google_adk and open_ontologies directories have their own steps
+ # at the end of this job, each with its own dependency installation.
+ # Skipping them here keeps those assumptions intact and avoids
+ # running them twice.
+ #
+ # Everything else under tests/ runs here, integration marker or not:
+ # the integration tests outside those two directories need nothing
+ # beyond the pinned tree this step is measured against — they are
+ # offline and service-free — so leaving them unnamed would be the one
+ # slice that still had no gate.
+ pytest -q tests \
+ --ignore tests/integrations/google_adk/ \
+ --ignore tests/integrations/open_ontologies/ \
+ "${deselect[@]}"
- name: Verify requirements-ci.txt is up to date
run: |
pip install -r .github/requirements/uv-tool.txt --require-hashes