📚 Re-added wiki as a proper Git submodule

This commit is contained in:
2025-08-04 18:39:29 -07:00
parent 0a7387447c
commit ed85fba609
9 changed files with 120 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "video-pipeline.wiki"]
path = video-pipeline.wiki
url = https://github.com/LCS-Gramps/video-pipeline.wiki.git

0
tests/__init__.py Normal file
View File

20
tests/conftest.py Normal file
View File

@ -0,0 +1,20 @@
# tests/conftest.py
"""
Shared pytest fixtures and constants for testing the LCS video pipeline.
"""
import pytest
from pathlib import Path
@pytest.fixture(scope="session")
def test_session_path() -> Path:
"""
Fixture providing the fixed test session directory.
NOTE: This directory must exist and be preserved. It contains test clips
and notes.json used by multiple tests.
Returns:
Path: Absolute path to test session folder.
"""
return Path("Z:/LCS/Videos/eklipse/2025.07.25.9")

44
tests/sync_wiki.py Normal file
View File

@ -0,0 +1,44 @@
#!/usr/bin/env python3
"""
sync_wiki.py
Synchronizes local markdown files in docs/wiki/ to the GitHub wiki
for the Llama Chile Shop video pipeline project.
Requires the GitHub wiki repo to be cloned into ./video-pipeline.wiki/.
Author: gramps@llamachile.shop
"""
import os
import shutil
import subprocess
from pathlib import Path
print("🧠 THIS IS THE CORRECT sync_wiki.py")
# Correct paths for wiki sync
LOCAL_WIKI_SOURCE = Path("docs/wiki")
LOCAL_WIKI_REPO = Path("video-pipeline.wiki")
print("🔍 Executing: sync_wiki.py from", __file__)
def sync_wiki():
if not LOCAL_WIKI_REPO.exists():
print("❌ Wiki repo not found. Clone it using:")
print(" git clone https://github.com/LCS-Gramps/video-pipeline.wiki.git")
return
# Copy .md files to the local wiki repo
for md_file in LOCAL_WIKI_SOURCE.glob("*.md"):
target = LOCAL_WIKI_REPO / md_file.name
shutil.copy2(md_file, target)
print(f"✅ Synced: {md_file.name}")
# Commit and push changes
os.chdir(LOCAL_WIKI_REPO)
subprocess.run(["git", "add", "."], check=True)
subprocess.run(["git", "commit", "-m", "📚 Sync updated wiki pages from docs/wiki"], check=True)
subprocess.run(["git", "push"], check=True)
print("🚀 Wiki updated successfully.")
if __name__ == "__main__":
sync_wiki()

View File

View File

@ -0,0 +1,52 @@
# tests/test_metadata_utils.py
"""
Unit tests for metadata parsing and archiving functions.
"""
from modules.metadata_utils import derive_session_metadata, save_metadata_record
from pathlib import Path
import json
def test_derive_session_metadata_structure(test_session_path):
"""
Validates that metadata is parsed correctly and includes expected keys.
"""
metadata = derive_session_metadata(test_session_path)
assert "session_date" in metadata
assert "clips" in metadata
assert isinstance(metadata["clips"], list)
assert len(metadata["clips"]) > 0, "Expected at least one clip in metadata"
for clip in metadata["clips"]:
assert "stem" in clip
assert "highlight" in clip or "notes" in clip
assert clip["format"] in ("wide", "vertical")
def test_save_metadata_record_creates_file(tmp_path):
"""
Ensures metadata is saved to a properly named JSON file.
"""
fake_record = {
"session_date": "2025-07-25",
"stem": "test-clip",
"youtube_urls": ["https://youtu.be/test123"],
"peertube_urls": [],
}
# Override history dir to a temp path
from modules import metadata_utils
metadata_utils.HISTORY_DIR = tmp_path
save_metadata_record(fake_record)
expected_dir = tmp_path / "2025.07.25"
expected_file = expected_dir / "test-clip.json"
assert expected_file.exists(), f"Expected {expected_file} to be created"
with expected_file.open("r", encoding="utf-8") as f:
data = json.load(f)
assert data["youtube_urls"][0] == "https://youtu.be/test123"

View File

0
tests/test_yt_poster.py Normal file
View File

1
video-pipeline.wiki Submodule

Submodule video-pipeline.wiki added at 1ec269c8ef