Commit Graph

47 Commits

Author SHA1 Message Date
Catalin Dumitru
877d1fb680 Update README.md
Updated the instructions with the new commands for the generation
of the dynamic pipeline.

Signed-off-by: Catalin Dumitru <catdum@amazon.com>
2021-08-19 14:17:39 +03:00
Catalin Dumitru
b47488a9b9 Autogenerate pipeline fron json config file
Instead of having a static pipeline.yml, autogenerate it from a JSON
configuration file. The json approach is taken because we also want to
be able to run tests locally, and thus the json can be parsed once for
generating the pipeline, and once for generating a local test run.

Signed-off-by: Catalin Dumitru <catdum@amazon.com>
2021-08-19 14:17:39 +03:00
Catalin Dumitru
a00c7d2f1b Update the pipeline steps that run the tests
In the other crates, the tests reside in rust-vmm-ci/intergation_tests.
When we test the CI itself, the tests reside in integration_tests.
Therefore we needed to make the command find the tests independently of
the crate it is run from.

Signed-off-by: Catalin Dumitru <catdum@amazon.com>
2021-08-02 17:39:26 +03:00
Catalin Dumitru
0b9d283cff Create local rust crate and update config path
In order to be able to run the CI on rust-vmm-ci we needed to
make it a rust crate. Also the path to the coverage config
file needed to be updated in test_coverage.py so that the path
does not depend on the crate; a breadth-first search was used
to guarantee that the config file belongs to the crate that is
being tested.

Signed-off-by: Catalin Dumitru <catdum@amazon.com>
2021-08-02 17:39:26 +03:00
Catalin Dumitru
7693628035 Update commit format test to work locally
Set default values for the remote name and
base branch when the test is run locally and
the Buildkite variables are not available and
the variables BASE_BRANCH and REMOTE are not set.

Signed-off-by: Catalin Dumitru <catdum@amazon.com>
2021-07-21 15:59:49 +03:00
Andreea Florescu
d2ab3c0908 use the latest docker plugin version
This version is needed because there are features (for example passing
devices to a container) that are not available in the old version.

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2021-06-22 16:22:43 +03:00
Keiichi Watanabe
9f7b0d9069 check commit authors for each commit
Although we check commit authors in test_commit_format.py to skip tests
for dependabot's commits, the current code only checks the author of the
head commit.
This PR make it check each commit's author so that we can test branches
where both a dependabot's commit and other commits exist.

Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
2021-06-22 11:18:24 +03:00
Alexandru Agache
6591890ee1 use rust-vmm-container v12
Compared to v11, the new version bumps the Rust toolchain version
from 1.46 to 1.52.1.

Signed-off-by: Alexandru Agache <aagch@amazon.com>
2021-06-14 11:20:58 +03:00
Andreea Florescu
24d66cdae6 update clippy check
We were not testing clippy for all features, the workspace, bins, and
examples.

Partially addresses: https://github.com/rust-vmm/rust-vmm-ci/issues/21

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2021-03-15 18:24:13 +02:00
Andreea Florescu
ebc701641f exclude dependabot from the 50/72 commit rule
When dependabot updates the rust-vmm-ci submodule, the git commit
sumamry is over 50 chars. To be able to merge PR, exclude the dependabot
user from this checks.

Fixes: https://github.com/rust-vmm/rust-vmm-ci/issues/61

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2021-02-23 12:50:55 +02:00
Andreea Florescu
63fdf0f635 update rust-vmm-container
This new version brings new utilities.

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2021-02-18 16:04:05 +02:00
Federico Ponzi
98a26fe4c2 Typo fix in README.md 2021-01-20 09:42:42 +02:00
Laura Loghin
631c82acd3 mount tmp in test pipelines
This is needed for running the integration tests in
vmm-reference. They need access to resources from tmp.

Signed-off-by: Laura Loghin <lauralg@amazon.com>
2021-01-06 14:58:04 +02:00
Laura Loghin
03fcf08e11 don't run commit test for repos specified with git
Until we find a safe way to run the commit format test for
repositories specified with git, we should skip that test
for those repos.
Added a conditional for the corresponding buildkite step
that will run the commit test only if BUILDKITE_REPO
doesn't start with `git@`.

