-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from commit-0/docs3
Updates to docs
- Loading branch information
Showing
5 changed files
with
91 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
## Distributed Mode | ||
|
||
Commit0 is a command-line tool that allows you to run unit-tests on a | ||
variety of libraries in isolated environments. | ||
|
||
The defaul tool uses [modal](https://modal.com/) as a distributed | ||
test runner. | ||
|
||
```bash | ||
pip install modal | ||
modal token new | ||
``` | ||
|
||
To get started, run the `setup` command with the dataset | ||
split that youare interested in working with. | ||
We'll start with the `lite` split. | ||
|
||
```bash | ||
commit0 setup lite | ||
``` | ||
|
||
This will clone a set of skeleton libraries in your `repos/` directory. | ||
Commiting changes to branches in this directory is how you send changes | ||
to the test runner. | ||
|
||
Next to run tests you can run the standard test command. | ||
This command will run a reference unit test for the `simpy` repo. | ||
|
||
```bash | ||
commit0 test simpy tests/test_event.py::test_succeed --reference | ||
``` | ||
|
||
To run a test in your codebase you can run with no args. | ||
This one will fail. | ||
|
||
```bash | ||
commit0 test simpy tests/test_event.py::test_succeed | ||
``` | ||
|
||
To run a test in your codebase with a specific branch | ||
you can commit to the branch and call with the --branch command. | ||
|
||
|
||
```bash | ||
commit0 test simpy tests/test_event.py::test_succeed --branch my_branch | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## Local Mode | ||
|
||
To run in local mode you first be sure that you have [docker tools](https://docs.docker.com/desktop/install/mac-install/) | ||
installed. On Debian systems: | ||
|
||
```bash | ||
apt install docker | ||
``` | ||
|
||
To get started, run the `setup` command with the dataset | ||
split that you are interested in working with. | ||
We'll start with the `lite` split. | ||
|
||
|
||
```bash | ||
commit0 setup lite | ||
``` | ||
|
||
This will install a clone the code for subset of libraries to your `repos/` directory. | ||
|
||
Next run the `build` command which will configure Docker containers for | ||
each of the libraries with isolated virtual environments. The command uses the | ||
[uv](https://github.com/astral-sh/uv) library for efficient builds. | ||
|
||
```bash | ||
commit0 build | ||
``` | ||
|
||
The main operation you can do with these enviroments is to run tests. | ||
Here we run [a test](https://github.com/commit-0/simpy/blob/master/tests/test_event.py#L11) in the `simpy` library. | ||
|
||
```bash | ||
commit0 test simpy tests/test_event.py::test_succeed | ||
``` | ||
|
||
See [distributed setup](setupdist) for more commands. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters