Skip to content

Commit 1711fdf

Browse files
authored
Merge pull request #57 from commit-0/docs3
Updates to docs
2 parents 5e897ea + 2b0cc7d commit 1711fdf

File tree

5 files changed

+91
-140
lines changed

5 files changed

+91
-140
lines changed

docs/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ The [commit0 tool](setup) allows you to:
1919
* Distribute testing and development across cloud systems
2020
* Track and log all changes made throughout.
2121

22+
To install run:
23+
24+
```bash
25+
pip install commit0
26+
```
27+
28+
2229
| | Name | Repo | Commit0 | Tests | |
2330
|--|--------|-------|----|----|------|
2431
| <img src='https://avatars.githubusercontent.com/u/69814924?s=280&v=4' width='100px'/> | [minitorch](https://minitorch.github.io/) | [[orig](http://github.com/minitorch/minitorch)] | [[commit0](http://github.com/commit-0/minitorch)] | 230 | <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABkCAQAAADtJZLrAAAAD0lEQVR42mNkYGAcRcQhADxaAGWhD8eHAAAAAElFTkSuQmCC'/> |

docs/setup.md

Lines changed: 0 additions & 139 deletions
This file was deleted.

docs/setupdist.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Distributed Mode
2+
3+
Commit0 is a command-line tool that allows you to run unit-tests on a
4+
variety of libraries in isolated environments.
5+
6+
The defaul tool uses [modal](https://modal.com/) as a distributed
7+
test runner.
8+
9+
```bash
10+
pip install modal
11+
modal token new
12+
```
13+
14+
To get started, run the `setup` command with the dataset
15+
split that youare interested in working with.
16+
We'll start with the `lite` split.
17+
18+
```bash
19+
commit0 setup lite
20+
```
21+
22+
This will clone a set of skeleton libraries in your `repos/` directory.
23+
Commiting changes to branches in this directory is how you send changes
24+
to the test runner.
25+
26+
Next to run tests you can run the standard test command.
27+
This command will run a reference unit test for the `simpy` repo.
28+
29+
```bash
30+
commit0 test simpy tests/test_event.py::test_succeed --reference
31+
```
32+
33+
To run a test in your codebase you can run with no args.
34+
This one will fail.
35+
36+
```bash
37+
commit0 test simpy tests/test_event.py::test_succeed
38+
```
39+
40+
To run a test in your codebase with a specific branch
41+
you can commit to the branch and call with the --branch command.
42+
43+
44+
```bash
45+
commit0 test simpy tests/test_event.py::test_succeed --branch my_branch
46+
```

docs/setuplocal.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Local Mode
2+
3+
To run in local mode you first be sure that you have [docker tools](https://docs.docker.com/desktop/install/mac-install/)
4+
installed. On Debian systems:
5+
6+
```bash
7+
apt install docker
8+
```
9+
10+
To get started, run the `setup` command with the dataset
11+
split that you are interested in working with.
12+
We'll start with the `lite` split.
13+
14+
15+
```bash
16+
commit0 setup lite
17+
```
18+
19+
This will install a clone the code for subset of libraries to your `repos/` directory.
20+
21+
Next run the `build` command which will configure Docker containers for
22+
each of the libraries with isolated virtual environments. The command uses the
23+
[uv](https://github.com/astral-sh/uv) library for efficient builds.
24+
25+
```bash
26+
commit0 build
27+
```
28+
29+
The main operation you can do with these enviroments is to run tests.
30+
Here we run [a test](https://github.com/commit-0/simpy/blob/master/tests/test_event.py#L11) in the `simpy` library.
31+
32+
```bash
33+
commit0 test simpy tests/test_event.py::test_succeed
34+
```
35+
36+
See [distributed setup](setupdist) for more commands.

mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ site_name: ""
33
docs_dir: docs
44
nav:
55
- Home: index.md
6-
- Setup: setup.md
6+
- Distributed: setupdist.md
7+
- Local: setuplocal.md
78
- Extending: repos.md
89
- About: about.md
910
theme:

0 commit comments

Comments
 (0)