Signed-off-by: Laura Loghin <lauralg@amazon.com>
2020-12-08 12:17:21 +02:00
Andreea Florescu
3b7377cb51 fixed typo in readme
Fixes: https://github.com/rust-vmm/rust-vmm-ci/issues/39

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2020-12-03 16:38:20 +02:00
Andreea Florescu
c9430ee33a add gitignore file
Add pycache to gitignore.

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2020-11-27 11:22:45 +02:00
Alexandra Iordache
e1108f1c90 buildkite: re-enable cargo audit test
Signed-off-by: Alexandra Iordache <aghecen@amazon.com>
2020-10-16 08:53:15 +03:00
Henry Wang
02004b5bd1 Add a flag that saves the coverage output dir
This commit adds a pytest command line option `--no-cleanup` for
the coverage test. Running the coverage test with this option will
let users save the `kcov_output` directory so that it is easier to
inspect the coverage report.

Signed-off-by: Henry Wang <henry.wang@arm.com>
2020-10-15 09:40:21 +03:00
Samuel Ortiz
97025bdb9b buildkite: Skip lines should be shorter than 70 chars
Welcome back to the 80s.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2020-10-14 15:07:41 +03:00
Samuel Ortiz
c83003c634 buildkite: Skip cargo audit check temporarily
Until our container moves to cargo audit v0.12.0.
See https://github.com/RustSec/advisory-db/issues/414#issuecomment-702479926

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2020-10-14 15:00:21 +03:00
Samuel Ortiz
c8cf2b70dc buildkite: Fix audit label indentation
Commit b3acb307f add the cargo-audit label but indentation is wrong,
making it an invalid YAML, at least from buildkite's point of view.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2020-10-14 12:42:13 +03:00
Anthony Riley II
b3acb307f1 Fixes: https://github.com/rust-vmm/rust-vmm-ci/issues/8
Co-authored-by: Laura Loghin <46103760+lauralt@users.noreply.github.com>
Signed-off-by: Anthony Riley II <riley@anth1y.io>
2020-10-09 11:04:02 +03:00
Laura Loghin
bedc32bb14 Add --workspace flag to cargo check too
Without this flag, it looks like not all workspace files
are checked. You can test this by adding for example an
unused import (`use std::clone;`) in
https://github.com/rust-vmm/vmm-reference/pull/11,
file src/vmm/tests/integration_tests.rs. cargo check will
fail only if we pass `--workspace` flag too.
For clippy, this flag doesn't seem to have an obvious
effect, this should be further investigated in #21.

Signed-off-by: Laura Loghin <lauralg@amazon.com>
2020-10-08 15:18:08 +03:00
Laura Loghin
3ea5f2b1f1 improve a bit error messages for commit test
Made the messages for some error cases clearer.

Signed-off-by: Laura Loghin <lauralg@amazon.com>
2020-10-08 15:18:08 +03:00
Laura Loghin
cd90a637a3 Add support for workspace tests
Added `--workspace` flag to `cargo test` commands
because it is needed for workspace crates (an example
would be the vmm-reference).
The coverage test is already run on all tests for
workspaces too.
Fixes: #38.

Signed-off-by: Laura Loghin <lauralg@amazon.com>
2020-10-08 15:18:08 +03:00
Alexandra Iordache
9dd386c2e6 readme update: cosmetic changes
Signed-off-by: Alexandra Iordache <aghecen@amazon.com>
2020-09-25 16:09:21 +03:00
Alexandra Iordache
265df53b5c Coverage test: keep stdin open
Pytest closes stdin by default, so any processes
spawned from it won't have it. As some tests in
various rust-vmm crates might need stdin to be
open, we mock it with a (currently empty) byte
stream, which we can extend in the future.

Signed-off-by: Alexandra Iordache <aghecen@amazon.com>
2020-09-25 09:54:34 +03:00
Laura Loghin
2d3bb056ce add myself to codeowners
Signed-off-by: Laura Loghin <lauralg@amazon.com>
2020-09-24 21:34:22 +03:00
Stefan Hajnoczi
e58ea7445a Fix kcov_ouput_dir typo in test_coverage.py
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-08-15 20:20:09 +03:00
Stefan Hajnoczi
d62d781398 fix buildkite typos in readme
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-08-15 20:20:09 +03:00
Andreea Florescu
0fc8cede37 refactor test_benchmark.py
- Added defines for PR branch, result files
- Updated variables & function names to be more explicit about what
  they do

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2020-07-31 11:08:50 +03:00
Andreea Florescu
741b894e28 checkout to PR branch before finishing test_bench
This cleanup is needed because otherwise all subsequent tests are
going to run on the master branch.

