microstack/tox.ini
Billy Olsen 3d98e1c437 Move volume tests to experimental pipeline
The volume tests are unreliable and need to be moved to an experimental
pipeline.

Change-Id: I7414fbdee4da57652bcf10840d2d40e35dc5d1d4
2021-04-08 14:28:52 -07:00

144 lines
4.4 KiB
INI

[tox]
envlist = linters, unit, multipass
skipsdist = True
[testenv]
basepython=python3
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
setenv =
PATH = /snap/bin:{env:PATH}
passenv = HOME TERM DISTRO INTERACTIVE_DEBUG USER SNAP_FILE http_proxy https_proxy HTTP_PROXY HTTPS_PROXY NO_PROXY
whitelist_externals =
sudo
/snap/bin/snapcraft
bash
commands =
{toxinidir}/tools/basic_setup.sh
flake8 {toxinidir}/tests/
bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_basic.py"
[testenv:snap]
# Testing environment for the gerrit gate. Named 'snap' to conform to
# the requirements of the snap friendly job that we inherit from in
# .zuul.yaml.
commands =
{toxinidir}/tools/lxd_build.sh
flake8 {toxinidir}/tests/
# Specify tests in sequence, as they can't run in parallel if not
# using multipass.
bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_basic.py"
bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_cluster.py"
[testenv:snap-lvm]
commands =
{toxinidir}/tools/lxd_build.sh
flake8 {toxinidir}/tests/
bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_basic.py --use-lvm"
[testenv:snap-try]
# Testing environment for local debugging. Mounts rw snap from squashfs-root dir.
commands =
{toxinidir}/tools/lxd_build.sh
flake8 {toxinidir}/tests/
# Specify tests in sequence, as they can't run in parallel if not
# using multipass.
bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_basic.py --snap-try"
bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_cluster.py --snap-try"
[testenv:snap-try-basic]
# Testing environment for local debugging. Mounts rw snap from squashfs-root dir.
commands =
{toxinidir}/tools/lxd_build.sh
flake8 {toxinidir}/tests/
bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_basic.py --snap-try"
[testenv:snap-try-cluster]
# Testing environment for local debugging. Mounts rw snap from squashfs-root dir.
commands =
{toxinidir}/tools/lxd_build.sh
flake8 {toxinidir}/tests/
bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_cluster.py --snap-try"
[testenv:multipass]
# Default testing environment for a human operated machine. Builds the
# snap in a multipass instance, then runs tests in a separate multipass
# instance. This makes the fewest changes to your personal computer,
# but is heavier on system requirements. For a more lightweight test,
# use the "snap" environment above. Beware that you will wind up with
# a lot of things installed, including potentially the locally built
# version of MicroStack!
setenv =
MULTIPASS=true
commands =
{toxinidir}/tools/multipass_build.sh
flake8 {toxinidir}/tests/
bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_basic.py"
[testenv:basic]
# Run basic tests, with default distro.
setenv =
MULTIPASS=true
[testenv:refresh]
# Verify that we can refresh MicroStack
setenv =
MULTIPASS=true
commands =
{toxinidir}/tools/basic_setup.sh
flake8 {toxinidir}/tests/
{toxinidir}/tests/test_refresh.py
[testenv:xenial]
# Run basic tests, under xenial.
setenv =
MULTIPASS=true
DISTRO=xenial
[testenv:disco]
# Run basic tests, under disco.
setenv =
MULTIPASS=true
DISTRO=disco
[testenv:eoan]
# Run basic tests, under eoan.
setenv =
MULTIPASS=true
DISTRO=eoan
[testenv:cluster]
# Test out clustering!
# Requires multipass.
setenv =
MULTIPASS=true
commands =
{toxinidir}/tools/basic_setup.sh
flake8 {toxinidir}/tests/
bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_cluster.py"
[testenv:build]
# Just build the snap, using multipass.
setenv =
MULTIPASS=true
commands =
{toxinidir}/tools/multipass_build.sh
[testenv:linters]
commands =
flake8 {toxinidir}/tests/
flake8 {toxinidir}/tools/
flake8 {toxinidir}/tools/init/init/
flake8 {toxinidir}/tools/launch/launch/
flake8 {toxinidir}/tools/cluster/cluster/
[testenv:unit]
deps = -r{toxinidir}/tools/init/test-requirements.txt
-r{toxinidir}/tools/init/requirements.txt
commands =
stestr run --top-dir=./tools/init/ --test-path=./tools/init/tests/ {posargs}