Skip to content

Commit

Permalink
test(chart): Add test for setting registry to pull images (#2036)
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 authored Nov 30, 2023
1 parent 4c7703b commit 113bb0a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/helm-chart-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,22 @@ jobs:
- name: Output branch name
run: echo ${BRANCH}
- name: Sets build date
run: echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV
run: |
echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV
echo "IMAGE_REGISTRY=artifactory/selenium" >> $GITHUB_ENV
- name: Build Docker images
run: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build
run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build
- name: Setup Kubernetes environment
run: make chart_setup_env
- name: Setup Kubernetes cluster
run: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_cluster_setup
run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_cluster_setup
- name: Test Selenium Grid on Kubernetes
uses: nick-invision/[email protected]
with:
timeout_minutes: 20
max_attempts: 3
command: |
VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_test
NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_test
- name: Cleanup Kubernetes cluster
if: always()
run: make chart_cluster_cleanup
20 changes: 10 additions & 10 deletions charts/selenium-grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ This table contains the configuration parameters of the chart and their default
| `chromeNode.enabled` | `true` | Enable chrome nodes |
| `chromeNode.deploymentEnabled` | `true` | Enable creation of Deployment for chrome nodes |
| `chromeNode.replicas` | `1` | Number of chrome nodes. Disabled if autoscaling is enabled. |
| `chromeNode.imageRegistry` | `nil` | Distribution registry to pull the image |
| `chromeNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) |
| `chromeNode.imageName` | `node-chrome` | Image of chrome nodes |
| `chromeNode.imageTag` | `4.15.0-20231129` | Image of chrome nodes |
| `chromeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
Expand Down Expand Up @@ -169,7 +169,7 @@ This table contains the configuration parameters of the chart and their default
| `firefoxNode.enabled` | `true` | Enable firefox nodes |
| `firefoxNode.deploymentEnabled` | `true` | Enable creation of Deployment for firefox nodes |
| `firefoxNode.replicas` | `1` | Number of firefox nodes. Disabled if autoscaling is enabled. |
| `firefoxNode.imageRegistry` | `nil` | Distribution registry to pull the image |
| `firefoxNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) |
| `firefoxNode.imageName` | `node-firefox` | Image of firefox nodes |
| `firefoxNode.imageTag` | `4.15.0-20231129` | Image of firefox nodes |
| `firefoxNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
Expand Down Expand Up @@ -209,7 +209,7 @@ This table contains the configuration parameters of the chart and their default
| `edgeNode.enabled` | `true` | Enable edge nodes |
| `edgeNode.deploymentEnabled` | `true` | Enable creation of Deployment for edge nodes |
| `edgeNode.replicas` | `1` | Number of edge nodes. Disabled if autoscaling is enabled. |
| `edgeNode.imageRegistry` | `nil` | Distribution registry to pull the image |
| `edgeNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) |
| `edgeNode.imageName` | `node-edge` | Image of edge nodes |
| `edgeNode.imageTag` | `4.15.0-20231129` | Image of edge nodes |
| `edgeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
Expand Down Expand Up @@ -247,7 +247,7 @@ This table contains the configuration parameters of the chart and their default
| `edgeNode.scaledJobOptions` | See `values.yaml` | Override the global `autoscaling.scaledJobOptions` with specific scaled options for edge nodes |
| `edgeNode.scaledObjectOptions` | See `values.yaml` | Override the global `autoscaling.scaledObjectOptions` with specific scaled options for edge nodes |
| `videoRecorder.enabled` | `false` | Enable video recorder for node |
| `videoRecorder.imageRegistry` | `nil` | Distribution registry to pull the image |
| `videoRecorder.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) |
| `videoRecorder.imageName` | `video` | Selenium video recoder image name |
| `videoRecorder.imageTag` | `ffmpeg-6.0-20231129` | Image tag of video recorder |
| `videoRecorder.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
Expand Down Expand Up @@ -285,7 +285,7 @@ You can configure the Selenium Hub with these values:

| Parameter | Default | Description |
|---------------------------------|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| `hub.imageRegistry` | `nil` | Distribution registry to pull the image |
| `hub.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) |
| `hub.imageName` | `hub` | Selenium Hub image name |
| `hub.imageTag` | `nil` | Selenium Hub image tag (this overwrites `.global.seleniumGrid.imageTag` value) |
| `hub.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
Expand Down Expand Up @@ -319,7 +319,7 @@ If you implement selenium-grid with separate components (`isolateComponents: tru

| Parameter | Default | Description |
|----------------------------------------------|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| `components.router.imageRegistry` | `nil` | Distribution registry to pull the image |
| `components.router.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) |
| `components.router.imageName` | `router` | Router image name |
| `components.router.imageTag` | `nil` | Router image tag (this overwrites `.global.seleniumGrid.imageTag` value) |
| `components.router.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
Expand All @@ -337,7 +337,7 @@ If you implement selenium-grid with separate components (`isolateComponents: tru
| `components.router.nodeSelector` | `{}` | Node Selector for router pods |
| `components.router.affinity` | `{}` | Affinity for router pods |
| `components.router.priorityClassName` | `""` | Priority class name for router pods |
| `components.distributor.imageRegistry` | `nil` | Distribution registry to pull the image |
| `components.distributor.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) |
| `components.distributor.imageName` | `distributor` | Distributor image name |
| `components.distributor.imageTag` | `nil` | Distributor image tag (this overwrites `.global.seleniumGrid.imageTag` value) |
| `components.distributor.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
Expand All @@ -352,7 +352,7 @@ If you implement selenium-grid with separate components (`isolateComponents: tru
| `components.distributor.nodeSelector` | `{}` | Node Selector for Distributor pods |
| `components.distributor.affinity` | `{}` | Affinity for Distributor pods |
| `components.distributor.priorityClassName` | `""` | Priority class name for Distributor pods |
| `components.eventBus.imageRegistry` | `nil` | Distribution registry to pull the image |
| `components.eventBus.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) |
| `components.eventBus.imageName` | `event-bus` | Event Bus image name |
| `components.eventBus.imageTag` | `nil` | Event Bus image tag (this overwrites `.global.seleniumGrid.imageTag` value) |
| `components.eventBus.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
Expand All @@ -369,7 +369,7 @@ If you implement selenium-grid with separate components (`isolateComponents: tru
| `components.eventBus.nodeSelector` | `{}` | Node Selector for Event Bus pods |
| `components.eventBus.affinity` | `{}` | Affinity for Event Bus pods |
| `components.eventBus.priorityClassName` | `""` | Priority class name for Event Bus pods |
| `components.sessionMap.imageRegistry` | `nil` | Distribution registry to pull the image |
| `components.sessionMap.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) |
| `components.sessionMap.imageName` | `sessions` | Session Map image name |
| `components.sessionMap.imageTag` | `nil` | Session Map image tag (this overwrites `.global.seleniumGrid.imageTag` value) |
| `components.sessionMap.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
Expand All @@ -383,7 +383,7 @@ If you implement selenium-grid with separate components (`isolateComponents: tru
| `components.sessionMap.nodeSelector` | `{}` | Node Selector for Session Map pods |
| `components.sessionMap.affinity` | `{}` | Affinity for Session Map pods |
| `components.sessionMap.priorityClassName` | `""` | Priority class name for Session Map pods |
| `components.sessionQueue.imageRegistry` | `nil` | Distribution registry to pull the image |
| `components.sessionQueue.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) |
| `components.sessionQueue.imageName` | `session-queue` | Session Queue image name |
| `components.sessionQueue.imageTag` | `nil` | Session Queue image tag (this overwrites `.global.seleniumGrid.imageTag` value) |
| `components.sessionQueue.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
Expand Down
1 change: 1 addition & 0 deletions charts/selenium-grid/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ All related testing to this helm chart will be documented in this file.
| | Sanity tests in node | &check; |
| | Video recorder is enabled in node | &cross; |
| | Node `extraEnvironmentVariables` is set value | &check; |
| General | Set new image registry via `global.seleniumGrid.imageRegistry` | &check; |

## Build & test Docker images with Helm charts
Noted: These `make` commands are composed and tested on Linux x86_64.
Expand Down
1 change: 1 addition & 0 deletions tests/K8s/chart_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ helm upgrade --install ${RELEASE_NAME} \
--set autoscaling.enableWithExistingKEDA=${SELENIUM_GRID_AUTOSCALING} \
--set autoscaling.scaledOptions.minReplicaCount=${SELENIUM_GRID_AUTOSCALING_MIN_REPLICA} \
--set global.seleniumGrid.imageTag=${VERSION} --set global.seleniumGrid.imageRegistry=${NAMESPACE} \
--set global.seleniumGrid.nodesImageTag=${VERSION} \
${CHART_PATH} --namespace ${SELENIUM_NAMESPACE} --create-namespace

echo "Run Tests"
Expand Down
Loading

0 comments on commit 113bb0a

Please sign in to comment.