Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add kfp-ui test case in repo level integration tests #253

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
46 changes: 44 additions & 2 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,31 @@ jobs:
uses: canonical/kubeflow-ci/actions/dump-charm-debug-artifacts@main
if: always()

- name: Get juju status
run: juju status
if: failure()

- name: Save relevant debug artifacts
if: always()
run: |
mkdir ~/kfp-operators-debug-logs
juju debug-log --replay | tee ~/kfp-operators-debug-logs/juju-debug-log.log
juju status | tee ~/kfp-operators-debug-logs/juju-status.log
bash -c "cp ~/.local/state/charmcraft/log/* ~/kfp-operators-debug-logs/"
bash -c "df -h | tee ~/kfp-operators-debug-logs/df.log"
bash -c "free -h | tee ~/kfp-operators-debug-logs/free.log"
sg microk8s -c "microk8s.kubectl describe deployments -A | tee ~/kfp-operators-debug-logs/deployments.log"
sg microk8s -c "microk8s.kubectl describe nodes | tee ~/kfp-operators-debug-logs/deployments.log"
sg microk8s -c "microk8s.kubectl describe pods -A | tee ~/kfp-operators-debug-logs/pods.log"
sg microk8s -c "microk8s.kubectl describe workloads -A | tee ~/kfp-operators-debug-logs/workloads.log"

- name: Upload debug artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: kfp-operators-debug-logs
path: ~/kfp-operators-debug-logs

test-bundle:
name: Test the bundle
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -157,6 +182,23 @@ jobs:
run: juju status
if: failure()

- name: Collect charm debug artifacts
uses: canonical/kubeflow-ci/actions/dump-charm-debug-artifacts@main
- name: Save relevant debug artifacts
if: always()
run: |
mkdir ~/kfp-operators-debug-logs
juju debug-log --replay | tee ~/kfp-operators-debug-logs/juju-debug-log.log
juju status | tee ~/kfp-operators-debug-logs/juju-status.log
bash -c "cp ~/.local/state/charmcraft/log/* ~/kfp-operators-debug-logs/"
bash -c "df -h | tee ~/kfp-operators-debug-logs/df.log"
bash -c "free -h | tee ~/kfp-operators-debug-logs/free.log"
sg microk8s -c "microk8s.kubectl describe deployments -A | tee ~/kfp-operators-debug-logs/deployments.log"
sg microk8s -c "microk8s.kubectl describe nodes | tee ~/kfp-operators-debug-logs/deployments.log"
sg microk8s -c "microk8s.kubectl describe pods -A | tee ~/kfp-operators-debug-logs/pods.log"
sg microk8s -c "microk8s.kubectl describe workloads -A | tee ~/kfp-operators-debug-logs/workloads.log"

- name: Upload debug artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: kfp-operators-debug-logs
path: ~/kfp-operators-debug-logs
13 changes: 13 additions & 0 deletions tests/integration/test_kfp_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,16 @@ async def test_viz_server_healthcheck(ops_test: OpsTest):
result_status, result_text = await fetch_response(url=f"http://{url}:8888", headers=headers)

assert result_status == 200


# ---- KFP UI focused test cases
async def test_ui_server_healthcheck(ops_test: OpsTest):
"""Run a healthcheck on the ui server endpoint."""
status = await ops_test.model.get_status()
units = status["applications"]["kfp-ui"]["units"]
url = units["kfp-ui/0"]["address"]
headers = {"kubeflow-userid": "user"}
import pdb; pdb.set_trace()
result_status, result_text = await fetch_response(url=f"http://{url}:3000", headers=headers)

assert result_status == 200