Add functional test with etcd

Change-Id: I43606301c053c937333ab1454eca5f627682d085
This commit is contained in:
Takashi Kajinami 2024-07-05 11:44:28 +09:00
parent f0fd57a863
commit c62d95d424
6 changed files with 49 additions and 1 deletions

4
.gitignore vendored
View File

@ -66,3 +66,7 @@ env
RELEASENOTES.rst
releasenotes/notes/reno.cache
releasenotes/build
# Generated by etcd
etcd-v*
default.etcd

View File

@ -31,6 +31,14 @@
tox_environment:
PIFPAF_DAEMON: redis
- job:
name: taskflow-functional-etcd
parent: taskflow-functional
vars:
tox_environment:
PIFPAF_DAEMON: etcd
SETUP_ENV_SCRIPT: ./setup-etcd-env.sh
- project:
templates:
- check-requirements
@ -44,7 +52,9 @@
jobs:
- taskflow-tox-py310-with-sqlalchemy-2x
- taskflow-functional-redis
- taskflow-functional-etcd
gate:
jobs:
- taskflow-tox-py310-with-sqlalchemy-2x
- taskflow-functional-redis
- taskflow-functional-etcd

View File

@ -3,3 +3,4 @@ backend_services_map:
redis:
- redis-server
- redis-sentinel
etcd: []

View File

@ -3,3 +3,4 @@ backend_services_map:
redis:
- redis
- redis-sentinel
etcd: []

31
setup-etcd-env.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
set -eux
if [ -z "$(which etcd)" ]; then
ETCD_VERSION=3.3.27
case `uname -s` in
Darwin)
OS=darwin
SUFFIX=zip
;;
Linux)
OS=linux
SUFFIX=tar.gz
;;
*)
echo "Unsupported OS"
exit 1
esac
case `uname -m` in
x86_64)
MACHINE=amd64
;;
*)
echo "Unsupported machine"
exit 1
esac
TARBALL_NAME=etcd-v${ETCD_VERSION}-$OS-$MACHINE
test ! -d "$TARBALL_NAME" && curl -L https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/${TARBALL_NAME}.${SUFFIX} | tar xz
export PATH=$PATH:$TARBALL_NAME
fi
$*

View File

@ -26,9 +26,10 @@ commands =
[testenv:functional]
commands =
find . -type f -name "*.pyc" -delete
pifpaf -e TAKSFLOW_TEST run {env:PIFPAF_DAEMON} {env:PIFPAF_OPTS} -- stestr run
{env:SETUP_ENV_SCRIPT} pifpaf -e TAKSFLOW_TEST run {env:PIFPAF_DAEMON} {env:PIFPAF_OPTS} -- stestr run
allowlist_externals =
find
./setup-etcd-env.sh
[testenv:update-states]
deps =