personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'hopper-ygzcb3t5-git-tracked-fixtures'

# Conflicts:
# tests/test_call.py
# tests/test_dream_full.py
# tests/test_init.py
# tests/test_journal_index.py
# tests/test_password.py
# tests/test_validate_key.py

+35 -2
+33
tests/conftest.py
··· 16 16 from think.utils import now_ms 17 17 18 18 19 + def copytree_tracked(src, dst): 20 + """Copy only git-tracked files from src to dst.""" 21 + src = Path(src) 22 + dst = Path(dst) 23 + result = subprocess.run( 24 + ["git", "ls-files"], 25 + cwd=src, 26 + capture_output=True, 27 + text=True, 28 + check=True, 29 + ) 30 + for rel in result.stdout.splitlines(): 31 + if not rel: 32 + continue 33 + src_path = src / rel 34 + dst_path = dst / rel 35 + dst_path.parent.mkdir(parents=True, exist_ok=True) 36 + if src_path.is_symlink(): 37 + os.symlink(os.readlink(src_path), dst_path) 38 + else: 39 + shutil.copy2(src_path, dst_path) 40 + 41 + 19 42 @pytest.fixture(autouse=True) 20 43 def set_test_journal_path(request, monkeypatch): 21 44 """Set _SOLSTONE_JOURNAL_OVERRIDE to tests/fixtures/journal for all unit tests. ··· 29 52 30 53 # Set _SOLSTONE_JOURNAL_OVERRIDE to tests/fixtures/journal for all unit tests 31 54 monkeypatch.setenv("_SOLSTONE_JOURNAL_OVERRIDE", "tests/fixtures/journal") 55 + 56 + 57 + @pytest.fixture 58 + def journal_copy(tmp_path, monkeypatch): 59 + """Copy git-tracked fixture files to tmp_path for mutation tests.""" 60 + src = Path(__file__).resolve().parent / "fixtures" / "journal" 61 + dst = tmp_path / "journal" 62 + copytree_tracked(src, dst) 63 + monkeypatch.setenv("_SOLSTONE_JOURNAL_OVERRIDE", str(dst)) 64 + return dst 32 65 33 66 34 67 @pytest.fixture(autouse=True)
+1 -2
tests/test_dream_full.py
··· 51 51 def test_segment_mode_skips_pre_post_phases(journal_copy, monkeypatch): 52 52 """Test that segment mode skips sense and journal-stats.""" 53 53 mod = importlib.import_module("think.dream") 54 - journal = journal_copy 55 54 56 55 # Create segment directory 57 - segment_dir = journal / "20240101" / "default" / "120000_300" 56 + segment_dir = journal_copy / "20240101" / "default" / "120000_300" 58 57 segment_dir.mkdir(parents=True, exist_ok=True) 59 58 60 59 commands_run = []
+1
tests/test_validate_key.py
··· 13 13 import think.providers.google 14 14 import think.providers.openai 15 15 from convey import create_app 16 + from tests.conftest import copytree_tracked 16 17 from think.providers import validate_key 17 18 18 19