Skip to content

Latest commit

 

History

History
67 lines (41 loc) · 1.74 KB

CONTRIBUTING.md

File metadata and controls

67 lines (41 loc) · 1.74 KB

Kitty contribution guidelines

Dependencies

For compiling and running kitty, you will need:

For running tests you will need:

Build and run

Build:

cargo build

Run:

cargo run -- <args for kitty here>

If you want to install your local version of kitty on your computer, you can use:

cargo install --path .

Testing

Environment variables

To run the test suite, you must provide a username and a authentication token for Kattis which will be used to fetch and submit test samples. The test suite expects the following environment variables:

  • KATTIS_TEST_USERNAME: your test account's Kattis username
  • KATTIS_TEST_TOKEN: your test account's Kattis authentication token

You can do this in two ways:

  1. Set the environment variables in your shell
  2. Create a .env file in the project root that looks like the below. The test suite will load it if present.
    KATTIS_TEST_USERNAME=<insert username>
    KATTIS_TEST_TOKEN=<insert token>

Run tests

To run tests:

make test

If you don't have make (maybe you're on Windows), just look inside the Makefile and run the commands directly.

The test recipe builds a Docker image in which it installs kitty from your local version of the project, and then it runs cargo test. The tests will each run in their own Docker container to fully sandbox them.

Please note that if you change kitty's source code (anything inside src), you have to rebuild the Docker image. make test does this for you.

Linting

All source code is formatted with rustfmt and linted with clippy. If you make a pull request, checks for these will be run automatically.