Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,21 @@ above when run on a PR will fail iff a newly added dependency has a known open
RustSec advisory. If run outside a PR, it will fail if any existing dependency
has an open RustSec advisory).

### Functional A/B-Tests

Firecracker has some functional A/B-tests (for example, in
`test_vulnerabilities.py`), which generally compare the state of the pull
request target branch (e.g. `main`), with the PR head. However, when running
these locally, pytest does not know anything about potential PRs that the commit
the tests are being run on are contained in, and as such cannot do this
A/B-Test. To run functional A/B-Tests locally, you need to create a "fake" PR
environment by setting the `BUILDKITE_PULL_REQUEST` and
`BUILDKITE_PULL_REQUEST_BASE_BRANCH` environment variables:

```
BUILDKITE_PULL_REQUEST=true BUILDKITE_PULL_REQUEST_BASE_BRANCH=main ./tools/devtool test -- integration_tests/security/test_vulnerabilities.py
```

### Performance A/B-Tests

Firecracker has a special framework for orchestrating long-running A/B-tests
Expand Down
7 changes: 6 additions & 1 deletion tools/devtool
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,12 @@ cmd_test() {
ensure_devctr
ensure_build_dir
ensure_ci_artifacts
[ $do_build != 0 ] && cmd_build --release
if [ $do_build != 0 ]; then
cmd_build --release
if [ -n "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" ]; then
cmd_build --release --rev "$BUILDKITE_PULL_REQUEST_BASE_BRANCH"
fi
fi

apply_linux_61_tweaks

Expand Down
Loading