|
| 1 | +name: "Test Selenium Grid 4 deployment on Minikube Cluster" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - trunk |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - trunk |
| 10 | + |
| 11 | +jobs: |
| 12 | + deploy: |
| 13 | + name: Deployment and testing of Grid 4 on Minikube |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v1 |
| 18 | + - name: Setup Minikube |
| 19 | + |
| 20 | + with: |
| 21 | + minikube version: "v1.13.1" |
| 22 | + kubernetes version: "v1.19.2" |
| 23 | + github token: ${{ secrets.GITHUB_TOKEN }} |
| 24 | + driver: none |
| 25 | + - name: Interact with Minikube |
| 26 | + run: kubectl get nodes |
| 27 | + - name: Output Cluster info |
| 28 | + run: | |
| 29 | + kubectl cluster-info |
| 30 | + kubectl get pods -n kube-system |
| 31 | + echo "current-context:" $(kubectl config current-context) |
| 32 | + echo "environment-kubeconfig:" ${KUBECONFIG} |
| 33 | + - name: Deploy Grid4 on minikube |
| 34 | + run: kubectl apply -f k8s-deployment-full-grid.yaml |
| 35 | + - name: Expose Router service |
| 36 | + run: kubectl expose deployment selenium-router-deployment --type=NodePort --port=4444 --target-port=4444 |
| 37 | + - name: Wait for Pods to get started |
| 38 | + run: | |
| 39 | + sleep 10 |
| 40 | + podsCount=$(kubectl get pods -l component=selenium-grid-4 | wc -l) |
| 41 | + ctr=0 |
| 42 | + while [ $podsCount -lt 6 ] |
| 43 | + do |
| 44 | + ((ctr++)) |
| 45 | + if [[ $ctr -eq 30 ]]; then |
| 46 | + echo "Timed out while waiting for Pods to get ready" |
| 47 | + exit 1 |
| 48 | + fi |
| 49 | + echo "Waiting for pods to get started...." |
| 50 | + sleep 10 |
| 51 | + podsCount=$(kubectl get pods -l component=selenium-grid-4 | wc -l) |
| 52 | + done |
| 53 | + echo "All the pods are started" |
| 54 | + - name: Waiting for Pods to get ready |
| 55 | + run: | |
| 56 | + echo "Waiting for pods to attain ready state...." |
| 57 | + kubectl wait --for=condition=ready pod -l name=selenium-router --timeout=300s |
| 58 | + kubectl wait --for=condition=ready pod -l name=selenium-distributor --timeout=300s |
| 59 | + kubectl wait --for=condition=ready pod -l name=selenium-event-bus --timeout=300s |
| 60 | + kubectl wait --for=condition=ready pod -l name=selenium-chrome-node --timeout=300s |
| 61 | + kubectl get pods -l component=selenium-grid-4 |
| 62 | + echo "All pods are in ready state now" |
| 63 | + - name: Listing all the Grid 4 components |
| 64 | + run: kubectl get all -l component=selenium-grid-4 |
| 65 | + - name: Testing the Grid |
| 66 | + run: | |
| 67 | + SELENIUM_GRID_URL=$(minikube service selenium-router-deployment --url) |
| 68 | + echo $SELENIUM_GRID_URL |
| 69 | + python3 $PWD/tests/K8sSmokeTest.py $SELENIUM_GRID_URL |
0 commit comments