diff --git a/.circleci/config.yml b/.circleci/config.yml index a7524bf45..8f9c428e7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -79,54 +79,72 @@ workflows: use-random-user: true platforms: linux/arm64 machine-type: ubuntu2204arm64 + firefox-install-lang-package: false + enable-managed-downloads: false - docker-test: name: "Docker test - Use random user (false)" test-strategy: test use-random-user: false platforms: linux/arm64 machine-type: ubuntu2204arm64 + firefox-install-lang-package: false + enable-managed-downloads: false - docker-test: name: "Docker test - Video recording" test-strategy: test_video use-random-user: false platforms: linux/arm64 machine-type: ubuntu2204arm64 + firefox-install-lang-package: true + enable-managed-downloads: true - docker-test: name: "Docker test - Video recording dynamic file name" test-strategy: test_video_dynamic_name use-random-user: false platforms: linux/arm64 machine-type: ubuntu2204arm64 + firefox-install-lang-package: true + enable-managed-downloads: true - docker-test: name: "Docker test - Video recording standalone" test-strategy: test_video_standalone use-random-user: false platforms: linux/arm64 machine-type: ubuntu2204arm64 + firefox-install-lang-package: true + enable-managed-downloads: true - docker-test: name: "Docker test - Dynamic Grid" test-strategy: test_node_docker use-random-user: false platforms: linux/arm64 machine-type: ubuntu2204arm64 + firefox-install-lang-package: true + enable-managed-downloads: false - docker-test: name: "Docker test - Dynamic Grid Standalone" test-strategy: test_standalone_docker use-random-user: false platforms: linux/arm64 machine-type: ubuntu2204arm64 + firefox-install-lang-package: true + enable-managed-downloads: true - docker-test: name: "Docker test - Parallel execution" test-strategy: test_parallel use-random-user: false platforms: linux/arm64 machine-type: ubuntu2204arm64 + firefox-install-lang-package: true + enable-managed-downloads: true - docker-test: name: "Docker test - Node relay commands" test-strategy: test_node_relay use-random-user: false platforms: linux/arm64 machine-type: ubuntu2204arm64 + firefox-install-lang-package: true + enable-managed-downloads: true executors: ubuntu2204arm64: @@ -149,6 +167,10 @@ jobs: type: string use-random-user: type: boolean + firefox-install-lang-package: + type: boolean + enable-managed-downloads: + type: boolean executor: << parameters.machine-type >> environment: NAMESPACE: selenium @@ -156,6 +178,8 @@ jobs: PLATFORMS: << parameters.platforms >> TEST_STRATEGY: << parameters.test-strategy >> USE_RANDOM_USER: << parameters.use-random-user >> + TEST_FIREFOX_INSTALL_LANG_PACKAGE: << parameters.firefox-install-lang-package >> + SELENIUM_ENABLE_MANAGED_DOWNLOADS: << parameters.enable-managed-downloads >> steps: - run: name: "Prepare workflow environment variables" @@ -195,7 +219,9 @@ jobs: command: | N=3 while [ $N -gt 0 ]; do - output=$(eval "USE_RANDOM_USER_ID=${USE_RANDOM_USER} PLATFORMS=${PLATFORMS} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make ${TEST_STRATEGY}") + output=$(eval "USE_RANDOM_USER_ID=${USE_RANDOM_USER} PLATFORMS=${PLATFORMS} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} \ + TEST_FIREFOX_INSTALL_LANG_PACKAGE=${TEST_FIREFOX_INSTALL_LANG_PACKAGE} SELENIUM_ENABLE_MANAGED_DOWNLOADS=${SELENIUM_ENABLE_MANAGED_DOWNLOADS} \ + make ${TEST_STRATEGY}") status=$? if [ $status -eq 0 ]; then echo "Tests passed" diff --git a/Makefile b/Makefile index 33f8fd9d2..d7377d6df 100644 --- a/Makefile +++ b/Makefile @@ -629,7 +629,7 @@ test_firefox_download_lang_packs: test_firefox: test_firefox_download_lang_packs PLATFORMS=$(PLATFORMS) VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BASE_RELEASE=$(BASE_RELEASE) BASE_VERSION=$(BASE_VERSION) BINDING_VERSION=$(BINDING_VERSION) SKIP_BUILD=true \ - TEST_FIREFOX_INSTALL_LANG_PACKAGE=true ./tests/bootstrap.sh NodeFirefox + TEST_FIREFOX_INSTALL_LANG_PACKAGE=$(or $(TEST_FIREFOX_INSTALL_LANG_PACKAGE), "true") ./tests/bootstrap.sh NodeFirefox test_firefox_standalone: PLATFORMS=$(PLATFORMS) VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BASE_RELEASE=$(BASE_RELEASE) BASE_VERSION=$(BASE_VERSION) BINDING_VERSION=$(BINDING_VERSION) SKIP_BUILD=true ./tests/bootstrap.sh StandaloneFirefox @@ -848,7 +848,7 @@ test_node_docker: hub standalone_docker standalone_chrome standalone_firefox sta envsubst < $${config_file} > ./videos/config.toml ; \ DOCKER_DEFAULT_PLATFORM=$(PLATFORMS) docker compose -f $${docker_compose_file} up --remove-orphans --no-log-prefix --build --exit-code-from tests ; \ if [ $$? -ne 0 ]; then exit 1; fi ; \ - if [ "$$SKIP_CHECK_DOWNLOADS_VOLUME" != "true" ] && [ -d "$$DOWNLOADS_DIR" ] && [ $$(ls -1q $$DOWNLOADS_DIR | wc -l) -eq 0 ]; then \ + if [ "$$SKIP_CHECK_DOWNLOADS_VOLUME" != "true" ] && [ "$$SELENIUM_ENABLE_MANAGED_DOWNLOADS" != "true" ] && [ -d "$$DOWNLOADS_DIR" ] && [ $$(ls -1q $$DOWNLOADS_DIR | wc -l) -eq 0 ]; then \ echo "Mounted downloads directory is empty. Downloaded files could not be retrieved!" ; \ exit 1 ; \ fi ; \ @@ -922,7 +922,7 @@ chart_test_autoscaling_deployment_https: chart_test_autoscaling_deployment: PLATFORMS=$(PLATFORMS) TEST_EXISTING_KEDA=true RELEASE_NAME=selenium CHART_ENABLE_TRACING=true TEST_PATCHED_KEDA=false \ SECURE_CONNECTION_SERVER=true SECURE_USE_EXTERNAL_CERT=true SERVICE_TYPE_NODEPORT=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$$(hostname -i) SELENIUM_GRID_PORT=31444 \ - SELENIUM_GRID_AUTOSCALING_MIN_REPLICA=1 \ + SELENIUM_GRID_AUTOSCALING_MIN_REPLICA=0 SET_MAX_REPLICAS=3 TEST_DELAY_AFTER_TEST=2 SELENIUM_GRID_MONITORING=false \ VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) KEDA_BASED_NAME=$(KEDA_BASED_NAME) KEDA_BASED_TAG=$(KEDA_BASED_TAG) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \ TEMPLATE_OUTPUT_FILENAME="k8s_prefixSelenium_enableTracing_secureServer_externalCerts_nodePort_autoScaling_scaledObject_existingKEDA_subPath.yaml" \ ./tests/charts/make/chart_test.sh DeploymentAutoscaling diff --git a/charts/selenium-grid/CONFIGURATION.md b/charts/selenium-grid/CONFIGURATION.md index b8e2a234c..aaa8e5da7 100644 --- a/charts/selenium-grid/CONFIGURATION.md +++ b/charts/selenium-grid/CONFIGURATION.md @@ -1,6 +1,6 @@ # selenium-grid -![Version: 0.36.2](https://img.shields.io/badge/Version-0.36.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.25.0-20241010](https://img.shields.io/badge/AppVersion-4.25.0--20241010-informational?style=flat-square) +![Version: 0.36.3](https://img.shields.io/badge/Version-0.36.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.25.0-20241010](https://img.shields.io/badge/AppVersion-4.25.0--20241010-informational?style=flat-square) A Helm chart for creating a Selenium Grid Server in Kubernetes @@ -21,7 +21,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes | https://jaegertracing.github.io/helm-charts | jaeger | 3.3.1 | | https://kedacore.github.io/charts | keda | 2.15.1 | | https://kubernetes.github.io/ingress-nginx | ingress-nginx | 4.11.3 | -| https://prometheus-community.github.io/helm-charts | kube-prometheus-stack | 65.1.1 | +| https://prometheus-community.github.io/helm-charts | kube-prometheus-stack | 65.2.0 | ## Values @@ -42,7 +42,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes | global.seleniumGrid.revisionHistoryLimit | int | `10` | Specify how many old ReplicaSets for this Deployment you want to retain. The rest will be garbage-collected in the background. | | global.seleniumGrid.structuredLogs | bool | `false` | Whether to enable structured logging | | global.seleniumGrid.httpLogs | bool | `false` | Enable http logging. Tracing should be enabled to log http logs. | -| global.seleniumGrid.updateStrategy.type | string | `"Recreate"` | Specify update strategy for all components, can be overridden individually | +| global.seleniumGrid.updateStrategy.type | string | `"RollingUpdate"` | Specify update strategy for all components, can be overridden individually | | global.seleniumGrid.updateStrategy.rollingUpdate | object | `{"maxSurge":1,"maxUnavailable":0}` | Specify for strategy RollingUpdate | | global.seleniumGrid.affinity | object | `{}` | Specify affinity for all components, can be overridden individually | | global.seleniumGrid.topologySpreadConstraints | list | `[]` | Specify topologySpreadConstraints for all components, can be overridden individually | diff --git a/charts/selenium-grid/Chart.yaml b/charts/selenium-grid/Chart.yaml index 903f1b326..1dc9908cf 100644 --- a/charts/selenium-grid/Chart.yaml +++ b/charts/selenium-grid/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: selenium-grid description: A Helm chart for creating a Selenium Grid Server in Kubernetes type: application -version: 0.36.2 +version: 0.36.3 appVersion: 4.25.0-20241010 icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png dependencies: @@ -19,7 +19,7 @@ dependencies: name: jaeger condition: tracing.enabled, jaeger.enabled - repository: https://prometheus-community.github.io/helm-charts - version: 65.1.1 + version: 65.2.0 name: kube-prometheus-stack condition: monitoring.enabled, prometheus-stack.enabled maintainers: diff --git a/charts/selenium-grid/templates/chrome-node-deployment.yaml b/charts/selenium-grid/templates/chrome-node-deployment.yaml index 66f256b11..7177c1181 100644 --- a/charts/selenium-grid/templates/chrome-node-deployment.yaml +++ b/charts/selenium-grid/templates/chrome-node-deployment.yaml @@ -17,9 +17,11 @@ metadata: spec: strategy: {{- template "seleniumGrid.updateStrategy" (list $.Values.chromeNode $.Values.global.seleniumGrid) }} - {{- if and (not .Values.autoscaling.enabled) (not .Values.autoscaling.enableWithExistingKEDA) }} + {{- if not (eq (include "seleniumGrid.useKEDA" $) "true") }} replicas: {{ .Values.chromeNode.replicas }} - {{end}} + {{- else }} + replicas: {{ default $.Values.autoscaling.scaledOptions.minReplicaCount ($.Values.chromeNode.scaledOptions).minReplicaCount }} + {{ end }} revisionHistoryLimit: {{ .Values.global.seleniumGrid.revisionHistoryLimit }} selector: matchLabels: diff --git a/charts/selenium-grid/templates/edge-node-deployment.yaml b/charts/selenium-grid/templates/edge-node-deployment.yaml index fa5c4c913..8a0b7f69b 100644 --- a/charts/selenium-grid/templates/edge-node-deployment.yaml +++ b/charts/selenium-grid/templates/edge-node-deployment.yaml @@ -17,9 +17,11 @@ metadata: spec: strategy: {{- template "seleniumGrid.updateStrategy" (list $.Values.edgeNode $.Values.global.seleniumGrid) }} - {{- if and (not .Values.autoscaling.enabled) (not .Values.autoscaling.enableWithExistingKEDA) }} + {{- if not (eq (include "seleniumGrid.useKEDA" $) "true") }} replicas: {{ .Values.edgeNode.replicas }} - {{end}} + {{- else }} + replicas: {{ default $.Values.autoscaling.scaledOptions.minReplicaCount ($.Values.edgeNode.scaledOptions).minReplicaCount }} + {{ end }} revisionHistoryLimit: {{ .Values.global.seleniumGrid.revisionHistoryLimit }} selector: matchLabels: diff --git a/charts/selenium-grid/templates/firefox-node-deployment.yaml b/charts/selenium-grid/templates/firefox-node-deployment.yaml index 38adabd21..584473563 100644 --- a/charts/selenium-grid/templates/firefox-node-deployment.yaml +++ b/charts/selenium-grid/templates/firefox-node-deployment.yaml @@ -17,9 +17,11 @@ metadata: spec: strategy: {{- template "seleniumGrid.updateStrategy" (list $.Values.firefoxNode $.Values.global.seleniumGrid) }} - {{- if and (not .Values.autoscaling.enabled) (not .Values.autoscaling.enableWithExistingKEDA) }} + {{- if not (eq (include "seleniumGrid.useKEDA" $) "true") }} replicas: {{ .Values.firefoxNode.replicas }} - {{end}} + {{- else }} + replicas: {{ default $.Values.autoscaling.scaledOptions.minReplicaCount ($.Values.firefoxNode.scaledOptions).minReplicaCount }} + {{ end }} revisionHistoryLimit: {{ .Values.global.seleniumGrid.revisionHistoryLimit }} selector: matchLabels: diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index 3a97b7a04..7d12cfbf0 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -34,7 +34,7 @@ global: httpLogs: false updateStrategy: # -- Specify update strategy for all components, can be overridden individually - type: Recreate + type: RollingUpdate # type: RollingUpdate # -- Specify for strategy RollingUpdate rollingUpdate: diff --git a/tests/SeleniumTests/__init__.py b/tests/SeleniumTests/__init__.py index b78e87c3b..986e7e248 100644 --- a/tests/SeleniumTests/__init__.py +++ b/tests/SeleniumTests/__init__.py @@ -99,7 +99,6 @@ def test_download_file(self): driver = self.driver driver.get('https://the-internet.herokuapp.com/download') file_name = 'some-file.txt' - is_continue = True wait = WebDriverWait(driver, 30) file_link = wait.until( EC.element_to_be_clickable((By.LINK_TEXT, file_name)) diff --git a/tests/charts/make/chart_test.sh b/tests/charts/make/chart_test.sh index 3cab6509a..ac9ab5d19 100755 --- a/tests/charts/make/chart_test.sh +++ b/tests/charts/make/chart_test.sh @@ -80,6 +80,9 @@ on_failure() { if [ ${RENDER_HELM_TEMPLATE_ONLY} = "true" ]; then exit $exit_status fi + kubectl get pods -A + echo "Get all resources in all namespaces" + kubectl get all -A >> tests/tests/describe_all_resources_${MATRIX_BROWSER}.txt echo "Describe all resources in the ${SELENIUM_NAMESPACE} namespace for debugging purposes" kubectl describe all -n ${SELENIUM_NAMESPACE} >> tests/tests/describe_all_resources_${MATRIX_BROWSER}.txt kubectl describe pod -n ${SELENIUM_NAMESPACE} >> tests/tests/describe_all_resources_${MATRIX_BROWSER}.txt @@ -450,10 +453,4 @@ while true; do fi done -echo "Get pods status" -kubectl get pods -n ${SELENIUM_NAMESPACE} - -echo "Get all resources in all namespaces" -kubectl get all -A >> tests/tests/describe_all_resources_${MATRIX_BROWSER}.txt - cleanup diff --git a/tests/charts/templates/test.py b/tests/charts/templates/test.py index b3b2fc82b..03e41fa3c 100644 --- a/tests/charts/templates/test.py +++ b/tests/charts/templates/test.py @@ -278,7 +278,7 @@ def test_update_strategy_in_all_components(self): count_rolling += 1 if doc['metadata']['name'] in recreate and doc['kind'] == 'Deployment': logger.info(f"Assert updateStrategy is set in resource {doc['metadata']['name']}") - self.assertTrue(doc['spec']['strategy']['type'] == 'Recreate', f"Resource {doc['metadata']['name']} doesn't have strategy Recreate") + self.assertTrue(doc['spec']['strategy']['type'] == 'RollingUpdate', f"Resource {doc['metadata']['name']} doesn't have strategy RollingUpdate") count_recreate += 1 self.assertEqual(count_rolling, len(rolling), "No deployment resources found with strategy RollingUpdate") self.assertEqual(count_recreate, len(recreate), "No deployment resources found with strategy Recreate")