mirror of
https://github.com/lancedb/lancedb.git
synced 2026-12-03 07:45:17 +00:00
Refs #4371 The link checker flags `https://docs.lancedb.com/performance#compaction-and-cleanup` because that section no longer exists. Compaction has its own page now, and its "When to run it" section (`#when`) covers the warning this link is attached to: tables with many small fragments. This points `DocLink::Compaction` at `/maintenance/compaction#when` and updates the two tests that hard-code the URL. The anchor exists on the published site and in `docs/web/maintenance/compaction.mdx`, so `test_all_doc_links_resolve_in_repo_docs` still holds. Tests: `python -m unittest ci.tests.test_extract_sdk_doc_links` and `cargo test -p lancedb --lib docs::tests::` pass locally. Co-authored-by: Xuanwo <github@xuanwo.io>
48 lines
1.4 KiB
Python
48 lines
1.4 KiB
Python
# SPDX-License-Identifier: Apache-2.0
|
|
# SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
|
|
from pathlib import Path
|
|
import sys
|
|
from tempfile import TemporaryDirectory
|
|
import unittest
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
|
|
|
|
from ci.extract_sdk_doc_links import extract_doc_links, main
|
|
|
|
|
|
class TestExtractSdkDocLinks(unittest.TestCase):
|
|
def test_extracts_all_links_from_repo_docs_rs(self) -> None:
|
|
urls = extract_doc_links()
|
|
self.assertIn(
|
|
"https://docs.lancedb.com/maintenance/compaction#when",
|
|
urls,
|
|
)
|
|
self.assertIn(
|
|
"https://docs.lancedb.com/indexing/reindexing#incremental-reindexing",
|
|
urls,
|
|
)
|
|
self.assertIn(
|
|
"https://docs.lancedb.com/search/sql",
|
|
urls,
|
|
)
|
|
self.assertIn(
|
|
"https://docs.lancedb.com/basics/embedded-vs-enterprise",
|
|
urls,
|
|
)
|
|
|
|
def test_cli_writes_markdown(self) -> None:
|
|
with TemporaryDirectory() as tmp:
|
|
out = Path(tmp) / "sdk-links.md"
|
|
rc = main(["--output", str(out)])
|
|
self.assertEqual(rc, 0)
|
|
content = out.read_text(encoding="utf-8")
|
|
self.assertIn(
|
|
"<https://docs.lancedb.com/maintenance/compaction#when>",
|
|
content,
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|