|
1 | 1 | # vdev |
2 | 2 |
|
3 | | ------ |
| 3 | +--- |
4 | 4 |
|
5 | | -This is the command line tooling for Vector development. |
| 5 | +The V(ector) Dev(elopment) tool. |
| 6 | + |
| 7 | +This is the command line tooling for Vector development. You don't need to use or install this |
| 8 | +unless you are doing development in the Vector repo. |
6 | 9 |
|
7 | 10 | Table of Contents: |
8 | 11 |
|
| 12 | +- [Pre-requisites](#pre-requisites) |
9 | 13 | - [Installation](#installation) |
10 | | -- [Configuration](#configuration) |
11 | | - - [Repository](#repository) |
12 | | - - [Starship](#starship) |
13 | | -- [CLI](#cli) |
14 | 14 | - [Running Tests](#running-tests) |
| 15 | + - [Running Integration tests](#running-integration-tests) |
| 16 | +- [Developing vdev](#developing-vdev) |
15 | 17 |
|
16 | 18 | ## Pre-requisites |
17 | 19 |
|
18 | 20 | This assumes that you have the following tools installed: |
19 | 21 |
|
20 | | -- cargo-nextest - https://nexte.st/ |
| 22 | +- [git](https://git-scm.com/) |
| 23 | +- [cargo](https://rustup.rs/) |
| 24 | +- [docker](https://www.docker.com/) |
| 25 | +- [npm](https://www.npmjs.com/) |
| 26 | +- [ruby](https://www.ruby-lang.org/en/) |
| 27 | + |
| 28 | +Some other tools may need to be installed depending on the command you are running. All other |
| 29 | +dependencies can be installed by running |
| 30 | + |
| 31 | +```sh |
| 32 | +./scripts/environment/prepare.sh |
| 33 | +``` |
21 | 34 |
|
22 | 35 | ## Installation |
23 | 36 |
|
| 37 | +Note that installation is not required, since `cargo vdev` commands will invoke vdev from within the |
| 38 | +repository. |
| 39 | + |
24 | 40 | Run the following command from the root of the Vector repository: |
25 | 41 |
|
26 | | -```text |
| 42 | +```sh |
27 | 43 | cargo install -f --path vdev |
28 | 44 | ``` |
29 | 45 |
|
30 | | -## Configuration |
31 | | - |
32 | | -### Repository |
| 46 | +You can also install vdev from [crates.io](https://crates.io/crates/vdev) |
33 | 47 |
|
34 | | -Setting the path to the repository explicitly allows the application to be used at any time no matter the current working directory. |
35 | | - |
36 | | -```text |
37 | | -vdev config set repo . |
| 48 | +```sh |
| 49 | +cargo install vdev |
38 | 50 | ``` |
39 | 51 |
|
40 | | -To test, enter your home directory and then run: |
| 52 | +Or using [binstall](https://github.com/cargo-bins/cargo-binstall), which will download a |
| 53 | +pre-compiled binary (fastest) |
41 | 54 |
|
42 | | -```text |
43 | | -vdev exec ls |
| 55 | +```sh |
| 56 | +cargo binstall vdev |
44 | 57 | ``` |
45 | 58 |
|
46 | | -### Starship |
47 | | - |
48 | | -A custom command for the [Starship](https://starship.rs) prompt is available. |
49 | 59 |
|
50 | | -```toml |
51 | | -format = """ |
52 | | -... |
53 | | -${custom.vdev}\ |
54 | | -... |
55 | | -$line_break\ |
56 | | -... |
57 | | -$character""" |
| 60 | +## Running Tests |
58 | 61 |
|
59 | | -# <clipped> |
| 62 | +Unit tests can be run by calling `make test`. |
60 | 63 |
|
61 | | -[custom.vdev] |
62 | | -command = "vdev meta starship" |
63 | | -when = true |
64 | | -# Windows |
65 | | -# shell = ["cmd", "/C"] |
66 | | -# Other |
67 | | -# shell = ["sh", "--norc"] |
68 | | -``` |
| 64 | +### Running Integration tests |
69 | 65 |
|
70 | | -## CLI |
| 66 | +Integration tests require docker or podman to run. |
71 | 67 |
|
72 | | -The CLI uses [Clap](https://github.com/clap-rs/clap) with the `derive` construction mechanism and is stored in the [commands](src/commands) directory. |
| 68 | +Integration tests are not run by default when running `make test`. Instead, they are accessible via the integration subcommand `cargo vdev int` (example: `cargo vdev int test aws` runs aws-related integration tests). |
73 | 69 |
|
74 | | -Every command group/namespace has its own directory with a `cli` module, including the root `vdev` command group. All commands have an `exec` method that provides the actual implementation, which in the case of command groups will be calling sub-commands. |
| 70 | +You should use `./scripts/run-integration-test.sh`, which is the wrapper used by CI and which suits most development needs. Integration tests require a `cargo vdev int start`, `cargo vdev int test`, and `cargo vdev int stop`, which the script handles automatically. You can find the list of available integration tests using `cargo vdev int show`. |
75 | 71 |
|
76 | 72 |
|
77 | | -## Running Tests |
| 73 | +## Developing vdev |
78 | 74 |
|
79 | | -Unit tests can be run by calling `cargo vdev test`. |
| 75 | +The CLI uses [Clap](https://github.com/clap-rs/clap) with the `derive` construction mechanism and is stored in the [commands](src/commands) directory. |
80 | 76 |
|
81 | | -Integration tests are not run by default when running `cargo vdev test`. Instead, they are accessible via the integration subcommand (example: `cargo vdev int test aws` runs aws-related integration tests). You can find the list of available integration tests using `cargo vdev int show`. Integration tests require docker or podman to run. |
| 77 | +Every command group/namespace has its own directory with a `cli` module, including the root `vdev` command group. All commands have an `exec` method that provides the actual implementation, which in the case of command groups will be calling sub-commands. |
0 commit comments