Fixes: https://github.com/rust-vmm/rust-vmm-ci/issues/29

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2020-07-31 11:08:50 +03:00
Andreea Florescu
645a5c3a74 test_bench: don't crash when no bench on master
When there are no benchmarks on the master branch, instead of
crashing first check if the error. Pass the test in case
cargo bench failed due to main bench not being present.

Fixes: https://github.com/rust-vmm/rust-vmm-ci/issues/30

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2020-07-31 11:08:50 +03:00
Laura Loghin
bd32544c00 Fetch origin in benchmark test
Before running `git checkout` on the upstream
master branch, we should also fetch that branch.

Signed-off-by: Laura Loghin <lauralg@amazon.com>
2020-07-29 12:05:33 +03:00
Laura Loghin
35beb918b7 Fix commit message test
The test that was checking the commit message format
was not comparing the PR's HEAD to the right master,
even though `origin` was set to the pipeline repository.
Fixed this by fetching that repo. This way, `FETCH_HEAD`
points to the latest upstream master.

Signed-off-by: Laura Loghin <lauralg@amazon.com>
2020-07-29 12:05:33 +03:00
Alexandra Iordache
53427aa758 benchmarks: add test that can run at every PR
Related to #24

Signed-off-by: Alexandra Iordache <aghecen@amazon.com>
2020-07-23 16:17:32 +03:00
Laura Loghin
abd2c90d9f Add test for commit message format
Added test that checks if commits follow the 50/72 git
commit rule and if they are signed (git commit -s).
Fixes: #9, #14.

Signed-off-by: Laura Loghin <lauralg@amazon.com>
2020-07-23 15:27:39 +03:00
Laura Loghin
fe859f4f75 Update container image to v6
This version adds git, critcmp, cargo-audit and
cargo-license.
Also, the Rust version is updated to 1.44.1.

Signed-off-by: Laura Loghin <lauralg@amazon.com>
2020-07-23 15:27:39 +03:00
Andreea Florescu
75d725459e run cargo check on all features
Warnings should be checked by custom pipelines. The common
pipeline should check warnings on all features instead.

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2020-07-21 11:07:51 +03:00
Andreea Florescu
7e3f307bf0 skip coverage-arm test
Right now this test is super unreliable and pretty much blocks every
other PR. Skip it for now until we fix kcov.

Related to: https://github.com/rust-vmm/rust-vmm-ci/issues/18

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2020-05-18 10:53:15 +03:00
mrxinwang
cd7096e7a6 Enable rust-vmm coverage test in CI
1. Enabled the aarch64 coverage test in `test_coverage` script.

2. Seperated the coverage json sample file to two sample files for
different machine achitectures.

3. Updated Buildkite pipeline container version.

4. Updated README for the description of coverage files and container
version.

Signed-off-by: Henry Wang <henry.wang@arm.com>
2020-02-21 09:56:34 +01:00
Samuel Ortiz
c309d0627b buildkite: Move to the rustvmm/dev v4 container
In order to bump our CI Rust toolchain to 1.39.0.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-12-17 05:19:43 +08:00
Samuel Ortiz
c85a8da325 buildkite: Remove clippy test on aarch64
Because aarch64 is a tier-2 Rust architecture, clippy is not always
available with the latest release. Keeping the clippy tests on arrch64
prevent us from freely moving to newer Rust releases.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2019-12-17 05:19:43 +08:00
Andreea Florescu
bb1cd14d2c use HTTPS when adding rust-vmm-ci as a submodule
If we clone rust-vmm-ci with SSH Buildkite requires an ssh key
when cloning the repository for some reason.

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2019-07-12 13:14:00 +02:00
Andreea Florescu
8b60273cef Run tests with rustvmm/dev:v3
The container now runs Rust 1.35. This is needed as versions 1.34.0
up to 1.34.2 (which is the first one to include a fix) have a security
vulnerability.

For details check the CVE: https://www.cvedetails.com/cve/CVE-2019-12083/

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2019-07-01 10:50:54 +02:00
Andreea Florescu
6c471c6c3a added Buildkite pipeline and integration tests
This pipeline contains the tests that are currently run for
kvm-ioctls. The pipeline also has a step that runs the coverage
test defined in integration_tests/test_coverage.py.

The purpose of this pipeline is to be used by all rust-vmm
repositories to ensure we keep the same quality bar for all crates.

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2019-06-20 18:24:38 +03:00
Andreea Florescu
61554f89d5 Initial commit 2019-05-20 16:58:04 +02:00