Commit graph

13 commits

Author SHA1 Message Date
Dennis Kempin
f48639f3fe Automatically register tools/ on PATH
Developers with `direnv` installed will have ./tools added to their
PATH automatically. Also adds it to the PATH in the dev container.

This reduces `tools/dev_container tools/presubmit` to
`dev_container presubmit`.

Note: Does not rebuild the container, the change can be picked
up at a later time.

BUG=None
TEST=cd crosvm

Change-Id: Ia57bd7bb1cf86df2b32d624d97a74518e8b5f423
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4305345
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-03-03 00:33:15 +00:00
Dennis Kempin
abcfc67d8b Add python configs for consistency between IDE and CI
Also adds settings to .vscode/settings.json to use the correct
formatter and type checking settings out of the box.

VSCode uses pyright and health-check uses mypy. They do not always
agree unfortunately, mypy  is a little more lenient.
Unfortunately pyright is hard to get working with our scripts that
have no file extension.

BUG=b:242605601
TEST=./tools/health-check

Change-Id: Iaef4ac6f61613e7dda409d5e717102ea9adefe82
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3833699
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-08-16 18:33:23 +00:00
Dennis Kempin
3ec91c4653 Add Cargo.lock files to version control again
We originally removed it because we had frequent merge conflicts
and all downstream projects were doing their own pinning already.
We also had CI issues because ChromeOS changes could trigger
Cargo.lock changes in crosvm back then.

The new Cargo.lock format should ease the merge conflicts and we
no longer have issues with external changes triggering changes
in our Cargo.lock. So let's bring it back in.

This will allow us to judge the impact of changing third party
dependencies and gives us a chance to implement a special
review process.

BUG=b:240435583
TEST=CQ

Change-Id: Ie53e5616cc98d7e50a84f3c0a91902dd539f2520
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3795655
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-08-15 19:38:44 +00:00
Dennis Kempin
0948bc8d3a infra: Initial setup of linux pre/post-submit builders
The builders use the existing dev_container to run tests
for the 3 currently supported architectures on linux:
x86_64, aarch64 and armhf.

A new recipe 'build_linux' has been added runs the
dev_container to build and execute tests.

To share code with other upcoming recipes, some of the
recipe code has been extracted into a shared crosvm
module.

Basic tests for the recipes have been added.

BUG=b:233230344
TEST=./recipes.py test run
./recipes.py run build_linux

Change-Id: I17ecb25c0a0eabdce56537831454ac22d4dc7021
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3654196
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-05-24 23:13:13 +00:00
Dennis Kempin
18724772c2 Add test runner ./tools/run_tests
The new runner makes use of the simplified crosvm build and greatly
improves execution speed by gathering test binaries from cargo output
and executes them directly in parallel.

This allows all of our tests to execute in ~5 seconds when run locally.

The new test runner also makes use of the new testvm tools to make it
easy to switch between testing on the host, in a VM or via SSH on a
remote device.

See ./tools/run_tests --help for usage instructions.

To allow more iterative testing with the same test targets, this CL
includes a set_test_target script to write env vars that instruct cargo
to build for the target arch and run on the test target.

Note: The test runner can build for armhf, but we need build file fixed
to allow armhf to build successfully.

BUG=b:199951064
TEST=Inside ./tools/dev_container:
./tools/run_tests --target=host
./tools/run_tests --target=vm:aarch64
./tools/run_tests --aarch=armhf --build-only
./tools/set_test_target vm:aarch64 && source .envrc
cargo test

Change-Id: I60291fa726fb2298f62d1f032e55ed6e7ab1c4ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3221779
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2021-10-15 22:12:03 +00:00
Dennis Kempin
3b7a45792d Remove Cargo.lock from version control
The Cargo.lock file has been source of much annoyance and does not
really serve it's purpose in crosvm anyway. Both Android and ChromeOS
builds will not use Cargo.lock files but use their own infra to pin
dependencies to fixed versions.
Cargo.lock files are only used for development builds, but can cause
frequent merge issues, especially once our hacky 'setup_cros_cargo.sh'
script is involed.

