Skip to content

test: add integration testing #30

test: add integration testing

test: add integration testing #30

name: Integration Test
on:
pull_request:
jobs:
k8s:
runs-on: ubuntu-latest
strategy:
matrix:
cluster:
- cluster-01
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Kind
uses: helm/[email protected]
with:
install_only: true
- name: Start Kind
run: |
kind create cluster --config integration-test/cluster.yaml
kubectl config set-context --current --namespace=openedx-harmony
sudo echo "127.0.0.1 harmony.test" | sudo tee -a /etc/hosts
- name: Helm dependency add
run: |
helm dependency list charts/harmony-chart 2> /dev/null | tail +2 | awk '{ print "helm" " repo add " $1 " " $3 }' | while read cmd; do $cmd || true; done
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.10.1/cert-manager.crds.yaml --namespace=harmony
- name: Helm dependency build
run: |
helm dependency update charts/harmony-chart
helm dependency build charts/harmony-chart
- name: Helm install
run: |
helm install harmony --namespace openedx-harmony --create-namespace -f integration-test/${{matrix.cluster}}/values.yaml charts/harmony-chart
- name: Setup domain
run: |
kubectl get pods
curl http://localhost/cluster-echo-test
sleep 2
curl http://harmony.test/cluster-echo-test
- name: Logs
run: |
kubectl logs -f --tail 10 deployment/harmony-ingress-nginx-controller
kubectl logs -f --tail 10 deployment/cluster-echo-test
- name: setup python
uses: actions/setup-python@v5
with:
python-version: 3.12
# - name: Install openedx
# run: |
# export INSTALLATIONS=$(ls -d integration-test/${{matrix.cluster}}/*/)
# export CI_ROOT=$(pwd)
# for i in $(ls -d integration-test/cluster-01/*/)
# do
# echo "Running for installation $i"
# cd $i
# export TUTOR_PLUGINS_ROOT=$(pwd)/plugins/ export TUTOR_ROOT=$(pwd)
# python3 -m venv venv && source venv/bin/activate
# pip install -r $TUTOR_ROOT/requirements.txt
# tutor config save
# tutor plugins enable k8s_harmony
# tutor k8s start
# tutor k8s init
# cd $CI_ROOT
# deactivate
# done