-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature run selenium tests grid on kubernetes via helm chart (#2027)
* feat(k8stests): added kubernetes tests cases * docs(keda): updated readme to keda version 2.12 * chore(optimize): matrix strategy in workflow * chore(docker): allow time to docker pull images * fix(dry-principle): Reusing existing test.py
- Loading branch information
1 parent
bbef734
commit e56a1fc
Showing
8 changed files
with
133 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,12 @@ on: | |
- 'charts/selenium-grid/**' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint-test: | ||
name: "Lint Tests with ct" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -45,6 +49,69 @@ jobs: | |
|
||
- name: Create kind cluster | ||
uses: helm/[email protected] | ||
with: | ||
config: ./tests/kind-cluster-config.yaml | ||
|
||
- name: Run chart-testing (install) | ||
run: ct install --all --config tests/chart-test.yaml | ||
|
||
deploy-grid-selenium-tests: | ||
name: "Run Selenium Tests on K8s" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
browser: [NodeChrome,NodeEdge,NodeFirefox] | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: v3.13.2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
check-latest: true | ||
|
||
- name: Create kind cluster | ||
uses: helm/[email protected] | ||
with: | ||
config: ./tests/kind-cluster-config.yaml | ||
|
||
# 👋 Documentation link for Ingress Installation on kind k8s cluster https://kind.sigs.k8s.io/docs/user/ingress | ||
- name: Install ingress-nginx on kind kubernetes cluster | ||
run: | | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml | ||
kubectl wait --namespace ingress-nginx \ | ||
--for=condition=ready pod \ | ||
--selector=app.kubernetes.io/component=controller \ | ||
--timeout=90s | ||
- name: Deploy Selenium Grid Chart | ||
run: | | ||
helm repo add kedacore https://kedacore.github.io/charts | ||
helm repo update | ||
helm dependency build charts/selenium-grid | ||
helm upgrade --install selenium-grid -f ./tests/override-kind-auth-${{matrix.browser}}-values.yaml charts/selenium-grid --namespace selenium-grid-test --create-namespace | ||
kubectl get ingress --all-namespaces | ||
- name: Verify Post Deployment Grid Health and k8s pods status | ||
run: | | ||
sleep 20 # Allow Kubernetes to pull Docker Images and start Pods | ||
python ./tests/K8sSmokeTest.py "http://localhost" | ||
kubectl get pods -n selenium-grid-test | ||
kubectl get events -n selenium-grid-test | ||
- name: Run Selenium Tests Against Kubernetes | ||
run: | | ||
export SELENIUM_GRID_HOST=localhost | ||
export SELENIUM_GRID_PORT=80 | ||
export RUN_IN_DOCKER_COMPOSE=true | ||
./tests/bootstrap.sh ${{matrix.browser}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This Config is required for KIND cluster to enable ingress. Documented here https://kind.sigs.k8s.io/docs/user/ingress | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
kubeadmConfigPatches: | ||
- | | ||
kind: InitConfiguration | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
node-labels: "ingress-ready=true" | ||
extraPortMappings: | ||
- containerPort: 80 | ||
hostPort: 80 | ||
protocol: TCP | ||
- containerPort: 443 | ||
hostPort: 443 | ||
protocol: TCP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This is used in Helm chart testing. This disables the basic auth on seleneium grid | ||
# Basic auth settings for Selenium Grid | ||
basicAuth: | ||
# Enable or disable basic auth | ||
enabled: false | ||
# Configuration for edge nodes | ||
edgeNode: | ||
# Enable edge nodes | ||
enabled: false | ||
# Configuration for firefox nodes | ||
firefoxNode: | ||
# Enable firefox nodes | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This is used in Helm chart testing. This disables the basic auth on seleneium grid | ||
# Basic auth settings for Selenium Grid | ||
basicAuth: | ||
# Enable or disable basic auth | ||
enabled: false | ||
# Configuration for chrome nodes | ||
chromeNode: | ||
# Enable chrome nodes | ||
enabled: false | ||
# Configuration for firefox nodes | ||
firefoxNode: | ||
# Enable firefox nodes | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This is used in Helm chart testing. This disables the basic auth on seleneium grid | ||
# Basic auth settings for Selenium Grid | ||
basicAuth: | ||
# Enable or disable basic auth | ||
enabled: false | ||
# Configuration for chrome nodes | ||
chromeNode: | ||
# Enable chrome nodes | ||
enabled: false | ||
# Configuration for edge nodes | ||
edgeNode: | ||
# Enable edge nodes | ||
enabled: false |