Quickstart

New user FAQ

nodev-starter-kit lets you perform test-driven code search queries with pytest-nodev safely and efficiently using docker.

Why do I need special care to run pytest-nodev?

Searching code with pytest-nodev looks very much like running arbitrary callables with random arguments. A lot of functions called with the wrong set of arguments may have unexpected consequences ranging from slightly annoying, think os.mkdir('false'), to utterly catastrophic, think shutil.rmtree('/', True). Serious use of pytest-nodev, in particular using --candidates-from-all, require running the tests with operating-system level isolation, e.g. as a dedicated user or even better inside a dedicated container.

But isn’t it docker overkill? Can’t I just use a dedicated user to run pytest-nodev?

We tried hard to find a simpler setup, but once all the nitty-gritty details are factored in we choose docker as the best trade-off between safety, reproducibility and easiness of use.

Install nodev-starter-kit

To install nodev-starter-kit clone the official repo:

$ git clone https://github.com/nodev-io/nodev-starter-kit.git
$ cd nodev-starter-kit

Advanced GitHub users are suggested to fork the offical repo and clone their fork.

Install docker-engine and docker

In order to run pytest-nodev you need to access a docker-engine server via the docker client, if you don’t have Docker already setup you need to follow the official installation instructions for your platform:

Only on Ubuntu 16.04 you can use the script we provide:

$ bash ./docker-engine-setup.sh

And test your setup with:

$ docker info

Refer to the official Docker documentation for trouble-shooting and additional configurations.

Create the nodev image

The nodev docker image will be your search engine, it needs to be created once and updated every time you want to change the packages installed in the search engine environment.

With an editor fill the requirements.txt file with the packages to be installed in the search engine.

Build the docker image with:

$ docker build -t nodev .

Contributing

Contributions are very welcome. Please see the CONTRIBUTING document for the best way to help. If you encounter any problems, please file an issue along with a detailed description.

Authors:

Sponsors:

  • B-Open Solutions srl

License

nodev-starter-kit is free and open source software distributed under the terms of the MIT license.