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

chore: Add kind integration test, fixes #41 #42

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

dhirajsb
Copy link
Contributor

Description

Added kind integration test to build-image-pr.yaml workflow.
It creates a Kind cluster, deploys operator image built for the PR in the test cluster, and checks that it can create a model registry from sample model registry CR.
Fixes #41

How Has This Been Tested?

Tested GH action locally using act.

Merge criteria:

  • The commits and have meaningful messages; the author will squash them after approval or will ask to merge with squash.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@dhirajsb dhirajsb requested review from tarilabs and lampajr December 17, 2023 06:41
tarilabs
tarilabs previously approved these changes Dec 17, 2023
Copy link
Member

@tarilabs tarilabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've followed these steps to replicate locally:

kind create cluster
make docker-build

# locally, node chart-testing is not there, using default node
kind load docker-image quay.io/opendatahub/model-registry-operator:latest
make deploy
kubectl apply -k config/samples/
kubectl get mr

# monitoring pods:
kubectl get pods
# in my case: kubectl logs modelregistry-sample-5946c9799c-cvj5b

# after a while:
CONDITION="`kubectl get mr modelregistry-sample --output=jsonpath='{.status.conditions[?(@.type=="Available")].status}'`"
echo "Registry Available=${CONDITION}"

and output was eventually: Registry Available=True

Copy link
Contributor

@lampajr lampajr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works for me too and it looks great to me as first iteration but I would followup creating some e2e specific tests (e.g., using . "github.com/onsi/ginkgo", and "github.com/onsi/gomega") where we can add more tests if needed.

I mean I wouldn't keep test logic in the workflow itself, but lgtm as first bootstrap

Copy link
Contributor

@lampajr lampajr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed this in previous analysis but I think it could be worth to add it

.github/workflows/build-image-pr.yml Outdated Show resolved Hide resolved
Co-authored-by: Andrea Lamparelli <a.lamparelli95@gmail.com>
Copy link
Contributor

@lampajr lampajr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks @dhirajsb !

@dhirajsb dhirajsb merged commit 715a248 into opendatahub-io:main Dec 18, 2023
3 checks passed
@dhirajsb dhirajsb deleted the pr-test-kind branch December 18, 2023 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add PR test using Kind cluster
3 participants