From cf571fa968e56d6299f29d8ff42690129c3669ac Mon Sep 17 00:00:00 2001 From: Jordan Karaze Date: Mon, 28 Mar 2022 15:19:21 -0500 Subject: [PATCH] added make help for cri integration Signed-off-by: Jordan Karaze --- BUILDING.md | 1 + Makefile | 2 +- docs/cri/testing.md | 11 ++++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 5310924ce..e92a95d4c 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -237,6 +237,7 @@ During the automated CI the unit tests and integration tests are run as part of - `make test`: run all non-integration tests that do not require `root` privileges - `make root-test`: run all non-integration tests which require `root` - `make integration`: run all tests, including integration tests and those which require `root`. `TESTFLAGS_PARALLEL` can be used to control parallelism. For example, `TESTFLAGS_PARALLEL=1 make integration` will lead a non-parallel execution. The default value of `TESTFLAGS_PARALLEL` is **8**. + - `make cri-integration`: [CRI Integration Tests](https://github.com/containerd/containerd/blob/main/docs/cri/testing.md#cri-integration-test) run cri integration tests To execute a specific test or set of tests you can use the `go test` capabilities without using the `Makefile` targets. The following examples show how to specify a test diff --git a/Makefile b/Makefile index 5791d8fa2..f3ae858b0 100644 --- a/Makefile +++ b/Makefile @@ -209,7 +209,7 @@ bin/cri-integration.test: @echo "$(WHALE) $@" @$(GO) test -c ./integration -o bin/cri-integration.test -cri-integration: binaries bin/cri-integration.test ## run cri integration tests +cri-integration: binaries bin/cri-integration.test ## run cri integration tests (example: FOCUS=TestContainerListStats make cri-integration) @echo "$(WHALE) $@" @bash -x ./script/test/cri-integration.sh @rm -rf bin/cri-integration.test diff --git a/docs/cri/testing.md b/docs/cri/testing.md index 678e0b14c..27742da0a 100644 --- a/docs/cri/testing.md +++ b/docs/cri/testing.md @@ -8,10 +8,19 @@ Before sending pull requests you should at least make sure your changes have pas Follow the [building](../../BUILDING.md) instructions. ## CRI Integration Test -* Run CRI integration test: +* Run all CRI integration tests: ```bash make cri-integration ``` +* Run specific CRI integration tests: use the `FOCUS` parameter to specify the test case. +```bash +# run CRI integration tests that match the test string +FOCUS= make cri-integration +``` +Example: +```bash +FOCUS=TestContainerListStats make cri-integration +``` ## CRI Validation Test [CRI validation test](https://github.com/kubernetes-sigs/cri-tools/blob/master/docs/validation.md) is a test framework for validating that a Container Runtime Interface (CRI) implementation such as containerd with the `cri` plugin meets all the requirements necessary to manage pod sandboxes, containers, images etc.