Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions .github/actions/smoke-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,16 @@ runs:
- name: Deploy Kubernetes
id: k8s
run: |
make -f tests/Makefile create-kind-cluster K8S_CLUSTER_NAME=${{ github.run_id }} K8S_CLUSTER_VERSION=v${{ inputs.k8s-version }} K8S_TIMEOUT=${{ inputs.k8s-timeout }}
make -f tests/Makefile image-load REGISTRY="" PREFIX=${{ inputs.image-name }} TAG=${{ inputs.tag }} K8S_CLUSTER_NAME=${{ github.run_id }}
make -f tests/Makefile create-mini-cluster K8S_CLUSTER_VERSION=v${{ inputs.k8s-version }} K8S_TIMEOUT=${{ inputs.k8s-timeout }}
echo "Kubernetes cluster created with version v${{ inputs.k8s-version }} and timeout ${{ inputs.k8s-timeout }}"
minikube image load ${{ inputs.image-name }}:${{ inputs.tag }}
echo "Docker image ${{ inputs.image-name }}:${{ inputs.tag }} loaded into Minikube cluster"
label="${{ inputs.label }}"
nospaces="${label// /_}"
noslash="${nospaces//\//_}"
sanitized_marker="${noslash//\'/}"
name="${sanitized_marker}-${{ inputs.k8s-version }}"
cluster_ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${{ github.run_id }}-control-plane)
cluster_ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' minikube)
test_name=tests-nginx-${{ inputs.image-type }}-${name}.html
test_output_path=${{ github.workspace }}/tests/${test_name}
echo "cluster_ip=${cluster_ip}" >> $GITHUB_OUTPUT
Expand All @@ -67,18 +69,14 @@ runs:
echo " test_output_path=${test_output_path}"
shell: bash

- name: Setup Kubeconfig
run: |
sed -i 's|server:.*|server: https://${{ steps.k8s.outputs.cluster_ip }}:6443|' ~/.kube/kind/config
shell: bash

- name: Run Smoke Tests
id: smoke-tests
run: |
touch ${{ steps.k8s.outputs.test_output_path }}
chmod 644 $HOME/.kube/minikube/config
docker run --rm \
--name test-runner-${{ github.run_id }} \
--network=kind \
--network=minikube \
-v "/var/run/docker.sock:/var/run/docker.sock" \
-v ~/.docker:/root/.docker \
-v ${{ github.workspace }}/tests:/workspace/tests \
Expand All @@ -88,14 +86,18 @@ runs:
-v ${{ github.workspace }}/config:/workspace/config \
-v ${{ github.workspace }}/pyproject.toml:/workspace/pyproject.toml \
-v ${{ steps.k8s.outputs.test_output_path }}:${{ steps.k8s.outputs.test_output_path }} \
-v ~/.kube/kind/config:/root/.kube/config ${{ inputs.test-image }} \
-v $HOME/.minikube:$HOME/.minikube \
Comment thread
pdabelf5 marked this conversation as resolved.
-v $HOME/.kube:/root/.kube \
${{ inputs.test-image }} \
--docker-registry-user=oauth2accesstoken \
--docker-registry-token=${{ inputs.registry-token }} \
--context=kind-${{ github.run_id }} \
--kubeconfig=/root/.kube/minikube/config \
--context=minikube \
--image=${{ inputs.image-name }}:${{ inputs.tag }} \
--image-pull-policy=Never \
--ic-type=nginx${{ contains(inputs.image-type, 'plus') && '-plus' || '' }}-ingress \
--service=nodeport --node-ip=${{ steps.k8s.outputs.cluster_ip }} \
--service=nodeport \
--node-ip=minikube \
--html=${{ steps.k8s.outputs.test_output_path }} \
--self-contained-html \
--durations=10 \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -598,10 +598,10 @@ jobs:
- name: Deploy Kubernetes
id: k8s
run: |
kind create cluster --name ${{ github.run_id }} --image=kindest/node:v${{ needs.checks.outputs.k8s_latest }} --wait 75s
make -f tests/Makefile create-mini-cluster
Comment thread
pdabelf5 marked this conversation as resolved.
Outdated
docker version
kind load docker-image "${{ matrix.image }}:${{ matrix.tag }}" --name ${{ github.run_id }}
echo "DEBUG: Kind setup complete!"
minikube image load ${{ matrix.image }}:${{ matrix.tag }}
echo "DEBUG: Minikube setup complete!"
if: ${{ steps.stable_exists.outputs.exists != 'true' && needs.checks.outputs.docs_only == 'false' }}

- name: Create Plus Secret
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/single-image-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ jobs:
load: true
if: ${{ steps.check-image.outcome == 'failure' }}

- name: Generate Secrets for tests
run: |
make secrets

- name: Run Tests
uses: ./.github/actions/smoke-tests
with:
Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ run-tests-in-minikube: secrets ## Run tests in Minikube

.PHONY: create-mini-cluster
create-mini-cluster: $(MINIKUBE_KUBE_CONFIG_FOLDER) ## Create a Minikube K8S cluster
@minikube start --kubernetes-version=$(K8S_CLUSTER_VERSION) \
@minikube start --kubernetes-version=$(K8S_CLUSTER_VERSION) --wait-timeout=$(K8S_TIMEOUT) \
&& KUBECONFIG=$(MINIKUBE_KUBE_CONFIG_FOLDER)/config minikube update-context \
&& KUBECONFIG=$(MINIKUBE_KUBE_CONFIG_FOLDER)/config kubectl config set-cluster minikube --server=https://minikube:8443

Expand Down