Skip to content

Commit caeafa0

Browse files
authored
Merge pull request #18 from commit-0/get_test_ids
Added get test id feature
2 parents 60c96bc + 8f906d8 commit caeafa0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+23
-1
lines changed

.github/workflows/system.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@ jobs:
2222
run: uv run commit0 clone simpy
2323
- name: Setup
2424
run: uv run commit0 build simpy
25+
- name: Get tests
26+
run: uv run commit0 get-tests simpy
2527
- name: Test
2628
run: uv run commit0 test-reference simpy tests/test_event.py::test_succeed

commit0/__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import commit0.harness.run_pytest_ids
2+
import commit0.harness.get_pytest_ids
23
import commit0.harness.build
34
import commit0.harness.setup
45
import copy
@@ -50,6 +51,9 @@ def main() -> None:
5051
config.repo_split,
5152
config.num_workers,
5253
)
54+
elif command == "get-tests":
55+
repo = sys.argv[2]
56+
commit0.harness.get_pytest_ids.main(repo)
5357
elif command == "test" or command == "test-reference":
5458
repo = sys.argv[2]
5559
test_ids = sys.argv[3]

commit0/data/test_ids/attrs.tar.bz2

7.87 KB
Binary file not shown.

commit0/data/test_ids/babel.tar.bz2

17.3 KB
Binary file not shown.
5.46 KB
Binary file not shown.
1.08 KB
Binary file not shown.

commit0/data/test_ids/chardet.tar.bz2

3.16 KB
Binary file not shown.

commit0/data/test_ids/click.tar.bz2

5.24 KB
Binary file not shown.
4.38 KB
Binary file not shown.
1.14 KB
Binary file not shown.
8.64 KB
Binary file not shown.

commit0/data/test_ids/dulwich.tar.bz2

10 KB
Binary file not shown.

commit0/data/test_ids/fabric.tar.bz2

4.81 KB
Binary file not shown.

commit0/data/test_ids/fastapi.tar.bz2

9.18 KB
Binary file not shown.
3.45 KB
Binary file not shown.

commit0/data/test_ids/flask.tar.bz2

3.86 KB
Binary file not shown.
13.6 KB
Binary file not shown.
4.03 KB
Binary file not shown.
2.55 KB
Binary file not shown.
Binary file not shown.

commit0/data/test_ids/jedi.tar.bz2

18.9 KB
Binary file not shown.

commit0/data/test_ids/jinja.tar.bz2

6.14 KB
Binary file not shown.

commit0/data/test_ids/joblib.tar.bz2

7.31 KB
Binary file not shown.

commit0/data/test_ids/loguru.tar.bz2

10.7 KB
Binary file not shown.
8.55 KB
Binary file not shown.

commit0/data/test_ids/mimesis.tar.bz2

19.7 KB
Binary file not shown.
1.01 KB
Binary file not shown.
4.35 KB
Binary file not shown.

commit0/data/test_ids/moviepy.tar.bz2

1.06 KB
Binary file not shown.
31.8 KB
Binary file not shown.
5.71 KB
Binary file not shown.

commit0/data/test_ids/parsel.tar.bz2

2.12 KB
Binary file not shown.

commit0/data/test_ids/pexpect.tar.bz2

2.21 KB
Binary file not shown.
487 Bytes
Binary file not shown.

commit0/data/test_ids/pyboy.tar.bz2

1.81 KB
Binary file not shown.
33.9 KB
Binary file not shown.

commit0/data/test_ids/pyjwt.tar.bz2

2.58 KB
Binary file not shown.

commit0/data/test_ids/pylint.tar.bz2

15.7 KB
Binary file not shown.

commit0/data/test_ids/pypdf.tar.bz2

9.09 KB
Binary file not shown.

commit0/data/test_ids/pytest.tar.bz2

30 KB
Binary file not shown.
3.03 KB
Binary file not shown.
Binary file not shown.
1.11 KB
Binary file not shown.
6.72 KB
Binary file not shown.

commit0/data/test_ids/scrapy.tar.bz2

17.9 KB
Binary file not shown.

commit0/data/test_ids/seaborn.tar.bz2

12.7 KB
Binary file not shown.

commit0/data/test_ids/simpy.tar.bz2

1.26 KB
Binary file not shown.

commit0/data/test_ids/sphinx.tar.bz2

19.1 KB
Binary file not shown.
3.99 KB
Binary file not shown.
68.7 KB
Binary file not shown.

commit0/data/test_ids/tinydb.tar.bz2

1.23 KB
Binary file not shown.
10.8 KB
Binary file not shown.

commit0/data/test_ids/tornado.tar.bz2

8.75 KB
Binary file not shown.
2.68 KB
Binary file not shown.
1.32 KB
Binary file not shown.

commit0/data/test_ids/wcwidth.tar.bz2

523 Bytes
Binary file not shown.

commit0/data/test_ids/web3-py.tar.bz2

401 KB
Binary file not shown.

commit0/data/test_ids/xarray.tar.bz2

61.4 KB
Binary file not shown.

commit0/harness/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class RepoInstance(TypedDict):
2626
EVAL_BACKENDS = ["local", "modal"]
2727

2828
# available commands
29-
COMMANDS = ["clone", "build", "test", "test-reference"]
29+
COMMANDS = ["clone", "build", "test", "test-reference", "get-tests"]
3030
# repo splits
3131
SPLIT_MINITORCH = ["minitorch"]
3232
SPLIT_SIMPY = ["simpy"]

commit0/harness/get_pytest_ids.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import tarfile
2+
3+
4+
def main(repo: str) -> None:
5+
repo = repo.lower()
6+
repo = repo.replace(".", "-")
7+
with tarfile.open(f"commit0/data/test_ids/{repo}.tar.bz2", "r:bz2") as tar:
8+
for member in tar.getmembers():
9+
if member.isfile():
10+
file = tar.extractfile(member)
11+
if file:
12+
content = file.read()
13+
print(content.decode("utf-8"))
14+
15+
16+
__all__ = []

0 commit comments

Comments
 (0)