Cedana
Cedana Daemon
Cedana
Cedana Daemon
  • Cedana Daemon
  • Get started
    • Installation
    • Authentication
    • Configuration
    • Health checks
    • Plugins
    • Feature matrix
  • Guides
    • Managed process/container
    • Checkpoint/restore basics
    • Checkpoint/restore with GPUs
    • Checkpoint/restore runc
    • Checkpoint/restore containerd
    • Checkpoint/restore streamer
    • Checkpoint/restore kata
      • how-to-create-custom-busybox-image
      • how-to-install-criu-in-guest
      • how-to-install-on-aws
      • how-to-make-kernel-criu-compatible
      • how-to-make-rootfs-criu-compatible
      • Checkpoint/Restore kata containers
  • Developer guides
    • Architecture
    • Profiling
    • Testing
    • Writing plugins
  • References
    • CLI
      • cedana
      • cedana attach
      • cedana checkpoint
      • cedana checkpoints
      • cedana completion
      • cedana completion bash
      • cedana completion fish
      • cedana completion powershell
      • cedana completion zsh
      • cedana daemon
      • cedana daemon check
      • cedana daemon start
      • cedana delete
      • cedana dump
      • cedana dump containerd
      • cedana dump job
      • cedana dump process
      • cedana dump runc
      • cedana exec
      • cedana features
      • cedana inspect
      • cedana job
      • cedana job attach
      • cedana job checkpoint
      • cedana job checkpoint inspect
      • cedana job checkpoint list
      • cedana job checkpoints
      • cedana job delete
      • cedana job inspect
      • cedana job kill
      • cedana job list
      • cedana jobs
      • cedana k8s-helper
      • cedana k8s-helper destroy
      • cedana kill
      • cedana manage
      • cedana manage containerd
      • cedana manage process
      • cedana manage runc
      • cedana plugin
      • cedana plugin features
      • cedana plugin install
      • cedana plugin list
      • cedana plugin remove
      • cedana plugins
      • cedana ps
      • cedana query
      • cedana query k8s
      • cedana query runc
      • cedana restore
      • cedana restore job
      • cedana restore process
      • cedana restore runc
      • cedana run
      • cedana run containerd
      • cedana run process
      • cedana run runc
    • API
    • GitHub
Powered by GitBook
On this page
  • CLI
  • GPU tests
  • Filtering tests
  • Test modes

Was this helpful?

Edit on GitHub
  1. Developer guides

Testing

Tests are configured to run inside a Docker container, ridding the need for tedious setup scripts. This allows for testing locally, during development, without affecting the environment.

The test directory looks like this:

test
├── regression
│   ├── basic.bats
│   ├── cr.bats
│   ├── run.bats
│   ├── manage.bats
│   ├── profiling.bats
│   ├── plugins
│   │   ├── containerd.bats
│   │   ├── crio.bats
│   │   ├── gpu.bats
│   │   ├── gpu_runc.bats
│   │   ├── gpu_streamer.bats
│   │   ├── streamer.bats
│   │   ├── streamer_runc.bats
│   │   └── runc.bats
│   ├── helpers
│   │   └── ...
└── workloads

Tests are grouped by functionality, and each plugin has its own test file.

CLI

Running make help you'll see the following test commands:

Testing
  test                      Run all tests (PARALLELISM=<n>, GPU=[0|1], TAGS=<tags>)
  test-unit                 Run unit tests (with benchmarks)
  test-regression           Run all regression tests (PARALLELISM=<n>, GPU=[0|1], TAGS=<tags>)
  test-enter                Enter the test environment
  test-enter-cuda           Enter the test environment (CUDA)

When running any of the test commands locally, the tests are automatically run inside a Docker container using cedana/cedana-test:latest or cedana/cedana-test:cuda if GPU=1. The CI is also configured to use these Docker images.

GPU tests

Use GPU=1 to run in a CUDA container. If GPU=0, any tests that require GPU-support will automatically be skipped. You may want to specify a low PARALLELISM value when running GPU tests, as each test requires a significant amount of RAM.

Filtering tests

Use TAGS to filter tests by tags. For example, make test-regression TAGS=runc will run all tests tagged with runc. make test-regression TAGS=runc,gpu will run all tests tagged with runc and gpu. If gpu tag is included, you must set GPU=1 to run the tests, otherwise they will be skipped.

Test modes

Each test command above runs the test file two times, in different modes:

  1. Unique daemon & DB instance for each test.

  2. Single persistent daemon & DB instance across a test file.

This is to allow catching bugs that may arise due to the daemon's state being persisted across tests.

Each test command is also configured to run parallel-y, configured by the PARALLELISM variable passed to the test command. E.g. make test-regression PARALLELISM=4 will run at most 4 tests in parallel at a time.

For mode 1, parallelism offers no benefits apart from fast execution time, as each test is completely isolated. However, for mode 2, parallelism may shed light on bugs in the daemon when it's handling multiple requests concurrently.

PreviousProfilingNextWriting plugins

Last updated 1 month ago

Was this helpful?