Merge "Add functional test with etcd"

This commit is contained in:
Zuul 2024-07-08 04:20:51 +00:00 committed by Gerrit Code Review
commit c3ebdc67c8
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

@ -13,6 +13,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
@ -25,6 +33,8 @@
check:
jobs:
- taskflow-functional-redis
- taskflow-functional-etcd
gate:
jobs:
- 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 =