Skip to content

Commit

Permalink
test: test
Browse files Browse the repository at this point in the history
  • Loading branch information
alisterd51 committed Dec 26, 2023
1 parent 1fdda6b commit 9e1ab79
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 8 deletions.
49 changes: 42 additions & 7 deletions .github/workflows/test_in_kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Python test in k8s cluster
on: pull_request

jobs:
create-cluster:
no-ha-cluster:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -24,10 +24,14 @@ jobs:
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm install my-postgresql bitnami/postgresql --version 13.2.9
helm install my-rabbitmq bitnami/rabbitmq --version 12.5.0
helm install my-redis bitnami/redis --version 18.3.3 --set architecture=standalone
helm install my-postgresql bitnami/postgresql
helm install my-rabbitmq bitnami/rabbitmq
helm install my-redis bitnami/redis --set architecture=standalone
# wait all service is raidy
kubectl --namespace default wait pod/my-postgresql-0 --for=condition=Ready --timeout=2m
kubectl --namespace default wait pod/my-rabbitmq-0 --for=condition=Ready --timeout=2m
kubectl --namespace default wait pod/my-redis-master-0 --for=condition=Ready --timeout=2m
# postgresql
# my-postgresql.default.svc.cluster.local
Expand All @@ -44,7 +48,38 @@ jobs:
# my-redis-master.default.svc.cluster.local
export REDIS_PASSWORD=$(kubectl get secret --namespace default my-redis -o jsonpath="{.data.redis-password}" | base64 -d)
kubectl port-forward --namespace default svc/my-redis-master 6379:6379 &
REDISCLI_AUTH="$REDIS_PASSWORD" redis-cli -h my-redis-master
# test
# Install Charts (in ha mode)
# REDISCLI_AUTH="$REDIS_PASSWORD" redis-cli -h my-redis-master
# test
ha-cluster:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.12.3
- name: Set up Python '3.11'
uses: actions/[email protected]
with:
python-version: '3.11'
- name: Create k8s Kind Cluster
uses: helm/[email protected]
- name: Install Charts (in ha mode)
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm install my-postgresql bitnami/postgresql
helm install my-rabbitmq bitnami/rabbitmq
helm install my-redis bitnami/redis --set sentinel.enabled=true
# wait all service is raidy
kubectl --namespace default wait pod/my-redis-node-0 --for=condition=Ready --timeout=2m
kubectl --namespace default wait pod/my-redis-node-1 --for=condition=Ready --timeout=2m
kubectl --namespace default wait pod/my-redis-node-2 --for=condition=Ready --timeout=2m
# bidule
export REDIS_PASSWORD=$(kubectl get secret --namespace default my-redis -o jsonpath="{.data.redis-password}" | base64 -d)
kubectl port-forward --namespace default svc/my-redis 6379:6379 26379:26379 &
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 120
target-version = ['py37']
target-version = ['py38']
include = '\.pyi?$'
exclude = '''
/(
Expand Down

0 comments on commit 9e1ab79

Please sign in to comment.