From de5a1f2805f015fca6ac7bf9510c038219fe163c Mon Sep 17 00:00:00 2001 From: Jose Luis Franco Arza Date: Fri, 30 Aug 2024 08:34:27 +0200 Subject: [PATCH] Add tests for weaviate-operator and update README --- .github/workflows/tests.yaml | 47 ++++++++++++++++++++++++++++++++++++ README.md | 8 +++--- 2 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..dc9f369 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,47 @@ +name: Run Tests + +on: + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up Kind Cluster + uses: helm/kind-action@v1 + with: + cluster_name: test-cluster + + - name: Build the Weaviate Operator image + run: make docker-build + + - name: Install Weaviate Operator + run: make deploy + + - name: Wait for weaviate-operator-controller-manager to be ready + run: | + kubectl wait --for=condition=available deployment/weaviate-operator-controller-manager -n weaviate-operator-system --timeout=300s + if [ $? -ne 0 ]; then + kubectl logs deployment/weaviate-operator-controller-manager -n weaviate-operator-system + fi + + - name: Create Weaviate namespace + run: kubectl create namespace weaviate + + - name: Install CR + run: kubectl apply -f config/samples/apps_v1alpha1_weaviatecluster.yaml -n weaviate + + - name: Wait for Pods to be Ready + run: | + kubectl wait sts/weaviate -n weaviate --for jsonpath='{.status.readyReplicas}'=${REPLICAS} --timeout=${TIMEOUT} + if [ $? -ne 0 ]; then + kubectl logs -l app=weaviate -n weaviate --all-containers=true --prefix + fi + + \ No newline at end of file diff --git a/README.md b/README.md index 046ad7a..1cc2912 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Before getting started, make sure you have the following prerequisites: - Have a kubernetes cluster. - Ensure that your user is authorized with cluster-admin permissions. -If you want to deploy a local kubernetes cluster for local testing you can install kind: +If you want to deploy a local kubernetes cluster for local testing you can [install kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation): ``` brew install kind ``` @@ -35,11 +35,11 @@ kind create cluster --wait 120s --name weaviate-k8s --config /tmp/kind-config.ya The Weaviate Operator wraps the [weaviate-helm](https://github.com/weaviate/weaviate-helm) Helm charts, creating a CRD and CRs which allow passing specific values to configure the application. -## Run the operator +## Deploy the operator -There are multiple ways to run the operator: +There are multiple ways to run the `weaviate-operator`: -1. The easiest way is to run the one-command Manifest: +1. The easiest way is to apply the one-single-command Manifest: ```shell kubectl apply -f https://github.com/weaviate/weaviate-operator/releases/download/0.0.1/operator.yaml