Skip to content

Commit f99b155

Browse files
committed
fix trace_repo errors
1 parent b6411d8 commit f99b155

4 files changed

Lines changed: 4 additions & 57 deletions

File tree

tests/conftest.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
MATHLIB4_URL = "https://github.com/leanprover-community/mathlib4"
1010
LEAN4_EXAMPLE_URL = "https://github.com/yangky11/lean4-example"
1111
EXAMPLE_COMMIT_HASH = "e2602e8d4b1d9cf9240f1a20160a47cfc35165b8"
12-
REMOTE_EXAMPLE_URL = "https://gitee.com/rexzong/lean4-example"
1312
URLS = [
1413
MINIF2F_URL,
1514
BATTERIES_URL,
@@ -19,11 +18,6 @@
1918
]
2019

2120

22-
@pytest.fixture(scope="session")
23-
def remote_example_url():
24-
return REMOTE_EXAMPLE_URL
25-
26-
2721
@pytest.fixture(scope="session")
2822
def example_commit_hash():
2923
return EXAMPLE_COMMIT_HASH
@@ -48,26 +42,22 @@ def lean4_example_repo():
4842

4943
@pytest.fixture(scope="session")
5044
def batteries_repo():
51-
commit = get_latest_commit(BATTERIES_URL)
52-
return LeanGitRepo(BATTERIES_URL, commit)
45+
return LeanGitRepo(BATTERIES_URL, "stable")
5346

5447

5548
@pytest.fixture(scope="session")
5649
def mathlib4_repo():
57-
commit = get_latest_commit(MATHLIB4_URL)
58-
return LeanGitRepo(MATHLIB4_URL, commit)
50+
return LeanGitRepo(MATHLIB4_URL, "stable")
5951

6052

6153
@pytest.fixture(scope="session")
6254
def aesop_repo():
63-
commit = get_latest_commit(AESOP_URL)
64-
return LeanGitRepo(AESOP_URL, commit)
55+
return LeanGitRepo(AESOP_URL, "stable")
6556

6657

6758
@pytest.fixture(scope="session", params=URLS)
6859
def traced_repo(request):
6960
url = request.param
70-
commit = get_latest_commit(url)
71-
repo = LeanGitRepo(url, commit)
61+
repo = LeanGitRepo(url, "stable")
7262
traced_repo = trace(repo)
7363
yield traced_repo

tests/data_extraction/test_cache.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,3 @@ def test_local_repo_cache(lean4_example_url, example_commit_hash):
2121
# get the cache
2222
repo_cache_dir = cache.get(rel_cache_dir)
2323
assert repo_cache_dir is not None
24-
25-
26-
def test_remote_repo_cache(remote_example_url):
27-
prefix = "repos"
28-
repo_name = "lean4-example"
29-
with working_directory() as tmp_dir:
30-
repo = Repo.clone_from(remote_example_url, repo_name)
31-
tmp_remote_dir = tmp_dir / repo_name
32-
rel_cache_dir = (
33-
prefix
34-
/ Path(f"gitpython-{repo_name}-{repo.head.commit.hexsha}")
35-
/ repo_name
36-
)
37-
cache.store(tmp_remote_dir, rel_cache_dir)
38-
# get the cache
39-
repo_cache = cache.get(rel_cache_dir)
40-
assert repo_cache is not None

tests/data_extraction/test_trace.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ def test_github_trace(lean4_example_url):
1515
assert path is not None
1616

1717

18-
def test_remote_trace(remote_example_url):
19-
# remote
20-
remote_repo = LeanGitRepo(remote_example_url, "main")
21-
assert remote_repo.repo_type == RepoType.REMOTE
22-
trace_repo = trace(remote_repo)
23-
path = cache.get(remote_repo.get_cache_dirname() / remote_repo.name)
24-
assert path is not None
25-
26-
2718
def test_local_trace(lean4_example_url):
2819
# local
2920
with working_directory() as tmp_dir:

tests/interaction/test_interaction.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,6 @@ def test_github_interact(lean4_example_url):
2626
assert isinstance(final_state, ProofFinished)
2727

2828

29-
def test_remote_interact(remote_example_url):
30-
repo = LeanGitRepo(url=remote_example_url, commit="main")
31-
assert repo.repo_type == RepoType.REMOTE
32-
theorem = Theorem(repo, "Lean4Example.lean", "hello_world")
33-
# initial state
34-
dojo, state_0 = Dojo(theorem).__enter__()
35-
assert state_0.pp == "a b c : Nat\n⊢ a + b + c = a + c + b"
36-
# state after running a tactic
37-
state_1 = dojo.run_tac(state_0, "rw [add_assoc]")
38-
assert state_1.pp == "a b c : Nat\n⊢ a + (b + c) = a + c + b"
39-
# state after running another a sorry tactic
40-
assert dojo.run_tac(state_1, "sorry") == ProofGivenUp()
41-
# finish proof
42-
final_state = dojo.run_tac(state_1, "rw [add_comm b, ←add_assoc]")
43-
assert isinstance(final_state, ProofFinished)
44-
45-
4629
def test_local_interact(lean4_example_url):
4730
# Clone the GitHub repository to the local path
4831
with working_directory() as tmp_dir:

0 commit comments

Comments
 (0)