Skip to content

Commit

Permalink
docs: explain how to run tests locally (#17783)
Browse files Browse the repository at this point in the history
<!--
**Your PR title must conform to the conventional commit spec!**

  <type>(<scope>)!: <description>

  * `type` = chore, enhancement, feat, fix, docs
  * `!` = OPTIONAL: signals a breaking change
* `scope` = Optional when `type` is "chore" or "docs", available scopes
https://github.com/vectordotdev/vector/blob/master/.github/semantic.yml#L20
  * `description` = short description of the change

Examples:

  * enhancement(file source): Add `sort` option to sort discovered files
  * feat(new source): Initial `statsd` source
  * fix(file source): Fix a bug discovering new files
  * chore(external docs): Clarify `batch_size` option
-->

This PR explains that we use`vdev` for testing and gives instructions
for using vdev to run tests locally.
  • Loading branch information
DominicBurkart authored Jun 28, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent a2a3609 commit 3b67a80
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ Vector team member will find this document useful.
- [Daily tests](#daily-tests)
- [Flakey tests](#flakey-tests)
- [Test harness](#test-harness)
- [Running Tests Locally](#running-tests-locally)
- [Deprecations](#deprecations)
- [Dependencies](#dependencies)
- [Next steps](#next-steps)
@@ -210,6 +211,17 @@ any pull request with:
/test -t <name>
```

### Running Tests Locally

To run tests locally, use [cargo vdev](https://github.com/vectordotdev/vector/blob/master/vdev/README.md).

Unit tests can be run by calling `cargo vdev test`.

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.


### Deprecations

When deprecating functionality in Vector, see [DEPRECATION.md](DEPRECATION.md).
8 changes: 8 additions & 0 deletions vdev/README.md
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ Table of Contents:
- [Repository](#repository)
- [Starship](#starship)
- [CLI](#cli)
- [Running Tests](#running-tests)

## Installation

@@ -65,3 +66,10 @@ when = true
The CLI uses [Clap](https://github.com/clap-rs/clap) with the `derive` construction mechanism and is stored in the [commands](src/commands) directory.

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.


## Running Tests

Unit tests can be run by calling `cargo vdev test`.

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.

0 comments on commit 3b67a80

Please sign in to comment.