Skip to content

Commit

Permalink
install redis on CI
Browse files Browse the repository at this point in the history
separate each backend installation
  • Loading branch information
minrk committed Jan 19, 2024
1 parent 4e791db commit ebf999e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
jobs:
# Run "pytest tests" for various Python versions
pytest:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
# Keep running even if one variation of the job fail
Expand All @@ -45,6 +45,7 @@ jobs:
- python: "3.9"
backend: "consul"
- python: "3.10"
backend: "redis"
- python: "3.11"
steps:
# NOTE: In GitHub workflows, environment variables are set by writing
Expand All @@ -69,21 +70,35 @@ jobs:
python -m jupyterhub_traefik_proxy.install --output=./bin
pip freeze
- name: Install etcd, consul
- name: Install consul
if: matrix.backend == 'consul'
run: |
curl -L https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip > consul.zip
unzip consul.zip -d ./bin consul
- name: Install etcd
if: matrix.backend == 'etcd'
run: |
curl -L https://github.com/etcd-io/etcd/releases/download/v${ETCD_DOWNLOAD_VERSION}/etcd-v${ETCD_DOWNLOAD_VERSION}-linux-amd64.tar.gz > etcd.tar.gz
tar -xzf etcd.tar.gz -C ./bin --strip-components=1 --wildcards '*/etcd*'
- name: Install redis
if: matrix.backend == 'redis'
# from https://redis.io/docs/install/install-redis/install-redis-on-linux/
run: |
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get -y update
sudo apt-get -y install redis
- name: Select tests
run: |
if [[ ! -z "${{ matrix.backend }}" ]]; then
# select backend subset
echo "PYTEST_ADDOPTS=-k ${{ matrix.backend }}" >> "${GITHUB_ENV}"
else
# default: select everything _but_ the etcd/consul backend tests
echo "PYTEST_ADDOPTS=-k 'not etcd and not consul'" >> "${GITHUB_ENV}"
# default: select everything _but_ the KV backend tests
echo "PYTEST_ADDOPTS=-k 'not etcd and not consul and not redis'" >> "${GITHUB_ENV}"
fi
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion performance/run_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ for proxy in $proxies; do
python3 -m performance.check_perf methods --proxy=$proxy --iterations=$iterations --concurrency=$concurrency --routes=$routes --output=./results/${proxy}-methods.csv
done
done

exit 0

# Throughput:

Expand Down

0 comments on commit ebf999e

Please sign in to comment.