Since we are planning to migrate towards bazel in the not-so-far future,
the easiest short term plan is to just remove Cargo.lock from version
control and deal with potential discrepancies in development builds.

BUG=None
TEST=None

Change-Id: I23736a61a4cc8131888d5ee2c19793066267f608
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3140584
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2021-10-12 19:28:43 +00:00
Alexandre Courbot
a9759cb072 Add .vscode to .gitignore
These folders can be created to store local settings.

BUG=None
TEST=.vscode content does not appear with `git status`

Change-Id: I7b6c1b1bdb93ecbadc6e25b5fe9c9ecdbb4a3f0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2842604
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2021-04-21 06:55:47 +00:00
Dennis Kempin
4d2253b529 Kokoro: Extensive polishing and bugfixing
This CL fixes some of the issues that prevented the
test system from running on other workstations.

- Builders run by Kokoro will not use a scratch mount.
  It's not needed, and will cause issues if stored on
  /tmp with noexec set.
- Running podman with label=disable to prevent selinux
  issues.

The run_tests implementation has been moved to a separate
file and updated with parsing of cargo test output. This
allows simpler test output and integration with the
test results UI in sponge.

The sponge test UI can make it much easier to see which
tests failed, and to find the log of that test case.

This CL also includes an ./ci/kokoro/uprev script to
uprev the manifest versions. And runs the uprev.

BUG=b:174861002
TEST=Tested by forcing a kokoro build with this CL

Change-Id: I0cba9bb68915e2558a4ea6061dd9ba0a7050421b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2669712
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2021-02-10 22:04:43 +00:00
Allen Webb
191444797d data_model: Ad is_empty to fix clippy warning.
warning: item `sys::IoSliceMut<'a>` has a public `len` method but no
corresponding `is_empty` method
  --> /mnt/host/source/src/platform/crosvm/data_model/src/sys.rs:23:1

Also, add .idea to the .gitignore to ignore Intelij projects.

BUG=None
TEST=(cd data_model && cargo clippy)

Change-Id: I3ce0dc49bcb75ac16bc9ae3b6eec8d34f25919c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2616806
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Allen Webb <allenwebb@google.com>
Commit-Queue: Allen Webb <allenwebb@google.com>
2021-01-09 05:31:17 +00:00
Dennis Kempin
831b11e869 Add scripts to run code coverage
One script to run coverage for the whole smoke test suite,
the resulting file can be uploaded to codecov.io for consumption:
https://codecov.io/gh/denniskempin/crosvm

Another script to run tests + coverage for a single crate,
which is useful during development to keep track of coverage
while adding tests (IDEs can display the generated lcov.info file)

BUG=b:171082843
TEST=Manual testing of both scripts

Change-Id: I52384762400a146cb0e7deb3d54dccf59b6134db
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2492914
Reviewed-by: Zach Reizner <zachr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
2020-10-27 05:22:32 +00:00
Dylan Reid
be4a4c97be gitignore: Remove Cargo.lock
Cargo.lock will need to be checked in to ensure reproducible builds.
However continue to ignore Cargo.lock in subdirectories as the main Cargo.lock
shouls dictate the versions of everything.

Change-Id: I448527b3c23bb9de939682ec1a78fd06a2530857
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/538067
Reviewed-by: Zach Reizner <zachr@chromium.org>
2017-06-17 01:12:44 -07:00
Dylan Reid
ee8293fd60 Add editor temp files to .gitignore
Change-Id: Ib15b732192de4d59798501f662b1806bc26ad1c3
Reviewed-on: https://chromium-review.googlesource.com/490907
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2017-05-02 05:20:26 -07:00
Zach Reizner
09a0a32345 kvm-sys: start low-level kvm bindings
These bindings are autogenerated via a manual invocation to bindgen.
Also included are the calculations for ioctl numbers, which bindgen was
not capable of generating. Note that a few of the autogenerated tests
fail currently.

BUG=chromium:711556
TEST=cargo test # note there are 4 failures

Change-Id: I818c5bba1f032aec131459de1346c548148e6612
Reviewed-on: https://chromium-review.googlesource.com/477375
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
2017-04-19 16:30:31 +00:00