repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
OpenViking | tests/session/memory/test_schema_models.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for schema_models.py - dynamic Pydantic model generation."""
import tempfile
from pathlib import Path
import pytest
import yaml
from openviking.session.memory.dataclass import (
MemoryField,
MemoryTy... | 406 | 15,862 |
OpenViking | tests/session/memory/test_memory_diff.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
Test for memory_diff.json generation in SessionCompressorV3.
Verifies that memory_diff.json is correctly written to the archive directory
containing adds, updates, and deletes.
"""
from unittest.mock import AsyncM... | 500 | 17,369 |
OpenViking | tests/session/memory/test_graph_view.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import py_compile
import warnings
from pathlib import Path
from openviking.session.memory.graph_view import _render_graph_html
def test_graph_view_module_compiles_without_escape_warnings():
path = (
Path... | 317 | 11,194 |
OpenViking | tests/session/memory/test_memory_patch.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
Tests for removed text patch API.
"""
import openviking.session.memory.merge_op as merge_op
from openviking.session.memory.merge_op import patch_handler
def test_text_patch_handler_api_is_removed():
assert no... | 14 | 422 |
OpenViking | tests/session/memory/test_memory_updater.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
Tests for MemoryUpdater.
"""
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from openviking.message import Message
from openviking.message.part import TextPart
from openviking.prompts.manager... | 1,611 | 61,049 |
OpenViking | tests/session/memory/test_memory_tools.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
Tests for memory tools.
"""
import pytest
from openviking.server.identity import RequestContext, Role, ToolContext
from openviking.session.memory.dataclass import MemoryFile
from openviking.session.memory.tools im... | 263 | 8,983 |
OpenViking | tests/metrics/conftest.py | .py | """
Shared fixtures for `tests/metrics/`.
The metrics test suite is split into feature-aligned subdirectories. This `conftest.py`
provides small, reusable fixtures/helpers that are broadly useful across those areas.
"""
from __future__ import annotations
from collections.abc import Callable, Iterator
from pathlib im... | 105 | 3,270 |
OpenViking | tests/metrics/integration/test_http_metrics.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
from fastapi import FastAPI
from fastapi.testclient import TestClient
from starlette.requests import Request
import openviking.observability.http_observability_middleware as http_mi... | 360 | 11,983 |
OpenViking | tests/metrics/integration/test_telemetry_bridge.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from openviking.metrics.datasources.telemetry_bridge import TelemetryBridgeEventDataSource
from openviking.metrics.global_api import init_metrics_from_server_config, shutdown_metrics
from openviking.server.config impor... | 108 | 4,360 |
OpenViking | tests/metrics/integration/test_account_dimension.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
import asyncio
import pytest
from fastapi import FastAPI
from fastapi.testclient import TestClient
from starlette.requests import Request
import openviking.observability.http_obser... | 284 | 10,135 |
OpenViking | tests/metrics/integration/test_bootstrap.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
from pathlib import Path
import pytest
import openviking.metrics.bootstrap as bootstrap
from openviking.metrics.account_dimension import (
configure_metric_account_dimension,
... | 175 | 6,000 |
OpenViking | tests/metrics/config/test_server_config.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import json
import pytest
from openviking.server.config import load_server_config
def test_load_server_config_rejects_legacy_server_metrics_field(tmp_path):
config_path = tmp_path / "ov.conf"
config_path.wr... | 60 | 2,100 |
OpenViking | tests/metrics/core/test_refresh.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import asyncio
import pytest
from openviking.metrics.collectors.base import CollectorConfig, Refreshable
from openviking.metrics.collectors.manager import CollectorManager, RefreshResult
from openviking.metrics.core.... | 159 | 4,905 |
OpenViking | tests/metrics/core/test_exporter.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import asyncio
import pytest
from openviking.metrics.exporters.otel import OTelMetricExporter, _compute_next_tick_and_sleep
def test_exporter_outputs_help_type_and_empty_metrics(registry, render_prometheus):
re... | 168 | 5,268 |
OpenViking | tests/metrics/core/test_registry.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from pathlib import Path
import pytest
from openviking.metrics.core.base import MetricCollector
from openviking.metrics.core.registry import MetricRegistry
def test_metric_collector_metric_name_includes_namespace_a... | 84 | 2,860 |
OpenViking | tests/metrics/datasources/test_event_datasources.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
from types import SimpleNamespace
import openviking.metrics.datasources.encryption as enc
import openviking.metrics.datasources.retrieval as retrieval
import openviking.metrics.data... | 163 | 5,953 |
OpenViking | tests/metrics/datasources/test_state_datasources.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
from pathlib import Path
from types import SimpleNamespace
import openviking.metrics.datasources.probes as probes
from openviking.metrics.collectors.base import (
CollectorConfi... | 236 | 7,601 |
OpenViking | tests/metrics/collectors/test_feedback_collector.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
import json
from openviking.metrics.collectors.feedback import FeedbackCollector
def test_feedback_collector_exports_summary_and_channel_gauges(
registry, render_prometheus, t... | 171 | 6,420 |
OpenViking | tests/metrics/collectors/test_collector_contracts.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
from dataclasses import dataclass
from pathlib import Path
import pytest
from openviking.metrics.collectors.async_system_probe import AsyncSystemProbeCollector
from openviking.metr... | 456 | 15,970 |
OpenViking | tests/metrics/collectors/test_state_collectors.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
from openviking.metrics.collectors.observer_health import ObserverHealthCollector
from openviking.metrics.collectors.queue import QueueCollector
from openviking.metrics.collectors.ta... | 252 | 9,917 |
OpenViking | tests/metrics/collectors/test_event_collectors.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
import re
import openviking.metrics.global_api as global_api
from openviking.metrics.collectors.base import EventMetricCollector
from openviking.metrics.collectors.cache import Cach... | 332 | 13,609 |
OpenViking | tests/benchmark/test_cuvs_service_summary.py | .py | import importlib.util
import json
import sys
from pathlib import Path
import pytest
MODULE_PATH = (
Path(__file__).resolve().parents[2] / "benchmark" / "cuvs" / "summarize_service_runs.py"
)
SPEC = importlib.util.spec_from_file_location("summarize_cuvs_service_runs", MODULE_PATH)
assert SPEC is not None and SPEC.... | 114 | 3,951 |
OpenViking | tests/benchmark/test_vectordb_perf_run.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import json
import struct
import pytest
from benchmark.vectordb_perf.run import (
RunResult,
build_dir_vector_workload,
directory_queries,
extract_path,
iter_json_array_records,
parse_args,
... | 454 | 14,992 |
OpenViking | tests/benchmark/test_cuvs_collection_summary.py | .py | import importlib.util
import json
import sys
from pathlib import Path
import pytest
MODULE_PATH = (
Path(__file__).resolve().parents[2] / "benchmark" / "cuvs" / "summarize_collection_runs.py"
)
SPEC = importlib.util.spec_from_file_location("summarize_cuvs_collection_runs", MODULE_PATH)
assert SPEC is not None and... | 147 | 5,374 |
OpenViking | tests/benchmark/test_cuvs_service_concurrency_benchmark.py | .py | import importlib.util
import sys
from pathlib import Path
import numpy as np
import pytest
MODULE_PATH = (
Path(__file__).resolve().parents[2]
/ "benchmark"
/ "cuvs"
/ "run_service_concurrency_benchmark.py"
)
SPEC = importlib.util.spec_from_file_location("run_cuvs_service_concurrency_benchmark", MODUL... | 89 | 2,717 |
OpenViking | tests/benchmark/test_cuvs_collection_benchmark.py | .py | import importlib.util
import sys
from pathlib import Path
import numpy as np
import pytest
MODULE_PATH = (
Path(__file__).resolve().parents[2] / "benchmark" / "cuvs" / "run_collection_benchmark.py"
)
SPEC = importlib.util.spec_from_file_location("run_cuvs_collection_benchmark", MODULE_PATH)
assert SPEC is not Non... | 144 | 4,537 |
OpenViking | tests/benchmark/test_vectordb_perf_async_utils.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import asyncio
import pytest
from benchmark.vectordb_perf.async_utils import map_bounded_as_completed
@pytest.mark.asyncio
async def test_map_bounded_as_completed_limits_peak_in_flight_calls():
active = 0
p... | 53 | 1,308 |
OpenViking | tests/benchmark/test_cuvs_index_benchmark.py | .py | import importlib.util
import sys
from pathlib import Path
import numpy as np
import pytest
MODULE_PATH = Path(__file__).resolve().parents[2] / "benchmark" / "cuvs" / "run_index_benchmark.py"
SPEC = importlib.util.spec_from_file_location("run_cuvs_index_benchmark", MODULE_PATH)
assert SPEC is not None and SPEC.loader ... | 239 | 7,576 |
OpenViking | tests/benchmark/test_cuvs_index_summary.py | .py | import importlib.util
import json
import sys
from pathlib import Path
import pytest
MODULE_PATH = Path(__file__).resolve().parents[2] / "benchmark" / "cuvs" / "summarize_index_runs.py"
SPEC = importlib.util.spec_from_file_location("summarize_cuvs_index_runs", MODULE_PATH)
assert SPEC is not None and SPEC.loader is no... | 144 | 5,146 |
OpenViking | tests/utils/mock_context.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Mock context utilities for testing"""
from openviking.server.identity import RequestContext, Role
from openviking_cli.session.user_id import UserIdentifier
def make_test_user(
account_id: str = "acc1",
us... | 28 | 784 |
OpenViking | tests/utils/test_resource_processor_processing_mode.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from types import SimpleNamespace
from unittest.mock import AsyncMock, Mock
import pytest
from openviking.server.identity import RequestContext, Role
from openviking.utils.ingest_options import IngestOptions
from ope... | 442 | 15,643 |
OpenViking | tests/utils/test_circuit_breaker.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import threading
import time
import pytest
def test_circuit_breaker_starts_closed():
from openviking.utils.circuit_breaker import CircuitBreaker
cb = CircuitBreaker(failure_threshold=3, reset_timeout=10)
... | 221 | 8,635 |
OpenViking | tests/utils/test_process_lock.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for process-lock interaction with host signal handling."""
import os
import signal
import subprocess
import sys
import textwrap
import time
import pytest
from openviking.utils.process_lock import acquire_da... | 93 | 3,124 |
OpenViking | tests/utils/mock_agfs.py | .py | import shutil
import threading
import uuid
from pathlib import Path
from unittest.mock import MagicMock
class MockLocalAGFS:
"""
A mock implementation of the AGFS binding client that operates on a local
directory. Useful for tests where running the real RAGFS binding is not
feasible or desired.
""... | 185 | 5,888 |
OpenViking | tests/cli/test_cli_resources.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""CLI resource operation tests (add-resource, add-skill)."""
import os
import tempfile
import uuid
import pytest
from conftest import ov_add_resource
pytestmark = pytest.mark.cli_remote
class TestAddResource:
... | 57 | 2,329 |
OpenViking | tests/cli/test_cli_search.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""CLI search operation tests (find, search, grep, glob)."""
import time
import pytest
from conftest import ov, skip_if_auth_error
pytestmark = pytest.mark.cli_remote
class TestSearchFind:
def test_find_basic(s... | 129 | 5,423 |
OpenViking | tests/cli/test_setup_wizard.py | .py | """Tests for the openviking-server init setup wizard."""
from __future__ import annotations
import json
import os
from unittest.mock import MagicMock, patch
from openviking_cli.setup_wizard import (
_CUSTOM_SETUP,
_DEFAULT_KIMI_MODEL,
_GO_BACK,
_SKIP_VLM,
CLOUD_PROVIDERS,
EMBEDDING_PRESETS,
... | 1,293 | 55,169 |
OpenViking | tests/cli/test_cli_compatibility.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""CLI compatibility checks: binary availability, version, GLIBC, config, server connectivity."""
import json
import os
import platform
import subprocess
import pytest
from conftest import CLI_BIN, CLI_CONFIG_PATH, _e... | 129 | 4,722 |
OpenViking | tests/cli/test_cli_snapshot.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""CLI snapshot (git version control) tests."""
import re
import time
import uuid
import pytest
from conftest import ov
pytestmark = pytest.mark.cli_remote
def _create_file(uri: str, content: str):
"""Create a ... | 341 | 14,183 |
OpenViking | tests/cli/test_cli_skills.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""CLI skills endpoint tests (add-skill, list skills, skill CRUD)."""
import os
import tempfile
import uuid
import pytest
from conftest import ov, ov_add_skill
pytestmark = pytest.mark.cli_remote
class TestSkillAdd... | 86 | 3,448 |
OpenViking | tests/cli/test_cli_relations.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""CLI relations operation tests (relations, link, unlink)."""
import os
import tempfile
import uuid
import pytest
from conftest import ov, ov_add_resource, ov_rm
pytestmark = pytest.mark.cli_remote
class TestRelat... | 54 | 1,992 |
OpenViking | tests/cli/test_user_identifier.py | .py | """Tests for account/user-only UserIdentifier."""
import pytest
from openviking_cli.session.user_id import UserIdentifier
class TestUserIdentifier:
"""Verify that UserIdentifier is keyed by account/user only."""
def test_same_user_produces_same_space(self):
u1 = UserIdentifier("acct", "alice")
... | 26 | 874 |
OpenViking | tests/cli/test_doctor.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for ``openviking-server doctor`` diagnostic checks."""
from __future__ import annotations
import importlib
import json
import os
import sys
from pathlib import Path
from types import SimpleNamespace
from unit... | 1,057 | 38,492 |
OpenViking | tests/cli/test_cli_system.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""CLI system endpoint tests (health, status, wait)."""
import pytest
from conftest import ov
pytestmark = pytest.mark.cli_remote
class TestSystemHealth:
def test_health(self):
r = ov(["health", "-o", "j... | 47 | 1,710 |
OpenViking | tests/cli/test_cli_filesystem.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""CLI filesystem operation tests (ls, tree, stat, mkdir, rm, mv)."""
import os
import tempfile
import uuid
import pytest
from conftest import ov, ov_add_resource, ov_mkdir, ov_mv, ov_rm
pytestmark = pytest.mark.cli_... | 138 | 5,295 |
OpenViking | tests/cli/test_cli_sessions.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""CLI session operation tests (new, list, get, get-context, delete, add-message, commit)."""
import pytest
from conftest import ov, ov_session_delete, ov_session_new
pytestmark = pytest.mark.cli_remote
class TestSe... | 121 | 4,410 |
OpenViking | tests/cli/test_cli_observer.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""CLI observer endpoint tests (queue, models, system status)."""
import pytest
from conftest import ov
pytestmark = pytest.mark.cli_remote
class TestObserverQueue:
def test_queue_status(self):
r = ov(["... | 48 | 1,702 |
OpenViking | tests/cli/test_cli_content.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""CLI content operation tests (read, abstract, overview, download, write, reindex)."""
import os
import tempfile
import uuid
import pytest
from conftest import ov, ov_add_resource, ov_reindex, ov_write
pytestmark = ... | 92 | 3,599 |
OpenViking | tests/cli/conftest.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""CLI fixtures that run against a real OpenViking server process."""
import json
import os
import shutil
import socket
import subprocess
import sys
import tempfile
import time
import uuid
from pathlib import Path
from... | 681 | 21,539 |
OpenViking | tests/agfs/test_async_client.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import pytest
import openviking.pyagfs.async_client as async_client
from openviking.pyagfs import AsyncAGFSClient
class _SyncAGFS:
"""Minimal synchronous binding stub used by the async adapter tests."""
def... | 70 | 2,078 |
OpenViking | tests/agfs/test_fs_binding.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""AGFS Python Binding Tests for VikingFS interface
Tests the python binding mode of VikingFS which directly uses AGFS implementation
without HTTP server.
"""
import os
import shutil
import uuid
import pytest
from ... | 247 | 9,414 |
OpenViking | tests/agfs/test_git_binding.py | .py | """End-to-end tests for the git_commit/git_restore/git_show PyO3 bindings.
These tests exercise the binding through ragfs_python.RAGFSBindingClient
directly so they don't require the higher-level VikingFS layer.
"""
import shutil
import tempfile
from pathlib import Path
import pytest
# Skip the whole module if the... | 411 | 12,628 |
OpenViking | tests/agfs/test_fs_binding_s3.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""AGFS Python Binding Tests for VikingFS interface with S3 backend
Tests the python binding mode of VikingFS with S3 backend (MinIO/TOS).
"""
import json
import os
import uuid
from pathlib import Path
import pytest... | 145 | 4,849 |
OpenViking | tests/agfs/test_git_binding_s3.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""End-to-end tests for the git_commit/git_restore/git_show PyO3 bindings on
the **S3/TOS** backend (audit plan §A4).
These mirror the local-backend flow in ``test_git_binding.py`` but wire the
binding to a real S3-co... | 338 | 11,094 |
OpenViking | tests/agfs/test_viking_fs_git.py | .py | """End-to-end tests for VikingFS git commit/restore/show/log Python layer.
These exercise the full path: VikingFS.commit -> AsyncAGFSClient -> Rust
RAGFSBindingClient -> GitService, plus URI<->tree-path conversion and the
double-encryption invariant called out in the design doc.
"""
from __future__ import annotations... | 1,110 | 40,652 |
OpenViking | tests/agfs/conftest.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import shutil
from pathlib import Path
import pytest
@pytest.fixture(scope="session")
def agfs_test_root():
"""Root directory for AGFS tests."""
path = Path("/tmp/openviking_agfs_test")
path.mkdir(parent... | 17 | 402 |
OpenViking | tests/service/test_resource_service_parse_mode.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""ResourceService coverage for add_resource parse modes."""
from types import SimpleNamespace
from unittest.mock import AsyncMock, MagicMock
import pytest
from openviking.resource.watch_manager import WatchManager,... | 307 | 9,216 |
OpenViking | tests/service/test_resource_service_connector.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Core routing and task-state tests for Connector imports."""
import asyncio
import json
from types import SimpleNamespace
from unittest.mock import AsyncMock, Mock
import httpx
import pytest
from openviking.connect... | 1,550 | 48,046 |
OpenViking | tests/service/test_watch_recovery.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Integration tests for watch task recovery after service restart."""
import asyncio
import json
from datetime import datetime, timedelta
from pathlib import Path
from typing import AsyncGenerator
from unittest.mock i... | 713 | 25,218 |
OpenViking | tests/service/test_reindex_placeholder.py | .py | """Regression tests for directory-meta placeholder filtering in reindex (issue #2434).
VikingFS.abstract()/overview() render a ``# <uri>`` header followed only by a
``[Directory ... is not ready]`` marker for directories without a generated
``.abstract.md``/``.overview.md``. Before this fix the reindex executor embedd... | 54 | 2,177 |
OpenViking | tests/service/test_agent_evolution_service.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from unittest.mock import AsyncMock, Mock
import pytest
from openviking.server.identity import RequestContext, Role
from openviking.service.agent_evolution_service import AgentEvolutionService
from openviking.session... | 274 | 9,877 |
OpenViking | tests/service/test_search_service_image.py | .py | import pytest
from openviking.server.identity import RequestContext, Role
from openviking.service.search_service import SearchService
from openviking_cli.session.user_id import UserIdentifier
class FakeVikingFS:
def __init__(self):
self.image_url = None
async def read_file_bytes(self, uri, ctx=None)... | 35 | 965 |
OpenViking | tests/service/test_reindex_file_lock.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Regression tests for reindexing single-file URIs under tree locks."""
from types import SimpleNamespace
from unittest.mock import AsyncMock
from openviking.server.identity import RequestContext, Role
from openvikin... | 74 | 2,373 |
OpenViking | tests/service/test_resource_memory_link_service.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for resource-memory linking service."""
import re
from types import SimpleNamespace
import pytest
from openviking.server.identity import RequestContext, Role
from openviking.service.resource_memory_link_serv... | 737 | 24,081 |
OpenViking | tests/service/test_resource_service_understanding_routing.py | .py | from types import SimpleNamespace
from unittest.mock import AsyncMock
import pytest
from openviking.parse.accessors.base import LocalResource, SourceType
from openviking.parse.parsers.media.utils import MPEG_TS_PACKET_SIZE, MPEG_TS_PROBE_BYTES
from openviking.server.identity import RequestContext, Role
from openvikin... | 217 | 8,188 |
OpenViking | tests/service/test_resource_service_watch.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Integration tests for ResourceService watch functionality."""
from types import SimpleNamespace
from typing import AsyncGenerator
from unittest.mock import AsyncMock, MagicMock
import pytest
import pytest_asyncio
... | 940 | 31,927 |
OpenViking | tests/service/test_session_service_metrics.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from unittest.mock import AsyncMock, Mock
import pytest
import openviking.service.session_service as session_service_module
from openviking.metrics.datasources.session import SessionLifecycleDataSource
from openvikin... | 141 | 4,687 |
OpenViking | tests/service/test_fs_service.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for file-system service coordination behavior."""
from types import SimpleNamespace
from unittest.mock import AsyncMock
import pytest
from openviking.server.identity import RequestContext, Role
from openviki... | 513 | 16,639 |
OpenViking | tests/vectordb/test_engine_filter_routing_abi.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import pytest
from openviking.storage.vectordb.engine._python_api import build_abi3_exports
class _CurrentBackend:
def __init__(self):
self.calls = []
def _new_index_engine(self, path_or_json):
... | 191 | 7,269 |
OpenViking | tests/vectordb/test_data_processor.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import json
import shutil
import unittest
from datetime import datetime, timezone
from pydantic import ValidationError
from openviking.storage.vectordb.utils.data_processor import DataProcessor
DB_PATH = "./test_dat... | 140 | 5,274 |
OpenViking | tests/vectordb/test_geo_point_boundary.py | .py | """Regression test: parse_geo_point must accept valid WGS-84 boundary coordinates.
The geographic standard defines a *closed* interval for both axes:
longitude ∈ [-180, 180] (includes the antimeridian / International Date Line)
latitude ∈ [ -90, 90] (includes the North and South Poles)
Using strict inequaliti... | 41 | 1,458 |
OpenViking | tests/vectordb/test_openviking_vectordb.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import json
import shutil
import unittest
from unittest.mock import patch
from openviking.storage.vectordb.collection.local_collection import get_or_create_local_collection
TEST_DB_PATH = "./test_data/db_test_openvik... | 611 | 23,533 |
OpenViking | tests/vectordb/test_vikingdb_project.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import unittest
@unittest.skip("Temporarily skip TestVikingDBProject")
class TestVikingDBProject(unittest.TestCase):
"""
Unit tests for VikingDB Project and Collection implementation for private deployment.
... | 34 | 1,057 |
OpenViking | tests/vectordb/test_cuvs_collection.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import gc
import threading
import traceback
import weakref
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
import pytest
from openviking.storage.vectordb.collection.local_collection import ... | 1,480 | 53,843 |
OpenViking | tests/vectordb/test_fix_fields_data.py | .py | """Regression test: fix_fields_data must fill every missing schema field.
The function backfills schema fields that are absent from a row's data with
their defaults. It previously short-circuited when
``len(field_data_dict) >= len(field_meta_dict)``, using field *count* as a
proxy for "all schema fields present". That... | 54 | 1,974 |
OpenViking | tests/vectordb/test_local_collection_projection.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import json
from types import SimpleNamespace
import pytest
from openviking.storage.vectordb.collection.local_collection import LocalCollection
from openviking.storage.vectordb.store.data import CandidateData
from op... | 193 | 5,932 |
OpenViking | tests/vectordb/test_filter_ops.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import gc
import random
import shutil
import time
import unittest
from openviking.storage.vectordb.collection.local_collection import get_or_create_loca... | 1,347 | 49,508 |
OpenViking | tests/vectordb/test_pydantic_validation.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import os
import sys
import unittest
from openviking.storage.vectordb.utils import validation
sys.path.append(os.getcwd())
class TestPydanticValidation(unittest.TestCase):
def test_valid_collection_meta(self):
... | 49 | 1,540 |
OpenViking | tests/vectordb/test_cuvs_index.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import threading
import time
from array import array
from concurrent.futures import ThreadPoolExecutor
from contextlib import nullcontext
import pytest
from openviking.storage.vectordb.index import cuvs_index as cuvs... | 3,403 | 113,736 |
OpenViking | tests/vectordb/test_store_streaming.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import gc
import weakref
import pytest
import openviking.storage.vectordb.engine as engine
from openviking.storage.vectordb.store.data import CandidateData
from openviking.storage.vectordb.store.local_store import (
... | 222 | 7,567 |
OpenViking | tests/vectordb/benchmark_stress.py | .py | import argparse
import os
import random
import shutil
import threading
import time
from openviking.storage.vectordb.collection.collection import Collection
from openviking.storage.vectordb.collection.local_collection import get_or_create_local_collection
# --- Configuration ---
DEFAULT_DIM = 128
DEFAULT_DB_PATH = "./... | 372 | 11,812 |
OpenViking | tests/vectordb/test_bytes_row.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import json
import random
import string
import unittest
from dataclasses import dataclass, field
from typing import List
from openviking.storage.vectordb import engine
from openviking.storage.vectordb.store.bytes_row i... | 386 | 15,031 |
OpenViking | tests/vectordb/test_engine_filter_packed_native_abi.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import json
import pytest
import openviking.storage.vectordb.engine as engine
def _native_packed_abi_available() -> bool:
backend = getattr(engine, "_BACKEND", None)
return backend is not None and hasattr(b... | 78 | 3,001 |
OpenViking | tests/vectordb/test_project_group.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import os
import shutil
import unittest
from openviking.storage.vectordb.project.project_group import get_or_create_project_group
TEST_PROJECT_ROOT = "./test_data/test_project_root"
class TestProjectGroup(unittest.T... | 66 | 2,469 |
OpenViking | tests/vectordb/test_collection_large_scale.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
Large scale scenario tests - Collection stress tests and performance tests
Tests for large data volumes, high-dimensional vectors, complex queries, etc.
"""
import gc
import random
import shutil
import time
import ... | 975 | 36,340 |
OpenViking | tests/vectordb/test_cuvs_filter_packed.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import gc
import json
import numpy as np
import pytest
from openviking.storage.vectordb.index.cuvs_index import (
CuVSDenseIndex,
CuVSSearchTelemetry,
_CuVSRuntime,
)
from openviking.storage.vectordb.stor... | 245 | 7,458 |
OpenViking | tests/vectordb/test_cuvs_config.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import pytest
from pydantic import ValidationError
from openviking.storage.vectordb_adapters.local_adapter import (
CuVSCollectionAdapter,
LocalCollectionAdapter,
)
from openviking_cli.utils.config.vectordb_co... | 121 | 5,524 |
OpenViking | tests/vectordb/test_crash_recovery.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import multiprocessing
import os
import shutil
import sys
import time
import unittest
from openviking.storage.vectordb.collection.local_collection import get_or_create_local_collection
DB_PATH_CRASH = "./test_data/tes... | 322 | 11,523 |
OpenViking | tests/vectordb/test_recall.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
import random
import shutil
import unittest
from typing import List
from openviking.storage.vectordb.collection.local_collection import get_or_create_local_collection
# Test data path
TEST_DB_PATH = "./test_data/test_... | 598 | 21,549 |
OpenViking | tests/ingest/test_parsers.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Adapter parsing tests against synthetic per-harness fixtures."""
import json
import sqlite3
from openviking.ingest.sources.claude_code import ClaudeCodeSource
from openviking.ingest.sources.codex import CodexSource... | 232 | 8,376 |
OpenViking | tests/ingest/test_config.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""IngestConfig gating + value validation."""
import pytest
from pydantic import ValidationError
from openviking_cli.utils.config.ingest_config import (
CommitPolicy,
IngestConfig,
IngestHarnessConfig,
)
... | 41 | 1,259 |
OpenViking | tests/ingest/test_peer.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""peer_id resolution: assistant model peers, human/git peers, group usernames."""
import json
from pathlib import Path
from openviking.ingest.peer import (
assistant_peer_id,
resolve_git_human_peer,
safe_... | 69 | 2,631 |
OpenViking | tests/ingest/test_jsonl_incremental.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Incremental byte-offset cursor behavior for append-only JSONL sources."""
import json
import os
from openviking.ingest.sources.hermes import HermesSource
from openviking_cli.utils.config.ingest_config import Ingest... | 62 | 2,068 |
OpenViking | tests/ingest/test_cursor_store.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""CursorStore persistence / resume / accumulation."""
from openviking.ingest.cursor_store import CursorStore
from openviking.ingest.models import BYTE_OFFSET, Cursor
def test_upsert_accumulate_and_resume(tmp_path):
... | 44 | 1,762 |
OpenViking | tests/ingest/test_replay.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Replay driver: SDK-client chunking/ensure, batch append, commit, and crash reconcile."""
from openviking.ingest.cursor_store import CursorStore
from openviking.ingest.models import BYTE_OFFSET, Cursor, NormalizedMes... | 195 | 6,771 |
OpenViking | tests/ingest/conftest.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Test isolation for the ingest suite.
``resolve_git_human_peer`` shells out to ``git config``, which otherwise reads the
developer machine's GLOBAL identity and makes human-peer resolution non-deterministic.
Neutrali... | 25 | 867 |
OpenViking | tests/models/test_vlm_strip_think_tags.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""Tests for stripping <think> reasoning tags from VLM responses."""
import pytest
from openviking.models.vlm.base import _THINK_TAG_RE, VLMBase
class TestStripThinkTags:
"""Test _clean_response strips <think> b... | 86 | 3,146 |
OpenViking | tests/models/test_embedding_telemetry_usage.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
from types import SimpleNamespace
from openviking.models.embedder.openai_embedders import OpenAIDenseEmbedder
from openviking.models.embedder.volcengine_embedders import VolcengineD... | 105 | 3,649 |
OpenViking | tests/models/test_openai_rerank.py | .py | """Tests for OpenAIRerankClient — DashScope native vs compatible-api protocol.
Regression for #3459: OpenAIRerankClient was incompatible with DashScope's
native API (gte-rerank-v2, qwen3-vl-rerank) which uses a nested
input/output envelope. The fix detects the protocol by URL path:
- ``/api/v1/services/rerank`` → nat... | 328 | 12,174 |
OpenViking | tests/models/vlm/test_volcengine_media.py | .py | # Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
from types import SimpleNamespace
from unittest.mock import AsyncMock
import pytest
from openviking.models.vlm.backends.volcengine_vlm import VolcEngineVLM
def _response(text: str):
return SimpleNamespace(
... | 156 | 5,042 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.