diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index dd3b6e70e..68f72626b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -56,7 +56,7 @@ body: attributes: label: Docker Selenium version (image tag) description: What version of Docker Selenium are you using? - placeholder: 4.27.0-20241204? Please use the full tag, avoid "latest" + placeholder: 4.27.0-20241225? Please use the full tag, avoid "latest" validations: required: true - type: input diff --git a/.keda/README.md b/.keda/README.md index cc683e15f..58d782095 100644 --- a/.keda/README.md +++ b/.keda/README.md @@ -13,9 +13,9 @@ The stable implementation will be merged to the upstream KEDA repository frequen Replace the image registry and tag of these KEDA components with the patched image tag: ```bash -docker pull selenium/keda:2.16.0-selenium-grid-20241204 -docker pull selenium/keda-metrics-apiserver:2.16.0-selenium-grid-20241204 -docker pull selenium/keda-admission-webhooks:2.16.0-selenium-grid-20241204 +docker pull selenium/keda:2.16.1-selenium-grid-20241225 +docker pull selenium/keda-metrics-apiserver:2.16.1-selenium-grid-20241225 +docker pull selenium/keda-admission-webhooks:2.16.1-selenium-grid-20241225 ``` Besides that, you also can use image tag `latest` or `nightly`. @@ -27,15 +27,15 @@ If you are deploying KEDA core using their official Helm [chart](https://github. keda: registry: selenium repository: keda - tag: "2.16.0-selenium-grid-20241204" + tag: "2.16.1-selenium-grid-20241225" metricsApiServer: registry: selenium repository: keda-metrics-apiserver - tag: "2.16.0-selenium-grid-20241204" + tag: "2.16.1-selenium-grid-20241225" webhooks: registry: selenium repository: keda-admission-webhooks - tag: "2.16.0-selenium-grid-20241204" + tag: "2.16.1-selenium-grid-20241225" ``` If you are deployment Selenium Grid chart with `autoscaling.enabled` is `true` (implies installing KEDA sub-chart), KEDA images registry and tag already set in the `values.yaml`. Refer to list [configuration](../charts/selenium-grid/CONFIGURATION.md). diff --git a/.keda/scalers/selenium-grid-scaler.md b/.keda/scalers/selenium-grid-scaler.md index 27d0c255d..b06321d58 100644 --- a/.keda/scalers/selenium-grid-scaler.md +++ b/.keda/scalers/selenium-grid-scaler.md @@ -13,31 +13,30 @@ This specification describes the `selenium-grid` trigger that scales browser nod The scaler creates one browser node per pending request in session queue, divided by the max amount of sessions that can run in parallel. You will have to create one trigger per browser capability that you would like to support in your Selenium Grid. -The below is an example trigger configuration for chrome node. +The below is an example trigger configuration with default values represent. ```yaml triggers: - type: selenium-grid metadata: url: 'http://selenium-hub:4444/graphql' # Required. Can be ommitted if specified via TriggerAuthentication/ClusterTriggerAuthentication. - browserName: 'chrome' # Required - browserVersion: '91.0' # Optional. Only required when supporting multiple versions of browser in your Selenium Grid. - unsafeSsl : 'true' # Optional - activationThreshold: 5 # Optional - platformName: 'Linux' # Optional + browserName: '' # Optional. Required to be matched with the request in queue and Node stereotypes (Similarly for `browserVersion` and `platformName`). + browserVersion: '' # Optional. + platformName: 'linux' # Optional. + unsafeSsl : 'false' # Optional. + activationThreshold: 0 # Optional. ``` **Parameter list:** - `url` - Graphql url of your Selenium Grid. Refer to the Selenium Grid's documentation [here](https://www.selenium.dev/documentation/en/grid/grid_4/graphql_support/) to for more info. If endpoint requires authentication, you can use `TriggerAuthentication` to provide the credentials instead of embedding in the URL. -- `browserName` - Name of browser that usually gets passed in the browser capability. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info. +- `browserName` - Name of browser that usually gets passed in the browser capability. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info. (Optional) - `sessionBrowserName` - Name of the browser when it is an active session, only set if `BrowserName` changes between the queue and the active session. See the Edge example below for further detail. (Optional) - `browserVersion` - Version of browser that usually gets passed in the browser capability. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info. (Optional) - `unsafeSsl` - Skip certificate validation when connecting over HTTPS. (Values: `true`, `false`, Default: `false`, Optional) - `activationThreshold` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional) - `platformName` - Name of the browser platform. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info. (Default: `Linux`, Optional) - `nodeMaxSessions` - Number of maximum sessions that can run in parallel on a Node. Update this parameter align with node config `--max-sessions` (`SE_NODE_MAX_SESSIONS`) to have the correct scaling behavior. (Default: `1`, Optional). -- `targetQueueLength` - The target number of queued sessions to scale on. (Default: `1`, Optional). **Trigger Authentication** - `username` - Username for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional) @@ -45,76 +44,231 @@ triggers: - `authType` - Type of authentication to be used. This can be set to `Bearer` or `OAuth2` in case Selenium Grid behind an Ingress proxy with other authentication types. (Optional) - `accessToken` - Access token. This is required when `authType` is set a value. (Optional) -### How does it work? - -The scaler will query the Hub GraphQL response to get the number of queued sessions in the specified combination of browser name, version, and platform. If the number of queued sessions is **equal to or greater than** the `targetQueueLength`, the scaler will scale up. - ### Example Here is a full example of scaled object definition using Selenium Grid trigger: ```yaml +kind: Deployment +metadata: + name: selenium-node-chrome + labels: + deploymentName: selenium-node-chrome +spec: + replicas: 1 + template: + spec: + containers: + - name: selenium-node-chrome + image: selenium/node-chrome:latest + ports: + - containerPort: 5555 + env: + - name: SE_NODE_BROWSER_VERSION + value: '' + +--- + apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: - name: selenium-grid-chrome-scaledobject + name: selenium-grid-scaledobject-chrome + namespace: keda + labels: + deploymentName: selenium-node-chrome +spec: + maxReplicaCount: 8 + scaleTargetRef: + name: selenium-node-chrome + triggers: + - type: selenium-grid + metadata: + url: 'http://selenium-hub:4444/graphql' + browserName: 'chrome' + platformName: 'Linux' + unsafeSsl : 'true' +``` + +Noted: +- From `v2.16.1+`, the trigger metadata `browserVersion`, `platformName` is recommended to be set explicitly to have the correct scaling behavior (especially when your Grid includes autoscaling Nodes, non-autoscaling Nodes, relay Nodes, etc.). Besides that, in client binding, it is also recommended to set the `browserVersion`, `platformName` to align with the trigger metadata. Please see below examples for more details. + +The above example will create Chrome browser nodes equal to the requests pending in session queue for Chrome browser, which is created from client. For example in Python binding + +```python +options = ChromeOptions() +options.set_capability('platformName', 'Linux') +driver = webdriver.Remote(options=options, command_executor=SELENIUM_GRID_URL) +``` + +With above script, the request is sent to Grid. Via GraphQL response, it looks like + +```json +{ + "data": { + "grid": { + "sessionCount": 0, + "maxSession": 0, + "totalSlots": 0 + }, + "nodesInfo": { + "nodes": [] + }, + "sessionsInfo": { + "sessionQueueRequests": [ + "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}" + ] + } + } +} +``` + +In Node deployment spec, there is environment variable `SE_NODE_BROWSER_VERSION` which is set to empty. This is used to unset `browserVersion` in Node stereotypes (it is in project [docker-selenium](https://github.com/SeleniumHQ/docker-selenium) setting short browser build number by default), which is expected to match with the request capabilities in queue and scaler trigger metadata. + +When the request capabilities match with scaler trigger metadata, the scaler will create a new Node and connect to the Hub. Now the GraphQL response looks like + +```json +{ + "data": { + "grid": { + "sessionCount": 0, + "maxSession": 1, + "totalSlots": 1 + }, + "nodesInfo": { + "nodes": [ + { + "id": "UUID-of-Node", + "status": "UP", + "sessionCount": 0, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"Linux\"}}]", + "sessions": [] + } + ] + }, + "sessionsInfo": { + "sessionQueueRequests": [ + "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}" + ] + } + } +} +``` + +Now, the request can be picked up by the Node and the session is created. Session queue will be cleared and the scaler will not create a new Node until the next request comes in. + +Moreover, at the same time, you can create one more scaled object for Chrome browser request with specific `browserVersion`. For example + +```yaml +kind: Deployment +metadata: + name: selenium-node-chrome-131 + labels: + deploymentName: selenium-node-chrome-131 +spec: + replicas: 1 + template: + spec: + containers: + - name: selenium-node-chrome + image: selenium/node-chrome:131.0 + ports: + - containerPort: 5555 + +--- + +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: selenium-grid-scaledobject-chrome-131 namespace: keda labels: - deploymentName: selenium-chrome-node + deploymentName: selenium-node-chrome-131 spec: maxReplicaCount: 8 scaleTargetRef: - name: selenium-chrome-node + name: selenium-node-chrome-131 triggers: - type: selenium-grid metadata: url: 'http://selenium-hub:4444/graphql' browserName: 'chrome' + platformName: 'Linux' + browserVersion: '131.0' + unsafeSsl : 'true' ``` -The above example will create Chrome browser nodes equal to the requests pending in session queue for Chrome browser. +The request to trigger this scaler should be + +```python +options = ChromeOptions() +options.set_capability('platformName', 'Linux') +options.set_capability('browserVersion', '131.0') +driver = webdriver.Remote(options=options, command_executor=SELENIUM_GRID_URL) +``` -Similarly for Firefox +Similarly, for Firefox ```yaml apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: - name: selenium-grid-firefox-scaledobject + name: selenium-grid-scaledobject-firefox namespace: keda labels: - deploymentName: selenium-firefox-node + deploymentName: selenium-node-firefox spec: maxReplicaCount: 8 scaleTargetRef: - name: selenium-firefox-node + name: selenium-node-firefox triggers: - type: selenium-grid metadata: url: 'http://selenium-hub:4444/graphql' browserName: 'firefox' + platformName: 'Linux' + unsafeSsl : 'true' ``` -Similarly for Edge. Note that for Edge you must set the `sessionBrowserName` to `msedge` inorder for scaling to work properly. +Request to trigger the scaler + +```python +options = FirefoxOptions() +options.set_capability('platformName', 'Linux') +driver = webdriver.Remote(options=options, command_executor=SELENIUM_GRID_URL) +``` + +Similarly, for Edge. Note that for Edge you must set the `sessionBrowserName` to `msedge` inorder for scaling to work properly. ```yaml apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: - name: selenium-grid-edge-scaledobject + name: selenium-grid-scaledobject-edge namespace: keda labels: - deploymentName: selenium-edge-node + deploymentName: selenium-node-edge spec: maxReplicaCount: 8 scaleTargetRef: - name: selenium-edge-node + name: selenium-node-edge triggers: - type: selenium-grid metadata: url: 'http://selenium-hub:4444/graphql' browserName: 'MicrosoftEdge' sessionBrowserName: 'msedge' + platformName: 'Linux' + unsafeSsl : 'true' +``` + +Request to trigger the scaler + +```python +options = EdgeOptions() +options.set_capability('platformName', 'Linux') +driver = webdriver.Remote(options=options, command_executor=SELENIUM_GRID_URL) ``` In case you want to scale from 0 (`minReplicaCount: 0`), and browser nodes are configured different `--max-sessions` greater than 1, you can set `nodeMaxSessions` for scaler align with number of slots available per node to have the correct scaling behavior. @@ -126,17 +280,19 @@ metadata: name: selenium-grid-chrome-scaledobject namespace: keda labels: - deploymentName: selenium-chrome-node + deploymentName: selenium-node-chrome spec: maxReplicaCount: 8 scaleTargetRef: - name: selenium-chrome-node + name: selenium-node-chrome triggers: - type: selenium-grid metadata: url: 'http://selenium-hub:4444/graphql' browserName: 'chrome' + platformName: 'Linux' nodeMaxSessions: 4 + unsafeSsl : 'true' ``` If you are supporting multiple versions of browser capability in your Selenium Grid, You should create one scaler for every browser version and pass the `browserVersion` in the metadata. @@ -148,17 +304,19 @@ metadata: name: selenium-grid-chrome-91-scaledobject namespace: keda labels: - deploymentName: selenium-chrome-node-91 + deploymentName: selenium-node-chrome-91 spec: maxReplicaCount: 8 scaleTargetRef: - name: selenium-chrome-node-91 + name: selenium-node-chrome-91 triggers: - type: selenium-grid metadata: url: 'http://selenium-hub:4444/graphql' browserName: 'chrome' + platformName: 'Linux' browserVersion: '91.0' + unsafeSsl : 'true' ``` ```yaml @@ -168,17 +326,19 @@ metadata: name: selenium-grid-chrome-90-scaledobject namespace: keda labels: - deploymentName: selenium-chrome-node-90 + deploymentName: selenium-node-chrome-90 spec: maxReplicaCount: 8 scaleTargetRef: - name: selenium-chrome-node-90 + name: selenium-node-chrome-90 triggers: - type: selenium-grid metadata: url: 'http://selenium-hub:4444/graphql' browserName: 'chrome' + platformName: 'Linux' browserVersion: '90.0' + unsafeSsl : 'true' ``` ### Authentication Parameters @@ -224,15 +384,17 @@ metadata: name: selenium-grid-chrome-scaledobject namespace: keda labels: - deploymentName: selenium-chrome-node + deploymentName: selenium-node-chrome spec: maxReplicaCount: 8 scaleTargetRef: - name: selenium-chrome-node + name: selenium-node-chrome triggers: - type: selenium-grid metadata: browserName: 'chrome' + platformName: 'Linux' + unsafeSsl : 'true' authenticationRef: name: keda-trigger-auth-selenium-grid-secret ``` diff --git a/.keda/scalers/selenium_grid_scaler.go b/.keda/scalers/selenium_grid_scaler.go index bb18d7c97..1929e7716 100644 --- a/.keda/scalers/selenium_grid_scaler.go +++ b/.keda/scalers/selenium_grid_scaler.go @@ -33,12 +33,12 @@ type seleniumGridScalerMetadata struct { Username string `keda:"name=username, order=authParams;resolvedEnv, optional"` Password string `keda:"name=password, order=authParams;resolvedEnv, optional"` AccessToken string `keda:"name=accessToken, order=authParams;resolvedEnv, optional"` - BrowserName string `keda:"name=browserName, order=triggerMetadata"` + BrowserName string `keda:"name=browserName, order=triggerMetadata, optional"` SessionBrowserName string `keda:"name=sessionBrowserName, order=triggerMetadata, optional"` + BrowserVersion string `keda:"name=browserVersion, order=triggerMetadata, optional"` + PlatformName string `keda:"name=platformName, order=triggerMetadata, optional"` ActivationThreshold int64 `keda:"name=activationThreshold, order=triggerMetadata, optional"` - BrowserVersion string `keda:"name=browserVersion, order=triggerMetadata, default=latest"` UnsafeSsl bool `keda:"name=unsafeSsl, order=triggerMetadata, default=false"` - PlatformName string `keda:"name=platformName, order=triggerMetadata, default=linux"` NodeMaxSessions int64 `keda:"name=nodeMaxSessions, order=triggerMetadata, default=1"` TargetValue int64 @@ -96,9 +96,9 @@ type Slot struct { } type Capability struct { - BrowserName string `json:"browserName"` - BrowserVersion string `json:"browserVersion"` - PlatformName string `json:"platformName"` + BrowserName string `json:"browserName,omitempty"` + BrowserVersion string `json:"browserVersion,omitempty"` + PlatformName string `json:"platformName,omitempty"` } type Stereotypes []struct { @@ -106,10 +106,6 @@ type Stereotypes []struct { Stereotype Capability `json:"stereotype"` } -const ( - DefaultBrowserVersion string = "latest" -) - func NewSeleniumGridScaler(config *scalersconfig.ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { @@ -227,22 +223,22 @@ func (s *seleniumGridScaler) getSessionsQueueLength(ctx context.Context, logger return newRequestNodes, onGoingSession, nil } -func countMatchingSlotsStereotypes(stereotypes Stereotypes, request Capability, browserName string, browserVersion string, sessionBrowserName string, platformName string) int64 { +func countMatchingSlotsStereotypes(stereotypes Stereotypes, browserName string, browserVersion string, sessionBrowserName string, platformName string) int64 { var matchingSlots int64 for _, stereotype := range stereotypes { - if checkCapabilitiesMatch(stereotype.Stereotype, request, browserName, browserVersion, sessionBrowserName, platformName) { + if checkStereotypeCapabilitiesMatch(stereotype.Stereotype, browserName, browserVersion, sessionBrowserName, platformName) { matchingSlots += stereotype.Slots } } return matchingSlots } -func countMatchingSessions(sessions Sessions, request Capability, browserName string, browserVersion string, sessionBrowserName string, platformName string, logger logr.Logger) int64 { +func countMatchingSessions(sessions Sessions, browserName string, browserVersion string, sessionBrowserName string, platformName string, logger logr.Logger) int64 { var matchingSessions int64 for _, session := range sessions { var capability = Capability{} - if err := json.Unmarshal([]byte(session.Capabilities), &capability); err == nil { - if checkCapabilitiesMatch(capability, request, browserName, browserVersion, sessionBrowserName, platformName) { + if err := json.Unmarshal([]byte(session.Slot.Stereotype), &capability); err == nil { + if checkStereotypeCapabilitiesMatch(capability, browserName, browserVersion, sessionBrowserName, platformName) { matchingSessions++ } } else { @@ -252,27 +248,40 @@ func countMatchingSessions(sessions Sessions, request Capability, browserName st return matchingSessions } -func checkCapabilitiesMatch(capability Capability, requestCapability Capability, browserName string, browserVersion string, sessionBrowserName string, platformName string) bool { - // Ensure the logic should be aligned with DefaultSlotMatcher in Selenium Grid - SeleniumHQ/selenium/java/src/org/openqa/selenium/grid/data/DefaultSlotMatcher.java - // A browserName matches when one of the following conditions is met: - // 1. `browserName` in capability matches with `browserName` or `sessionBrowserName` in scaler metadata - // 2. `browserName` in request capability is empty or not provided - var browserNameMatches = strings.EqualFold(capability.BrowserName, browserName) || strings.EqualFold(capability.BrowserName, sessionBrowserName) || - requestCapability.BrowserName == "" - // A browserVersion matches when one of the following conditions is met: - // 1. `browserVersion` in request capability is empty or not provided or `stable` - // 2. `browserVersion` in capability matches with prefix of the scaler metadata `browserVersion` - // 3. `browserVersion` in scaler metadata is `latest` - var browserVersionMatches = requestCapability.BrowserVersion == "" || requestCapability.BrowserVersion == "stable" || - strings.HasPrefix(capability.BrowserVersion, browserVersion) || browserVersion == DefaultBrowserVersion - // A platformName matches when one of the following conditions is met: - // 1. `platformName` in request capability is empty or not provided - // 2. `platformName` in capability is empty or not provided - // 3. `platformName` in capability matches with the scaler metadata `platformName` - // 4. `platformName` in scaler metadata is empty or not provided - var platformNameMatches = requestCapability.PlatformName == "" || capability.PlatformName == "" || - strings.EqualFold(capability.PlatformName, platformName) || platformName == "" - return browserNameMatches && browserVersionMatches && platformNameMatches +// This function checks if the request capabilities match the scaler metadata +func checkRequestCapabilitiesMatch(request Capability, browserName string, browserVersion string, _ string, platformName string) bool { + // Check if browserName matches + browserNameMatch := request.BrowserName == "" && browserName == "" || + strings.EqualFold(browserName, request.BrowserName) + + // Check if browserVersion matches + browserVersionMatch := (request.BrowserVersion == "" && browserVersion == "") || + (request.BrowserVersion == "stable" && browserVersion == "") || + (strings.HasPrefix(browserVersion, request.BrowserVersion) && request.BrowserVersion != "" && browserVersion != "") + + // Check if platformName matches + platformNameMatch := request.PlatformName == "" && platformName == "" || + strings.EqualFold(platformName, request.PlatformName) + + return browserNameMatch && browserVersionMatch && platformNameMatch +} + +// This function checks if Node stereotypes or ongoing sessions match the scaler metadata +func checkStereotypeCapabilitiesMatch(capability Capability, browserName string, browserVersion string, sessionBrowserName string, platformName string) bool { + // Check if browserName matches + browserNameMatch := capability.BrowserName == "" && browserName == "" || + strings.EqualFold(browserName, capability.BrowserName) || + strings.EqualFold(sessionBrowserName, capability.BrowserName) + + // Check if browserVersion matches + browserVersionMatch := capability.BrowserVersion == "" && browserVersion == "" || + (strings.HasPrefix(browserVersion, capability.BrowserVersion) && capability.BrowserVersion != "" && browserVersion != "") + + // Check if platformName matches + platformNameMatch := capability.PlatformName == "" && platformName == "" || + strings.EqualFold(platformName, capability.PlatformName) + + return browserNameMatch && browserVersionMatch && platformNameMatch } func checkNodeReservedSlots(reservedNodes []ReservedNodes, nodeID string, availableSlots int64) int64 { @@ -318,7 +327,7 @@ func getCountFromSeleniumResponse(b []byte, browserName string, browserVersion s var isRequestMatched bool var requestCapability = Capability{} if err := json.Unmarshal([]byte(sessionQueueRequest), &requestCapability); err == nil { - if checkCapabilitiesMatch(requestCapability, requestCapability, browserName, browserVersion, sessionBrowserName, platformName) { + if checkRequestCapabilitiesMatch(requestCapability, browserName, browserVersion, sessionBrowserName, platformName) { queueSlots++ isRequestMatched = true } @@ -326,28 +335,24 @@ func getCountFromSeleniumResponse(b []byte, browserName string, browserVersion s logger.Error(err, fmt.Sprintf("Error when unmarshaling sessionQueueRequest capability: %s", err)) } - // Skip the request if the capability does not match the scaler parameters - if !isRequestMatched { - continue - } - var isRequestReserved bool - var sumOfCurrentSessionsMatch int64 // Check if the matched request can be assigned to available slots of existing Nodes in the Grid for _, node := range nodes { - // Count ongoing sessions that match the request capability and scaler metadata - var currentSessionsMatch = countMatchingSessions(node.Sessions, requestCapability, browserName, browserVersion, sessionBrowserName, platformName, logger) - sumOfCurrentSessionsMatch += currentSessionsMatch // Check if node is UP and has available slots (maxSession > sessionCount) - if strings.EqualFold(node.Status, "UP") && checkNodeReservedSlots(reservedNodes, node.ID, node.MaxSession-node.SessionCount) > 0 { + if isRequestMatched && strings.EqualFold(node.Status, "UP") && checkNodeReservedSlots(reservedNodes, node.ID, node.MaxSession-node.SessionCount) > 0 { var stereotypes = Stereotypes{} var availableSlotsMatch int64 if err := json.Unmarshal([]byte(node.Stereotypes), &stereotypes); err == nil { // Count available slots that match the request capability and scaler metadata - availableSlotsMatch += countMatchingSlotsStereotypes(stereotypes, requestCapability, browserName, browserVersion, sessionBrowserName, platformName) + availableSlotsMatch += countMatchingSlotsStereotypes(stereotypes, browserName, browserVersion, sessionBrowserName, platformName) } else { logger.Error(err, fmt.Sprintf("Error when unmarshaling node stereotypes: %s", err)) } + if availableSlotsMatch == 0 { + continue + } + // Count ongoing sessions that match the request capability and scaler metadata + var currentSessionsMatch = countMatchingSessions(node.Sessions, browserName, browserVersion, sessionBrowserName, platformName, logger) // Count remaining available slots can be reserved for this request var availableSlotsCanBeReserved = checkNodeReservedSlots(reservedNodes, node.ID, node.MaxSession-node.SessionCount) // Reserve one available slot for the request if available slots match is greater than current sessions match @@ -359,11 +364,8 @@ func getCountFromSeleniumResponse(b []byte, browserName string, browserVersion s } } } - if sumOfCurrentSessionsMatch > onGoingSessions { - onGoingSessions = sumOfCurrentSessionsMatch - } // Check if the matched request can be assigned to available slots of new Nodes will be scaled up, since the scaler parameter `nodeMaxSessions` can be greater than 1 - if !isRequestReserved { + if isRequestMatched && !isRequestReserved { for _, newRequestNode := range newRequestNodes { if newRequestNode.SlotCount > 0 { newRequestNodes = updateOrAddReservedNode(newRequestNodes, newRequestNode.ID, newRequestNode.SlotCount-1, nodeMaxSessions) @@ -373,10 +375,15 @@ func getCountFromSeleniumResponse(b []byte, browserName string, browserVersion s } } // Check if a new Node should be scaled up to reserve for the matched request - if !isRequestReserved { + if isRequestMatched && !isRequestReserved { newRequestNodes = updateOrAddReservedNode(newRequestNodes, string(rune(requestIndex)), nodeMaxSessions-1, nodeMaxSessions) } } + // Count ongoing sessions across all nodes that match the scaler metadata + for _, node := range nodes { + onGoingSessions += countMatchingSessions(node.Sessions, browserName, browserVersion, sessionBrowserName, platformName, logger) + } + return int64(len(newRequestNodes)), onGoingSessions, nil } diff --git a/.keda/scalers/selenium_grid_scaler_test.go b/.keda/scalers/selenium_grid_scaler_test.go index 6613be242..7e892479d 100644 --- a/.keda/scalers/selenium_grid_scaler_test.go +++ b/.keda/scalers/selenium_grid_scaler_test.go @@ -63,6 +63,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { browserName: "", }, wantNewRequestNodes: 0, + wantOnGoingSessions: 0, wantErr: false, }, { @@ -99,14 +100,15 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { `), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", }, wantNewRequestNodes: 4, + wantOnGoingSessions: 0, wantErr: false, }, { - name: "2 sessionQueueRequests and 1 available nodeStereotypes with matching browserName firefox should return count as 1", + name: "2_sessionQueueRequests_and_1_available_nodeStereotypes_with_matching_browserName_firefox_should_return_count_as_1", args: args{ b: []byte(`{ "data": { @@ -123,14 +125,14 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 1, "maxSession": 1, "slotCount": 1, - "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"chrome\",\n \"browserVersion\": \"128.0\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-m5n8z-4br6x\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", + "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"chrome\",\n \"browserVersion\": \"\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-m5n8z-4br6x\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", "sessions": [ { "id": "reserved", "capabilities": "{\n \"browserName\": \"chrome\",\n \"browserVersion\": \"128.0\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-m5n8z-4br6x\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}", "slot": { "id": "83c9d9f5-f79d-4dea-bc9b-ce61bf2bc01c", - "stereotype": "{\n \"browserName\": \"chrome\",\n \"browserVersion\": \"128.0\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-m5n8z-4br6x\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" + "stereotype": "{\n \"browserName\": \"chrome\",\n \"browserVersion\": \"\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-m5n8z-4br6x\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" } } ] @@ -141,14 +143,14 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 1, "maxSession": 1, "slotCount": 1, - "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"firefox\",\n \"browserVersion\": \"130.0\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-s2gq6-82lwb\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", + "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"firefox\",\n \"browserVersion\": \"\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-s2gq6-82lwb\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", "sessions": [ { "id": "reserved", "capabilities": "{\n \"browserName\": \"firefox\",\n \"browserVersion\": \"130.0\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-s2gq6-82lwb\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}", "slot": { "id": "b03b80c0-95f8-4b9c-ba06-bebd2568ce3d", - "stereotype": "{\n \"browserName\": \"firefox\",\n \"browserVersion\": \"130.0\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-s2gq6-82lwb\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" + "stereotype": "{\n \"browserName\": \"firefox\",\n \"browserVersion\": \"\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-s2gq6-82lwb\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" } } ] @@ -159,7 +161,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 0, "maxSession": 1, "slotCount": 1, - "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"chrome\",\n \"browserVersion\": \"128.0\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-xh95p-9c2cl\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", + "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"chrome\",\n \"browserVersion\": \"\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-xh95p-9c2cl\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", "sessions": [] }, { @@ -168,14 +170,14 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 1, "maxSession": 1, "slotCount": 1, - "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"chrome\",\n \"browserVersion\": \"128.0\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-j2xbn-lq76c\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", + "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"chrome\",\n \"browserVersion\": \"\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-j2xbn-lq76c\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", "sessions": [ { "id": "reserved", "capabilities": "{\n \"browserName\": \"chrome\",\n \"browserVersion\": \"128.0\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-j2xbn-lq76c\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}", "slot": { "id": "9d91cd87-b443-4a0c-93e7-eea8c4661207", - "stereotype": "{\n \"browserName\": \"chrome\",\n \"browserVersion\": \"128.0\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-j2xbn-lq76c\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" + "stereotype": "{\n \"browserName\": \"chrome\",\n \"browserVersion\": \"\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-j2xbn-lq76c\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" } } ] @@ -186,14 +188,14 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 1, "maxSession": 1, "slotCount": 1, - "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"firefox\",\n \"browserVersion\": \"130.0\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-xk6mm-2m6jh\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", + "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"firefox\",\n \"browserVersion\": \"\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-xk6mm-2m6jh\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", "sessions": [ { "id": "reserved", "capabilities": "{\n \"browserName\": \"firefox\",\n \"browserVersion\": \"130.0\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-xk6mm-2m6jh\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}", "slot": { "id": "2c1fc5c4-881a-48fd-9b9e-b4d3ecbc1bd8", - "stereotype": "{\n \"browserName\": \"firefox\",\n \"browserVersion\": \"130.0\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-xk6mm-2m6jh\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" + "stereotype": "{\n \"browserName\": \"firefox\",\n \"browserVersion\": \"\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-xk6mm-2m6jh\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" } } ] @@ -204,14 +206,14 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 1, "maxSession": 1, "slotCount": 1, - "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"firefox\",\n \"browserVersion\": \"130.0\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-bvq59-6dh6q\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", + "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"firefox\",\n \"browserVersion\": \"\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-bvq59-6dh6q\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", "sessions": [ { "id": "reserved", "capabilities": "{\n \"browserName\": \"firefox\",\n \"browserVersion\": \"130.0\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-bvq59-6dh6q\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}", "slot": { "id": "5f8f9ba0-0f61-473e-b367-b68d9368dc24", - "stereotype": "{\n \"browserName\": \"firefox\",\n \"browserVersion\": \"130.0\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-bvq59-6dh6q\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" + "stereotype": "{\n \"browserName\": \"firefox\",\n \"browserVersion\": \"\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-bvq59-6dh6q\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" } } ] @@ -222,7 +224,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 0, "maxSession": 1, "slotCount": 1, - "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"firefox\",\n \"browserVersion\": \"130.0\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-42xbf-zpdd4\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", + "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"firefox\",\n \"browserVersion\": \"\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-42xbf-zpdd4\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", "sessions": [] }, { @@ -231,14 +233,14 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 1, "maxSession": 1, "slotCount": 1, - "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"firefox\",\n \"browserVersion\": \"130.0\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-qt9z2-6xx86\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", + "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"firefox\",\n \"browserVersion\": \"\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-qt9z2-6xx86\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", "sessions": [ { "id": "reserved", "capabilities": "{\n \"browserName\": \"firefox\",\n \"browserVersion\": \"130.0\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-qt9z2-6xx86\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}", "slot": { "id": "38bd0b09-ffe0-46e9-8983-bd208270c8da", - "stereotype": "{\n \"browserName\": \"firefox\",\n \"browserVersion\": \"130.0\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-qt9z2-6xx86\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" + "stereotype": "{\n \"browserName\": \"firefox\",\n \"browserVersion\": \"\",\n \"moz:firefoxOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002ffirefox\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-firefox-name-qt9z2-6xx86\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" } } ] @@ -249,14 +251,14 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 1, "maxSession": 1, "slotCount": 1, - "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"chrome\",\n \"browserVersion\": \"128.0\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-v7nrv-xsfkb\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", + "stereotypes": "[\n {\n \"slots\": 1,\n \"stereotype\": {\n \"browserName\": \"chrome\",\n \"browserVersion\": \"\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-v7nrv-xsfkb\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", "sessions": [ { "id": "reserved", - "capabilities": "{\n \"browserName\": \"chrome\",\n \"browserVersion\": \"128.0\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-v7nrv-xsfkb\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}", + "capabilities": "{\n \"browserName\": \"chrome\",\n \"browserVersion\": \"\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-v7nrv-xsfkb\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}", "slot": { "id": "43b992cc-39bb-4b0f-92b6-99603a543459", - "stereotype": "{\n \"browserName\": \"chrome\",\n \"browserVersion\": \"128.0\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-v7nrv-xsfkb\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" + "stereotype": "{\n \"browserName\": \"chrome\",\n \"browserVersion\": \"\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"platformName\": \"linux\",\n \"se:containerName\": \"my-chrome-name-v7nrv-xsfkb\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n}" } } ] @@ -274,15 +276,15 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { `), browserName: "firefox", sessionBrowserName: "firefox", - browserVersion: "latest", + browserVersion: "", platformName: "linux", }, - wantNewRequestNodes: 1, + wantNewRequestNodes: 0, wantOnGoingSessions: 4, wantErr: false, }, { - name: "1 sessionQueueRequests and 1 available nodeStereotypes with matching browserName chrome should return count as 0", + name: "1_sessionQueueRequests_and_1_available_nodeStereotypes_with_matching_browserName_chrome_should_return_count_as_0", args: args{ b: []byte(`{ "data": { @@ -324,14 +326,15 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { `), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", }, - wantNewRequestNodes: 0, + wantNewRequestNodes: 1, + wantOnGoingSessions: 0, wantErr: false, }, { - name: "1 sessionQueueRequests Linux and 1 available nodeStereotypes Windows with matching browserName chrome should return count as 1", + name: `Given_2_requests_with_explicit_name_version_platform_When_2_existing_node_with_platform_not_matching_And_scaler_metadata_with_browser_version_as_latest_Then_scaler_should_not_scale_up_and_return_0`, args: args{ b: []byte(`{ "data": { @@ -373,14 +376,15 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { `), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", }, - wantNewRequestNodes: 1, + wantNewRequestNodes: 0, + wantOnGoingSessions: 0, wantErr: false, }, { - name: "scaler browserVersion is latest, 2 sessionQueueRequests wihtout browserVersion, 2 available nodeStereotypes with different versions and platforms, should return count as 1", + name: "scaler_browserVersion_is_latest,_2_sessionQueueRequests_without_browserVersion,_2_available_nodeStereotypes_with_different_versions_and_platforms,_should_return_count_as_1", args: args{ b: []byte(`{ "data": { @@ -397,7 +401,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 0, "maxSession": 1, "slotCount": 1, - "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}}]", + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\"}}]", "sessions": [] }, { @@ -406,7 +410,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 0, "maxSession": 1, "slotCount": 1, - "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"92.0\", \"platformName\": \"Windows 11\"}}]", + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"Windows 11\"}}]", "sessions": [] } ] @@ -421,14 +425,15 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { }`), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", }, wantNewRequestNodes: 1, + wantOnGoingSessions: 0, wantErr: false, }, { - name: "scaler browserVersion is latest, 5 sessionQueueRequests wihtout browserVersion also 1 different platformName, 1 available nodeStereotypes with 3 slots Linux and 1 node Windows, should return count as 1", + name: "scaler_browserVersion_is_latest,_5_sessionQueueRequests_wihtout_browserVersion_also_1_different_platformName,_1_available_nodeStereotypes_with_3_slots_Linux_and_1_node_Windows,_should_return_count_as_1", args: args{ b: []byte(`{ "data": { @@ -445,7 +450,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 0, "maxSession": 3, "slotCount": 3, - "stereotypes": "[{\"slots\": 3, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}}]", + "stereotypes": "[{\"slots\": 3, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\"}}]", "sessions": [] }, { @@ -454,7 +459,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 0, "maxSession": 3, "slotCount": 3, - "stereotypes": "[{\"slots\": 3, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"92.0\", \"platformName\": \"Windows 11\"}}]", + "stereotypes": "[{\"slots\": 3, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"Windows 11\"}}]", "sessions": [] } ] @@ -472,10 +477,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { }`), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", }, wantNewRequestNodes: 1, + wantOnGoingSessions: 0, wantErr: false, }, { @@ -500,7 +506,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"firefox\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"firefox\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"firefox\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] } @@ -519,6 +529,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { platformName: "linux", }, wantNewRequestNodes: 1, + wantOnGoingSessions: 0, wantErr: false, }, { @@ -543,7 +554,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] }, @@ -557,7 +572,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-2", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] } @@ -625,6 +644,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { platformName: "linux", }, wantNewRequestNodes: 0, + wantOnGoingSessions: 0, wantErr: false, }, { @@ -649,7 +669,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] }, @@ -663,7 +687,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-2", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] } @@ -708,11 +736,19 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } }, { "id": "session-2", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] } @@ -756,7 +792,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] }, @@ -770,7 +810,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-2", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] } @@ -795,7 +839,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { wantErr: false, }, { - name: "3 queue requests with browserName browserVersion and platformName but 2 running nodes are busy with different versions should return count as 3", + name: "Given_3_requests_explicit_name_version_platform_When_2_existing_nodes_not_available_And_scaler_metadate_with_browserVersion_as_latest_Then_scaler_should_not_scale_up_and_return_2_on_going_session", args: args{ b: []byte(`{ "data": { @@ -816,7 +860,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] }, @@ -830,7 +878,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-2", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] } @@ -847,11 +899,79 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { }`), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", }, - wantNewRequestNodes: 3, - wantOnGoingSessions: 2, + wantNewRequestNodes: 0, + wantOnGoingSessions: 0, + wantErr: false, + }, + { + name: "Given_3_requests_explicit_name_version_platform_When_2_existing_nodes_not_available_And_scaler_metadate_with_browserVersion_92.0_Then_scaler_should_scale_up_1_and_return_0_on_going_session", + args: args{ + b: []byte(`{ + "data": { + "grid": { + "sessionCount": 2, + "maxSession": 2, + "totalSlots": 2 + }, + "nodesInfo": { + "nodes": [ + { + "id": "node-1", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-2", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-2", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } + } + ] + } + ] + }, + "sessionsInfo": { + "sessionQueueRequests": [ + "{\"browserName\": \"chrome\", \"browserVersion\": \"90.0\", \"platformName\": \"linux\"}", + "{\"browserName\": \"chrome\", \"browserVersion\": \"92.0\", \"platformName\": \"linux\"}", + "{\"browserName\": \"chrome\", \"browserVersion\": \"93.0\", \"platformName\": \"linux\"}" + ] + } + } + }`), + browserName: "chrome", + sessionBrowserName: "chrome", + browserVersion: "92.0", + platformName: "linux", + }, + wantNewRequestNodes: 1, + wantOnGoingSessions: 0, wantErr: false, }, { @@ -876,7 +996,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}" + } } ] }, @@ -890,7 +1014,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-2", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}" + } } ] } @@ -907,7 +1035,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { }`), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", }, wantNewRequestNodes: 3, @@ -936,7 +1064,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] } @@ -960,7 +1092,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { wantErr: false, }, { - name: "1 request without browserName and browserVersion stable can be match any available node should return count as 0", + name: "1_request_without_browserVersion_can_be_match_any_available_node_should_return_count_as_0", args: args{ b: []byte(`{ "data": { @@ -984,21 +1116,22 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { }, "sessionsInfo": { "sessionQueueRequests": [ - "{\"browserVersion\": \"stable\", \"platformName\": \"linux\"}" + "{\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\"}" ] } } }`), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", }, - wantNewRequestNodes: 0, + wantNewRequestNodes: 1, + wantOnGoingSessions: 0, wantErr: false, }, { - name: "1 request without browserName and browserVersion stable should return count as 1", + name: "1 request without platformName and browserVersion should return count as 1", args: args{ b: []byte(`{ "data": { @@ -1015,11 +1148,15 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 1, "maxSession": 1, "slotCount": 1, - "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"v128.0\", \"platformName\": \"linux\"}}]", + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}}]", "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"v128.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}" + } } ] } @@ -1027,18 +1164,18 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { }, "sessionsInfo": { "sessionQueueRequests": [ - "{\"browserVersion\": \"stable\", \"platformName\": \"linux\"}" + "{\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"\"}" ] } } }`), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", - platformName: "linux", + browserVersion: "", + platformName: "", }, wantNewRequestNodes: 1, - wantOnGoingSessions: 1, + wantOnGoingSessions: 0, wantErr: false, }, { @@ -1063,7 +1200,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"msedge\", \"browserVersion\": \"dev\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"msedge\", \"browserVersion\": \"dev\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"msedge\", \"browserVersion\": \"dev\", \"platformName\": \"linux\"}" + } } ] } @@ -1108,7 +1249,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"msedge\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"msedge\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"msedge\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] } @@ -1168,9 +1313,10 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { platformName: "linux", }, wantNewRequestNodes: 1, + wantOnGoingSessions: 0, wantErr: false, }, { - name: "2 queue requests with platformName and without platformName and node with 1 slot available should return count as 1", + name: "2_queue_requests_with_platformName_and_without_platformName_and_node_with_1_slot_available_should_return_count_as_1", args: args{ b: []byte(`{ "data": { @@ -1191,7 +1337,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"Windows 11\"}" + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"Windows 11\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"91.0\", \"platformName\": \"Windows 11\"}" + } } ] } @@ -1210,7 +1360,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { browserVersion: "91.0", platformName: "Windows 11", }, - wantNewRequestNodes: 1, + wantNewRequestNodes: 0, wantOnGoingSessions: 1, wantErr: false, }, @@ -1236,7 +1386,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"msedge\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"msedge\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"msedge\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] } @@ -1252,10 +1406,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { }`), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", }, wantNewRequestNodes: 2, + wantOnGoingSessions: 0, wantErr: false, }, { @@ -1280,7 +1435,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "session-1", - "capabilities": "{\"browserName\": \"msedge\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + "capabilities": "{\"browserName\": \"msedge\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"msedge\", \"browserVersion\": \"91.0\", \"platformName\": \"linux\"}" + } } ] } @@ -1297,14 +1456,15 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { }`), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", }, wantNewRequestNodes: 3, + wantOnGoingSessions: 0, wantErr: false, }, { - name: "session request with matching browsername and no specific platformName should return count as 2", + name: "Given_2_requests_with_1_matching_browser_name_and_1_mismatch_platformName_When_no_node_available_Then_scaler_should_return_1_for_matching_request_and_0_ongoing_session", args: args{ b: []byte(`{ "data": { @@ -1326,14 +1486,15 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { }`), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "", }, - wantNewRequestNodes: 2, + wantNewRequestNodes: 1, + wantOnGoingSessions: 0, wantErr: false, }, { - name: "2 queue requests with 1 matching browsername and platformName and 1 existing slot is available should return count as 0", + name: "2_queue_requests_with_1_matching_browsername_and_platformName_and_1_existing_slot_is_available_should_return_count_as_1", args: args{ b: []byte(`{ "data": { @@ -1365,14 +1526,15 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { }`), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "Windows 11", }, - wantNewRequestNodes: 0, + wantNewRequestNodes: 1, + wantOnGoingSessions: 0, wantErr: false, }, { - name: "2 queue requests with 1 request matching browserName and platformName but 1 existing node is busy should return count as 1", + name: "Given_2_requests_without_browserVersion_When_scaler_metadata_explicit_name_version_platform_Then_scaler_should_not_scale_up_and_return_1_on_going_session", args: args{ b: []byte(`{ "data": { @@ -1389,15 +1551,23 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionCount": 2, "maxSession": 2, "slotCount": 2, - "stereotypes": "[\n {\n \"slots\": 2,\n \"stereotype\": {\n \"browserName\": \"chrome\",\n \"browserVersion\": \"128.0\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"se:containerName\": \"my-chrome-name-m5n8z-4br6x\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", + "stereotypes": "[\n {\n \"slots\": 2,\n \"stereotype\": {\n \"browserName\": \"chrome\",\n \"browserVersion\": \"91.0\",\n \"browserPlatform\": \"Windows 11\",\n \"goog:chromeOptions\": {\n \"binary\": \"\\u002fusr\\u002fbin\\u002fchromium\"\n },\n \"se:containerName\": \"my-chrome-name-m5n8z-4br6x\",\n \"se:downloadsEnabled\": true,\n \"se:noVncPort\": 7900,\n \"se:vncEnabled\": true\n }\n }\n]", "sessions": [ { "id": "0f9c5a941aa4d755a54b84be1f6535b1", - "capabilities": "{\"browserName\": \"chrome\", \"platformName\": \"Windows 11\", \"browserVersion\": \"91.0\"}" + "capabilities": "{\"browserName\": \"chrome\", \"platformName\": \"Windows 11\", \"browserVersion\": \"91.0\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"platformName\": \"Windows 11\", \"browserVersion\": \"91.0\"}" + } }, { "id": "0f9c5a941aa4d755a54b84be1f6535b1", - "capabilities": "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"91.0\"}" + "capabilities": "{\"browserName\": \"chrome\", \"platformName\": \"Windows 11\", \"browserVersion\": \"91.0\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"platformName\": \"Windows 11\", \"browserVersion\": \"91.0\"}" + } } ] } @@ -1416,12 +1586,12 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { browserVersion: "91.0", platformName: "Windows 11", }, - wantNewRequestNodes: 1, - wantOnGoingSessions: 1, + wantNewRequestNodes: 0, + wantOnGoingSessions: 2, wantErr: false, }, { - name: "5 queue requests with scaler parameter nodeMaxSessions is 2 should return count as 3", + name: "Given_5_requests_explicit_name_version_platform_When_scaler_metadata_set_browserVersion_as_latest_Then_scaler_should_not_scale_up_for_those_request_and_return_0", args: args{ b: []byte(`{ "data": { @@ -1447,15 +1617,16 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { `), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", nodeMaxSessions: 2, }, - wantNewRequestNodes: 3, + wantNewRequestNodes: 0, + wantOnGoingSessions: 0, wantErr: false, }, { - name: "5 queue requests with scaler parameter nodeMaxSessions is 3 should return count as 2", + name: "Given_5_requests_explicit_name_version_platform_When_scaler_metadata_set_browserVersion_as_latest_Then_scaler_should_not_scale_up_for_those_requests_and_return_0", args: args{ b: []byte(`{ "data": { @@ -1481,15 +1652,16 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { `), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", nodeMaxSessions: 3, }, - wantNewRequestNodes: 2, + wantNewRequestNodes: 0, + wantOnGoingSessions: 0, wantErr: false, }, { - name: "5 queue requests with request matching browserName and platformName and scaler param nodeMaxSessions is 3 and existing node with 1 available slot should return count as 2", + name: "Given_5_requests_without_browserVersion_When_scaler_metadata_explicit_name_version_platform_Then_scaler_should_not_scaler_up_for_those_requests_and_return_0", args: args{ b: []byte(`{ "data": { @@ -1510,11 +1682,19 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessions": [ { "id": "0f9c5a941aa4d755a54b84be1f6535b1", - "capabilities": "{\"browserName\": \"chrome\", \"platformName\": \"Linux\", \"browserVersion\": \"91.0\"}" + "capabilities": "{\"browserName\": \"chrome\", \"platformName\": \"Linux\", \"browserVersion\": \"91.0\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"platformName\": \"Linux\", \"browserVersion\": \"91.0\"}" + } }, { "id": "0f9c5a941aa4d755a54b84be1f6535b1", - "capabilities": "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"91.0\"}" + "capabilities": "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"91.0\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"platformName\": \"Linux\", \"browserVersion\": \"91.0\"}" + } } ] } @@ -1537,7 +1717,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { platformName: "linux", nodeMaxSessions: 3, }, - wantNewRequestNodes: 2, + wantNewRequestNodes: 0, wantOnGoingSessions: 2, wantErr: false, }, @@ -1575,10 +1755,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { }`), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", }, wantNewRequestNodes: 0, + wantOnGoingSessions: 0, wantErr: false, }, { @@ -1617,10 +1798,11 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { }`), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", }, wantNewRequestNodes: 2, + wantOnGoingSessions: 0, wantErr: false, }, { @@ -1648,15 +1830,16 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { }`), browserName: "chrome", sessionBrowserName: "chrome", - browserVersion: "latest", + browserVersion: "", platformName: "linux", nodeMaxSessions: 2, }, wantNewRequestNodes: 2, + wantOnGoingSessions: 0, wantErr: false, }, { - name: "sessions requests and active sessions with 1 matching browsername, platformName and sessionBrowserVersion should return count as 1", + name: "Given_2_requests_include_1_without_browserVersion_When_scaler_metadata_explicit_name_version_platform_Then_scaler_should_scale_up_for_1_request_has_browserVersion_and_return_0_ongoing_sessions", args: args{ b: []byte(`{ "data": { @@ -1678,12 +1861,20 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { { "id": "0f9c5a941aa4d755a54b84be1f6535b1", "capabilities": "{\n \"acceptInsecureCerts\": false,\n \"browserName\": \"chrome\",\n \"browserVersion\": \"91.0.4472.114\",\n \"chrome\": {\n \"chromedriverVersion\": \"91.0.4472.101 (af52a90bf87030dd1523486a1cd3ae25c5d76c9b-refs\\u002fbranch-heads\\u002f4472@{#1462})\",\n \"userDataDir\": \"\\u002ftmp\\u002f.com.google.Chrome.DMqx9m\"\n },\n \"goog:chromeOptions\": {\n \"debuggerAddress\": \"localhost:35839\"\n },\n \"networkConnectionEnabled\": false,\n \"pageLoadStrategy\": \"normal\",\n \"platformName\": \"linux\",\n \"proxy\": {\n },\n \"se:cdp\": \"http:\\u002f\\u002flocalhost:35839\",\n \"se:cdpVersion\": \"91.0.4472.114\",\n \"se:vncEnabled\": true,\n \"se:vncLocalAddress\": \"ws:\\u002f\\u002flocalhost:7900\\u002fwebsockify\",\n \"setWindowRect\": true,\n \"strictFileInteractability\": false,\n \"timeouts\": {\n \"implicit\": 0,\n \"pageLoad\": 300000,\n \"script\": 30000\n },\n \"unhandledPromptBehavior\": \"dismiss and notify\",\n \"webauthn:extension:largeBlob\": true,\n \"webauthn:virtualAuthenticators\": true\n}", - "nodeId": "d44dcbc5-0b2c-4d5e-abf4-6f6aa5e0983c" + "nodeId": "d44dcbc5-0b2c-4d5e-abf4-6f6aa5e0983c", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\":\"chrome\",\"platformName\":\"linux\"}" + } }, { "id": "0f9c5a941aa4d755a54b84be1f6535b1", "capabilities": "{\n \"acceptInsecureCerts\": false,\n \"browserName\": \"chrome\",\n \"browserVersion\": \"91.0.4472.114\",\n \"chrome\": {\n \"chromedriverVersion\": \"91.0.4472.101 (af52a90bf87030dd1523486a1cd3ae25c5d76c9b-refs\\u002fbranch-heads\\u002f4472@{#1462})\",\n \"userDataDir\": \"\\u002ftmp\\u002f.com.google.Chrome.DMqx9m\"\n },\n \"goog:chromeOptions\": {\n \"debuggerAddress\": \"localhost:35839\"\n },\n \"networkConnectionEnabled\": false,\n \"pageLoadStrategy\": \"normal\",\n \"platformName\": \"linux\",\n \"proxy\": {\n },\n \"se:cdp\": \"http:\\u002f\\u002flocalhost:35839\",\n \"se:cdpVersion\": \"91.0.4472.114\",\n \"se:vncEnabled\": true,\n \"se:vncLocalAddress\": \"ws:\\u002f\\u002flocalhost:7900\\u002fwebsockify\",\n \"setWindowRect\": true,\n \"strictFileInteractability\": false,\n \"timeouts\": {\n \"implicit\": 0,\n \"pageLoad\": 300000,\n \"script\": 30000\n },\n \"unhandledPromptBehavior\": \"dismiss and notify\",\n \"webauthn:extension:largeBlob\": true,\n \"webauthn:virtualAuthenticators\": true\n}", - "nodeId": "d44dcbc5-0b2c-4d5e-abf4-6f6aa5e0983c" + "nodeId": "d44dcbc5-0b2c-4d5e-abf4-6f6aa5e0983c", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\":\"chrome\",\"platformName\":\"linux\"}" + } } ] } @@ -1692,7 +1883,7 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { "sessionsInfo": { "sessionQueueRequests": [ "{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}", - "{\n \"browserName\": \"chrome\",\n \"platformName\": \"Windows 11\",\n \"browserVersion\": \"91.0\"\n}" + "{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\",\n \"browserVersion\": \"91.0\"\n}" ] } } @@ -1703,82 +1894,979 @@ func Test_getCountFromSeleniumResponse(t *testing.T) { platformName: "linux", }, wantNewRequestNodes: 1, - wantOnGoingSessions: 2, + wantOnGoingSessions: 0, wantErr: false, }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - newRequestNodes, onGoingSessions, err := getCountFromSeleniumResponse(tt.args.b, tt.args.browserName, tt.args.browserVersion, tt.args.sessionBrowserName, tt.args.platformName, tt.args.nodeMaxSessions, logr.Discard()) - if (err != nil) != tt.wantErr { - t.Errorf("getCountFromSeleniumResponse() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(newRequestNodes, tt.wantNewRequestNodes) || !reflect.DeepEqual(onGoingSessions, tt.wantOnGoingSessions) { - t.Errorf("getCountFromSeleniumResponse() = [%v, %v], want [%v, %v]", newRequestNodes, onGoingSessions, tt.wantNewRequestNodes, tt.wantOnGoingSessions) - } - }) - } -} - -func Test_parseSeleniumGridScalerMetadata(t *testing.T) { - type args struct { - config *scalersconfig.ScalerConfig - } - tests := []struct { - name string - args args - want *seleniumGridScalerMetadata - wantErr bool - }{ - { - name: "invalid url string should throw error", - args: args{ - config: &scalersconfig.ScalerConfig{ - TriggerMetadata: map[string]string{}, - }, - }, - wantErr: true, - }, { - name: "invalid browsername string should throw error", + name: "Given_2_requests_include_1_without_browserVersion_When_scaler_metadata_without_browserVersion_Then_scaler_should_scale_up_for_1_request_has_browserVersion_and_return_2_ongoing_sessions", args: args{ - config: &scalersconfig.ScalerConfig{ - TriggerMetadata: map[string]string{ - "url": "", - }, - }, + b: []byte(`{ + "data": { + "grid": { + "sessionCount": 2, + "maxSession": 2, + "totalSlots": 2 + }, + "nodesInfo": { + "nodes": [ + { + "id": "d44dcbc5-0b2c-4d5e-abf4-6f6aa5e0983c", + "status": "UP", + "sessionCount": 2, + "maxSession": 2, + "slotCount": 2, + "stereotypes":"[{\"slots\":2,\"stereotype\":{\"browserName\":\"chrome\",\"platformName\":\"linux\"}}]", + "sessions": [ + { + "id": "0f9c5a941aa4d755a54b84be1f6535b1", + "capabilities": "{\n \"acceptInsecureCerts\": false,\n \"browserName\": \"chrome\",\n \"browserVersion\": \"91.0.4472.114\",\n \"chrome\": {\n \"chromedriverVersion\": \"91.0.4472.101 (af52a90bf87030dd1523486a1cd3ae25c5d76c9b-refs\\u002fbranch-heads\\u002f4472@{#1462})\",\n \"userDataDir\": \"\\u002ftmp\\u002f.com.google.Chrome.DMqx9m\"\n },\n \"goog:chromeOptions\": {\n \"debuggerAddress\": \"localhost:35839\"\n },\n \"networkConnectionEnabled\": false,\n \"pageLoadStrategy\": \"normal\",\n \"platformName\": \"linux\",\n \"proxy\": {\n },\n \"se:cdp\": \"http:\\u002f\\u002flocalhost:35839\",\n \"se:cdpVersion\": \"91.0.4472.114\",\n \"se:vncEnabled\": true,\n \"se:vncLocalAddress\": \"ws:\\u002f\\u002flocalhost:7900\\u002fwebsockify\",\n \"setWindowRect\": true,\n \"strictFileInteractability\": false,\n \"timeouts\": {\n \"implicit\": 0,\n \"pageLoad\": 300000,\n \"script\": 30000\n },\n \"unhandledPromptBehavior\": \"dismiss and notify\",\n \"webauthn:extension:largeBlob\": true,\n \"webauthn:virtualAuthenticators\": true\n}", + "nodeId": "d44dcbc5-0b2c-4d5e-abf4-6f6aa5e0983c", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\":\"chrome\",\"platformName\":\"linux\"}" + } + }, + { + "id": "0f9c5a941aa4d755a54b84be1f6535b1", + "capabilities": "{\n \"acceptInsecureCerts\": false,\n \"browserName\": \"chrome\",\n \"browserVersion\": \"91.0.4472.114\",\n \"chrome\": {\n \"chromedriverVersion\": \"91.0.4472.101 (af52a90bf87030dd1523486a1cd3ae25c5d76c9b-refs\\u002fbranch-heads\\u002f4472@{#1462})\",\n \"userDataDir\": \"\\u002ftmp\\u002f.com.google.Chrome.DMqx9m\"\n },\n \"goog:chromeOptions\": {\n \"debuggerAddress\": \"localhost:35839\"\n },\n \"networkConnectionEnabled\": false,\n \"pageLoadStrategy\": \"normal\",\n \"platformName\": \"linux\",\n \"proxy\": {\n },\n \"se:cdp\": \"http:\\u002f\\u002flocalhost:35839\",\n \"se:cdpVersion\": \"91.0.4472.114\",\n \"se:vncEnabled\": true,\n \"se:vncLocalAddress\": \"ws:\\u002f\\u002flocalhost:7900\\u002fwebsockify\",\n \"setWindowRect\": true,\n \"strictFileInteractability\": false,\n \"timeouts\": {\n \"implicit\": 0,\n \"pageLoad\": 300000,\n \"script\": 30000\n },\n \"unhandledPromptBehavior\": \"dismiss and notify\",\n \"webauthn:extension:largeBlob\": true,\n \"webauthn:virtualAuthenticators\": true\n}", + "nodeId": "d44dcbc5-0b2c-4d5e-abf4-6f6aa5e0983c", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\":\"chrome\",\"platformName\":\"linux\"}" + } + } + ] + } + ] + }, + "sessionsInfo": { + "sessionQueueRequests": [ + "{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}", + "{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\",\n \"browserVersion\": \"91.0\"\n}" + ] + } + } + }`), + browserName: "chrome", + sessionBrowserName: "chrome", + browserVersion: "", + platformName: "linux", }, - wantErr: true, + wantNewRequestNodes: 1, + wantOnGoingSessions: 2, + wantErr: false, }, { - name: "valid url and browsername should return metadata", + name: `Given_3_requests_include_1_without_browserVersion_ + When_4_existing_nodes_with_different_stereotypes_browserVersion_ + And_scaler_metadata_set_browserVersion_as_latest_ + Then_return_1_new_scale_and_4_ongoing`, args: args{ - config: &scalersconfig.ScalerConfig{ - TriggerMetadata: map[string]string{ - "url": "http://selenium-hub:4444/graphql", - "browserName": "chrome", - }, - }, - }, - wantErr: false, - want: &seleniumGridScalerMetadata{ - URL: "http://selenium-hub:4444/graphql", - BrowserName: "chrome", - SessionBrowserName: "chrome", - TargetValue: 1, - BrowserVersion: "latest", - PlatformName: "linux", - NodeMaxSessions: 1, + b: []byte(`{ + "data": { + "grid": { + "sessionCount": 4, + "maxSession": 4, + "totalSlots": 4 + }, + "nodesInfo": { + "nodes": [ + { + "id": "node-131", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-130", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-129", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-2", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-128", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}" + } + } + ] + } + ] + }, + "sessionsInfo": { + "sessionQueueRequests": [ + "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"131\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"130\"}" + ] + } + } + }`), + browserName: "chrome", + sessionBrowserName: "chrome", + browserVersion: "", + platformName: "linux", }, + wantNewRequestNodes: 1, + wantOnGoingSessions: 0, + wantErr: false, }, { - name: "valid url, browsername, and sessionbrowsername should return metadata", + name: `Given_3_requests_include_1_without_browserVersion_ + When_4_existing_nodes_with_different_stereotypes_browserVersion_ + And_scaler_metadata_set_browserVersion_131.0_ + Then_return_1_new_scale_and_1_ongoing`, args: args{ - config: &scalersconfig.ScalerConfig{ - TriggerMetadata: map[string]string{ - "url": "http://selenium-hub:4444/graphql", - "browserName": "MicrosoftEdge", + b: []byte(`{ + "data": { + "grid": { + "sessionCount": 4, + "maxSession": 4, + "totalSlots": 4 + }, + "nodesInfo": { + "nodes": [ + { + "id": "node-131", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-130", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-129", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-2", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-128", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}" + } + } + ] + } + ] + }, + "sessionsInfo": { + "sessionQueueRequests": [ + "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"131\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"130\"}" + ] + } + } + }`), + browserName: "chrome", + sessionBrowserName: "chrome", + browserVersion: "131.0", + platformName: "linux", + }, + wantNewRequestNodes: 1, + wantOnGoingSessions: 1, + wantErr: false, + }, + { + name: `Given_3_requests_include_1_without_browserVersion_ + When_4_existing_nodes_with_different_stereotypes_browserVersion_ + And_scaler_metadata_set_browserVersion_130.0_ + Then_return_1_new_scale_and_1_ongoing`, + args: args{ + b: []byte(`{ + "data": { + "grid": { + "sessionCount": 4, + "maxSession": 4, + "totalSlots": 4 + }, + "nodesInfo": { + "nodes": [ + { + "id": "node-131", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-130", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-129", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-2", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-128", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}" + } + } + ] + } + ] + }, + "sessionsInfo": { + "sessionQueueRequests": [ + "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"131\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"130\"}" + ] + } + } + }`), + browserName: "chrome", + sessionBrowserName: "chrome", + browserVersion: "130.0", + platformName: "linux", + }, + wantNewRequestNodes: 1, + wantOnGoingSessions: 1, + wantErr: false, + }, + { + name: `Given_3_requests_include_1_without_browserVersion_ + When_4_existing_nodes_with_different_stereotypes_browserVersion_and_1_available_ + And_scaler_metadata_set_browserVersion_as_latest_ + Then_return_0_new_scale_and_0_ongoing`, + args: args{ + b: []byte(`{ + "data": { + "grid": { + "sessionCount": 3, + "maxSession": 4, + "totalSlots": 4 + }, + "nodesInfo": { + "nodes": [ + { + "id": "node-131", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-130", + "status": "UP", + "sessionCount": 0, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\"}}]", + "sessions": [] + }, + { + "id": "node-129", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-128", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}" + } + } + ] + } + ] + }, + "sessionsInfo": { + "sessionQueueRequests": [ + "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"131\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"130\"}" + ] + } + } + }`), + browserName: "chrome", + sessionBrowserName: "chrome", + browserVersion: "", + platformName: "linux", + }, + wantNewRequestNodes: 0, + wantOnGoingSessions: 0, + wantErr: false, + }, + { + name: `Given_3_requests_include_1_without_browserVersion_ + When_4_existing_nodes_with_different_stereotypes_browserVersion_and_1_available_ + And_scaler_metadata_set_browserVersion_131.0_ + Then_return_0_new_scale_and_0_ongoing`, + args: args{ + b: []byte(`{ + "data": { + "grid": { + "sessionCount": 3, + "maxSession": 4, + "totalSlots": 4 + }, + "nodesInfo": { + "nodes": [ + { + "id": "node-131", + "status": "UP", + "sessionCount": 0, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}}]", + "sessions": [] + }, + { + "id": "node-130", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-129", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-128", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}" + } + } + ] + } + ] + }, + "sessionsInfo": { + "sessionQueueRequests": [ + "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"131\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"130\"}" + ] + } + } + }`), + browserName: "chrome", + sessionBrowserName: "chrome", + browserVersion: "131.0", + platformName: "linux", + }, + wantNewRequestNodes: 0, + wantOnGoingSessions: 0, + wantErr: false, + }, + { + name: `Given_3_requests_include_1_without_browserVersion_ + When_4_existing_nodes_with_different_stereotypes_browserVersion_and_1_available_ + And_scaler_metadata_set_browserVersion_130.0_ + Then_return_0_new_scale_and_0_ongoing`, + args: args{ + b: []byte(`{ + "data": { + "grid": { + "sessionCount": 3, + "maxSession": 4, + "totalSlots": 4 + }, + "nodesInfo": { + "nodes": [ + { + "id": "node-131", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-130", + "status": "UP", + "sessionCount": 0, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}}]", + "sessions": [] + }, + { + "id": "node-129", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-128", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}" + } + } + ] + } + ] + }, + "sessionsInfo": { + "sessionQueueRequests": [ + "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"131\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"130\"}" + ] + } + } + }`), + browserName: "chrome", + sessionBrowserName: "chrome", + browserVersion: "130.0", + platformName: "linux", + }, + wantNewRequestNodes: 0, + wantOnGoingSessions: 0, + wantErr: false, + }, + { + name: `Given_3_requests_include_1_without_browserVersion_ + When_5_existing_nodes_with_different_stereotypes_browserVersion_ + And_scaler_metadata_set_browserVersion_as_empty_ + Then_return_1_new_scale_and_1_ongoing`, + args: args{ + b: []byte(`{ + "data": { + "grid": { + "sessionCount": 4, + "maxSession": 5, + "totalSlots": 5 + }, + "nodesInfo": { + "nodes": [ + { + "id": "node-131", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-130", + "status": "UP", + "sessionCount": 0, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"130.0\", \"platformName\": \"linux\"}}]", + "sessions": [] + }, + { + "id": "node-129", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-128", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-any", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\"}" + } + } + ] + } + ] + }, + "sessionsInfo": { + "sessionQueueRequests": [ + "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"131\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"130\"}" + ] + } + } + }`), + browserName: "chrome", + sessionBrowserName: "chrome", + browserVersion: "", + platformName: "linux", + }, + wantNewRequestNodes: 1, + wantOnGoingSessions: 1, + wantErr: false, + }, + { + name: `Given_3_requests_include_1_without_browserVersion_ + When_4_existing_nodes_with_different_stereotypes_browserVersion_ + And_scaler_metadata_set_browserVersion_130.0_ + Then_return_1_new_scale_and_0_ongoing`, + args: args{ + b: []byte(`{ + "data": { + "grid": { + "sessionCount": 4, + "maxSession": 4, + "totalSlots": 4 + }, + "nodesInfo": { + "nodes": [ + { + "id": "node-131", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"131.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-129", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"129.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-128", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}" + } + } + ] + }, + { + "id": "node-any", + "status": "UP", + "sessionCount": 1, + "maxSession": 1, + "slotCount": 1, + "stereotypes": "[{\"slots\": 1, \"stereotype\": {\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\"}}]", + "sessions": [ + { + "id": "session-1", + "capabilities": "{\"browserName\": \"chrome\", \"browserVersion\": \"128.0\", \"platformName\": \"linux\"}", + "slot": { + "id": "9ce1edba-72fb-465e-b311-ee473d8d7b64", + "stereotype": "{\"browserName\": \"chrome\", \"browserVersion\": \"\", \"platformName\": \"linux\"}" + } + } + ] + } + ] + }, + "sessionsInfo": { + "sessionQueueRequests": [ + "{\"browserName\": \"chrome\", \"platformName\": \"linux\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"131\"}", + "{\"browserName\": \"chrome\", \"platformName\": \"linux\", \"browserVersion\": \"130\"}" + ] + } + } + }`), + browserName: "chrome", + sessionBrowserName: "chrome", + browserVersion: "130.0", + platformName: "linux", + }, + wantNewRequestNodes: 1, + wantOnGoingSessions: 0, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + newRequestNodes, onGoingSessions, err := getCountFromSeleniumResponse(tt.args.b, tt.args.browserName, tt.args.browserVersion, tt.args.sessionBrowserName, tt.args.platformName, tt.args.nodeMaxSessions, logr.Discard()) + if (err != nil) != tt.wantErr { + t.Errorf("getCountFromSeleniumResponse() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(newRequestNodes, tt.wantNewRequestNodes) || !reflect.DeepEqual(onGoingSessions, tt.wantOnGoingSessions) { + t.Errorf("getCountFromSeleniumResponse() = [%v, %v], want [%v, %v]", newRequestNodes, onGoingSessions, tt.wantNewRequestNodes, tt.wantOnGoingSessions) + } + }) + } +} + +func Test_parseSeleniumGridScalerMetadata(t *testing.T) { + type args struct { + config *scalersconfig.ScalerConfig + } + tests := []struct { + name string + args args + want *seleniumGridScalerMetadata + wantErr bool + }{ + { + name: "invalid url string should throw error", + args: args{ + config: &scalersconfig.ScalerConfig{ + TriggerMetadata: map[string]string{}, + }, + }, + wantErr: true, + }, + { + name: "invalid browsername string should throw error", + args: args{ + config: &scalersconfig.ScalerConfig{ + TriggerMetadata: map[string]string{ + "url": "", + }, + }, + }, + wantErr: true, + }, + { + name: "valid url and browsername should return metadata", + args: args{ + config: &scalersconfig.ScalerConfig{ + TriggerMetadata: map[string]string{ + "url": "http://selenium-hub:4444/graphql", + "browserName": "chrome", + }, + }, + }, + wantErr: false, + want: &seleniumGridScalerMetadata{ + URL: "http://selenium-hub:4444/graphql", + BrowserName: "chrome", + SessionBrowserName: "chrome", + TargetValue: 1, + BrowserVersion: "", + PlatformName: "", + NodeMaxSessions: 1, + }, + }, + { + name: "valid url, browsername, and sessionbrowsername should return metadata", + args: args{ + config: &scalersconfig.ScalerConfig{ + TriggerMetadata: map[string]string{ + "url": "http://selenium-hub:4444/graphql", + "browserName": "MicrosoftEdge", "sessionBrowserName": "msedge", }, }, @@ -1789,8 +2877,29 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) { BrowserName: "MicrosoftEdge", SessionBrowserName: "msedge", TargetValue: 1, - BrowserVersion: "latest", - PlatformName: "linux", + BrowserVersion: "", + PlatformName: "", + NodeMaxSessions: 1, + }, + }, + { + name: "can input browserName as empty", + args: args{ + config: &scalersconfig.ScalerConfig{ + TriggerMetadata: map[string]string{ + "url": "http://selenium-hub:4444/graphql", + "browserName": "", + }, + }, + }, + wantErr: false, + want: &seleniumGridScalerMetadata{ + URL: "http://selenium-hub:4444/graphql", + BrowserName: "", + SessionBrowserName: "", + TargetValue: 1, + BrowserVersion: "", + PlatformName: "", NodeMaxSessions: 1, }, }, @@ -1817,8 +2926,8 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) { BrowserName: "MicrosoftEdge", SessionBrowserName: "msedge", TargetValue: 1, - BrowserVersion: "latest", - PlatformName: "linux", + BrowserVersion: "", + PlatformName: "", NodeMaxSessions: 1, }, }, @@ -1843,8 +2952,8 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) { BrowserName: "MicrosoftEdge", SessionBrowserName: "msedge", TargetValue: 1, - BrowserVersion: "latest", - PlatformName: "linux", + BrowserVersion: "", + PlatformName: "", Username: "username", Password: "password", NodeMaxSessions: 1, @@ -1870,7 +2979,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) { TargetValue: 1, BrowserVersion: "91.0", UnsafeSsl: false, - PlatformName: "linux", + PlatformName: "", NodeMaxSessions: 1, }, }, @@ -1896,7 +3005,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) { ActivationThreshold: 10, BrowserVersion: "91.0", UnsafeSsl: true, - PlatformName: "linux", + PlatformName: "", NodeMaxSessions: 1, }, }, @@ -1937,7 +3046,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) { ActivationThreshold: 10, BrowserVersion: "91.0", UnsafeSsl: true, - PlatformName: "linux", + PlatformName: "", NodeMaxSessions: 1, }, }, diff --git a/Makefile b/Makefile index 23dbae97a..d4af071f0 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ SEL_PASSWD := $(or $(SEL_PASSWD),$(SEL_PASSWD),secret) CHROMIUM_VERSION := $(or $(CHROMIUM_VERSION),$(CHROMIUM_VERSION),latest) FIREFOX_DOWNLOAD_URL := $(or $(FIREFOX_DOWNLOAD_URL),$(FIREFOX_DOWNLOAD_URL),https://download-installer.cdn.mozilla.net/pub/firefox/nightly/2024/10/2024-10-28-09-56-35-mozilla-central/firefox-133.0a1.en-US.linux-aarch64.tar.bz2) SBOM_OUTPUT := $(or $(SBOM_OUTPUT),$(SBOM_OUTPUT),package_versions.txt) -KEDA_TAG_PREV_VERSION := $(or $(KEDA_TAG_PREV_VERSION),$(KEDA_TAG_PREV_VERSION),2.16.0-selenium-grid) +KEDA_TAG_PREV_VERSION := $(or $(KEDA_TAG_PREV_VERSION),$(KEDA_TAG_PREV_VERSION),2.16.1-selenium-grid) KEDA_CORE_VERSION := $(or $(KEDA_CORE_VERSION),$(KEDA_CORE_VERSION),2.16.1) KEDA_TAG_VERSION := $(or $(KEDA_TAG_VERSION),$(KEDA_TAG_VERSION),2.16.1-selenium-grid) KEDA_BASED_NAME := $(or $(KEDA_BASED_NAME),$(KEDA_BASED_NAME),ndviet) diff --git a/NodeDocker/config.toml b/NodeDocker/config.toml index e7b006ee6..c5431f8a2 100644 --- a/NodeDocker/config.toml +++ b/NodeDocker/config.toml @@ -2,9 +2,9 @@ # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.27.0-20241204", '{"browserName": "firefox", "platformName": "linux"}', - "selenium/standalone-chrome:4.27.0-20241204", '{"browserName": "chrome", "platformName": "linux"}', - "selenium/standalone-edge:4.27.0-20241204", '{"browserName": "MicrosoftEdge", "platformName": "linux"}' + "selenium/standalone-firefox:4.27.0-20241225", '{"browserName": "firefox", "platformName": "linux"}', + "selenium/standalone-chrome:4.27.0-20241225", '{"browserName": "chrome", "platformName": "linux"}', + "selenium/standalone-edge:4.27.0-20241225", '{"browserName": "MicrosoftEdge", "platformName": "linux"}' ] # URL for connecting to the docker daemon @@ -14,7 +14,7 @@ configs = [ # socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-7.1-20241204" +video-image = "selenium/video:ffmpeg-7.1-20241225" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values diff --git a/README.md b/README.md index dde78aa3b..8a44414b5 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The project is made possible by volunteer contributors who have put in thousands and made the source code freely available under the [Apache License 2.0](LICENSE.md). These Docker images come with a handful of tags to simplify its usage, have a look at them in one of -our [releases](https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.27.0-20241204). +our [releases](https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.27.0-20241225). To get notifications of new releases, add yourself as a "Releases only" watcher. @@ -96,7 +96,7 @@ Talk to us at https://www.selenium.dev/support/ 1. Start a Docker container with Firefox ```bash -docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-firefox:4.27.0-20241204 +docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-firefox:4.27.0-20241225 ``` 2. Point your WebDriver tests to http://localhost:4444 @@ -354,17 +354,17 @@ For more information on the Dev and Beta channel container images, see the blog ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_24x24.png) Firefox ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-firefox:4.27.0-20241204 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-firefox:4.27.0-20241225 ``` ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_24x24.png) Chrome ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.27.0-20241204 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.27.0-20241225 ``` ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_24x24.png) Edge ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-edge:4.27.0-20241204 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-edge:4.27.0-20241225 ``` _Note: Only one Standalone container can run on port_ `4444` _at the same time._ @@ -383,44 +383,44 @@ A Docker [network](https://docs.docker.com/engine/reference/commandline/network_ ```bash $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.27.0-20241204 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.27.0-20241225 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.27.0-20241204 + selenium/node-chrome:4.27.0-20241225 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.27.0-20241204 + selenium/node-edge:4.27.0-20241225 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.27.0-20241204 + selenium/node-firefox:4.27.0-20241225 ``` ##### Windows PowerShell ```powershell $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.27.0-20241204 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.27.0-20241225 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-chrome:4.27.0-20241204 + selenium/node-chrome:4.27.0-20241225 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-edge:4.27.0-20241204 + selenium/node-edge:4.27.0-20241225 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-firefox:4.27.0-20241204 + selenium/node-firefox:4.27.0-20241225 ``` When you are done using the Grid, and the containers have exited, the network can be removed with the following command: @@ -437,7 +437,7 @@ configured to expose different ports. ##### Hub - Machine/VM 1 ```bash -$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.27.0-20241204 +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.27.0-20241225 ``` ##### Node Chrome - Machine/VM 2 @@ -451,7 +451,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-chrome:4.27.0-20241204 + selenium/node-chrome:4.27.0-20241225 ``` ###### Windows PowerShell @@ -463,7 +463,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-chrome:4.27.0-20241204 + selenium/node-chrome:4.27.0-20241225 ``` @@ -478,7 +478,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-edge:4.27.0-20241204 + selenium/node-edge:4.27.0-20241225 ``` ###### Windows PowerShell @@ -490,7 +490,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-edge:4.27.0-20241204 + selenium/node-edge:4.27.0-20241225 ``` ##### Node Firefox - Machine/VM 4 @@ -504,7 +504,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-firefox:4.27.0-20241204 + selenium/node-firefox:4.27.0-20241225 ``` ###### Windows PowerShell @@ -516,7 +516,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-firefox:4.27.0-20241204 + selenium/node-firefox:4.27.0-20241225 ``` ##### Node Chrome - Machine/VM 4 @@ -531,7 +531,7 @@ $ docker run -d -p 5556:5556 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ -e SE_NODE_PORT=5556 \ - selenium/node-chrome:4.27.0-20241204 + selenium/node-chrome:4.27.0-20241225 ``` ###### Windows PowerShell @@ -544,7 +544,7 @@ $ docker run -d -p 5556:5556 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` -e SE_NODE_PORT=5556 ` - selenium/node-chrome:4.27.0-20241204 + selenium/node-chrome:4.27.0-20241225 ``` #### Docker Compose @@ -583,7 +583,7 @@ ___ ## Video recording -Tests execution can be recorded by using the `selenium/video:ffmpeg-7.1-20241204` +Tests execution can be recorded by using the `selenium/video:ffmpeg-7.1-20241225` Docker image. One container is needed per each container where a browser is running. This means if you are running 5 Nodes/Standalone containers, you will need 5 video containers, the mapping is 1-1. @@ -613,8 +613,8 @@ This example shows how to start the containers manually: ``` bash $ docker network create grid -$ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium --shm-size="2g" selenium/standalone-chrome:4.27.0-20241204 -$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-7.1-20241204 +$ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium --shm-size="2g" selenium/standalone-chrome:4.27.0-20241225 +$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-7.1-20241225 # Run your tests $ docker stop video && docker rm video $ docker stop selenium && docker rm selenium @@ -669,7 +669,7 @@ Besides the video recording mentioned above, you can enable the upload functiona version: "3" services: chrome_video: - image: selenium/video:ffmpeg-7.1-20241204 + image: selenium/video:ffmpeg-7.1-20241225 depends_on: - chrome environment: @@ -746,9 +746,9 @@ You can save this file locally and name it, for example, `config.toml`. # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.27.0-20241204", '{"browserName": "firefox"}', - "selenium/standalone-chrome:4.27.0-20241204", '{"browserName": "chrome"}', - "selenium/standalone-edge:4.27.0-20241204", '{"browserName": "MicrosoftEdge"}' + "selenium/standalone-firefox:4.27.0-20241225", '{"browserName": "firefox"}', + "selenium/standalone-chrome:4.27.0-20241225", '{"browserName": "chrome"}', + "selenium/standalone-edge:4.27.0-20241225", '{"browserName": "MicrosoftEdge"}' ] host-config-keys = ["Dns", "DnsOptions", "DnsSearch", "ExtraHosts", "Binds"] @@ -763,7 +763,7 @@ host-config-keys = ["Dns", "DnsOptions", "DnsSearch", "ExtraHosts", "Binds"] # Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue. url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-7.1-20241204" +video-image = "selenium/video:ffmpeg-7.1-20241225" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values @@ -816,28 +816,28 @@ virtual machines. ```bash $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.27.0-20241204 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.27.0-20241225 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -v ${PWD}/config.toml:/opt/selenium/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/node-docker:4.27.0-20241204 + selenium/node-docker:4.27.0-20241225 ``` #### Windows PowerShell ```powershell $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.27.0-20241204 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.27.0-20241225 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -v ${PWD}/config.toml:/opt/selenium/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/node-docker:4.27.0-20241204 + selenium/node-docker:4.27.0-20241225 ``` To have the assets saved on your host, please mount your host path to `/opt/selenium/assets`. @@ -858,7 +858,7 @@ docker run --rm --name selenium-docker -p 4444:4444 \ -v ${PWD}/config.toml:/opt/selenium/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/standalone-docker:4.27.0-20241204 + selenium/standalone-docker:4.27.0-20241225 ``` #### Windows PowerShell @@ -868,7 +868,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` -v ${PWD}/config.toml:/opt/selenium/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/standalone-docker:4.27.0-20241204 + selenium/standalone-docker:4.27.0-20241225 ``` ### Using Dynamic Grid in different machines/VMs @@ -876,7 +876,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` #### Hub - Machine/VM 1 ```bash -$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.27.0-20241204 +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.27.0-20241225 ``` #### Node Chrome - Machine/VM 2 @@ -891,7 +891,7 @@ $ docker run -d -p 5555:5555 \ -v ${PWD}/config.toml:/opt/selenium/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/node-docker:4.27.0-20241204 + selenium/node-docker:4.27.0-20241225 ``` #### Windows PowerShell @@ -904,7 +904,7 @@ $ docker run -d -p 5555:5555 ` -v ${PWD}/config.toml:/opt/selenium/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/node-docker:4.27.0-20241204 + selenium/node-docker:4.27.0-20241225 ``` Complete the `[server]` section in the `config.toml` file. @@ -913,9 +913,9 @@ Complete the `[server]` section in the `config.toml` file. # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.27.0-20241204", "{\"browserName\": \"firefox\"}", - "selenium/standalone-chrome:4.27.0-20241204", "{\"browserName\": \"chrome\"}", - "selenium/standalone-edge:4.27.0-20241204", "{\"browserName\": \"MicrosoftEdge\"}" + "selenium/standalone-firefox:4.27.0-20241225", "{\"browserName\": \"firefox\"}", + "selenium/standalone-chrome:4.27.0-20241225", "{\"browserName\": \"chrome\"}", + "selenium/standalone-edge:4.27.0-20241225", "{\"browserName\": \"MicrosoftEdge\"}" ] # URL for connecting to the docker daemon @@ -928,7 +928,7 @@ configs = [ # Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue. url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-7.1-20241204" +video-image = "selenium/video:ffmpeg-7.1-20241225" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values @@ -962,7 +962,7 @@ docker run --rm --name selenium-docker -p 4444:4444 \ -v ${PWD}/config.toml:/opt/selenium/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/standalone-docker:4.27.0-20241204 + selenium/standalone-docker:4.27.0-20241225 ``` #### Windows PowerShell @@ -973,7 +973,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` -v ${PWD}/config.toml:/opt/selenium/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/standalone-docker:4.27.0-20241204 + selenium/standalone-docker:4.27.0-20241225 ``` ### Video recording, screen resolution, and time zones in a Dynamic Grid @@ -1040,7 +1040,7 @@ ___ You can pass `SE_OPTS` variable with additional command line parameters for starting a hub or a node. ``` bash -$ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub selenium/hub:4.27.0-20241204 +$ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub selenium/hub:4.27.0-20241225 ``` ### SE_JAVA_OPTS Java Environment Options @@ -1048,7 +1048,7 @@ $ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub s You can pass `SE_JAVA_OPTS` environment variable to the Java process. ``` bash -$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.27.0-20241204 +$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.27.0-20241225 ``` ### SE_BROWSER_ARGS_* Add arguments for launching browser @@ -1094,7 +1094,7 @@ $ docker run -d \ -e SE_EVENT_BUS_HOST= \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_NODE_STEREOTYPE="{\"browserName\":\"${SE_NODE_BROWSER_NAME}\",\"browserVersion\":\"${SE_NODE_BROWSER_VERSION}\",\"platformName\": \"Linux\"}" \ - --shm-size="2g" selenium/node-chrome:4.27.0-20241204 + --shm-size="2g" selenium/node-chrome:4.27.0-20241225 ``` ### Node configuration relay commands @@ -1132,7 +1132,7 @@ By default, Selenium is reachable at `http://127.0.0.1:4444/`. Selenium can be c environmental variable. In the example below Selenium is reachable at `http://127.0.0.1:4444/selenium-grid/` ```bash -$ docker run -d -p 4444:4444 -e SE_SUB_PATH=/selenium-grid/ --name selenium-hub selenium/hub:4.27.0-20241204 +$ docker run -d -p 4444:4444 -e SE_SUB_PATH=/selenium-grid/ --name selenium-hub selenium/hub:4.27.0-20241225 ``` ### Setting Screen Resolution @@ -1142,7 +1142,7 @@ These settings can be adjusted by specifying `SE_SCREEN_WIDTH`, `SE_SCREEN_HEIGH environmental variables when starting the container. ``` bash -docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH=24 -e SE_SCREEN_DPI=74 selenium/standalone-firefox:4.27.0-20241204 +docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH=24 -e SE_SCREEN_DPI=74 selenium/standalone-firefox:4.27.0-20241225 ``` ### Grid Url and Session Timeout @@ -1192,7 +1192,7 @@ To avoid starting the server you can set the `SE_START_XVFB` environment variabl ``` bash $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ - -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_START_XVFB=false --shm-size="2g" selenium/node-chrome:4.27.0-20241204 + -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_START_XVFB=false --shm-size="2g" selenium/node-chrome:4.27.0-20241225 ``` For more information, see this GitHub [issue](https://github.com/SeleniumHQ/docker-selenium/issues/567). @@ -1208,7 +1208,7 @@ pod and then scale a new one after N sessions. Set the environment variable `SE_ a value higher than zero to enable this behaviour. ``` bash -$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size="2g" selenium/standalone-firefox:4.27.0-20241204 +$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size="2g" selenium/standalone-firefox:4.27.0-20241225 ``` With the previous command, the Standalone container will shut down after 5 sessions have been executed. @@ -1233,7 +1233,7 @@ not set `SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP` to `true` (leave the default value `SE_BROWSER_LEFTOVERS_PROCESSES_SECS` to set a value higher than your expected long-running browser processes. ``` bash -$ docker run -e SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true --shm-size="2g" selenium/node-chrome:4.27.0-20241204 +$ docker run -e SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true --shm-size="2g" selenium/node-chrome:4.27.0-20241225 ``` With the previous command, the cleanup will be enabled with the default timings. @@ -1243,7 +1243,7 @@ $ docker run -e SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true \ -e SE_BROWSER_LEFTOVERS_INTERVAL_SECS=7200 \ -e SE_BROWSER_LEFTOVERS_PROCESSES_SECS=3600 \ -e SE_BROWSER_LEFTOVERS_TEMPFILES_DAYS=2 \ ---shm-size="2g" selenium/node-chrome:4.27.0-20241204 +--shm-size="2g" selenium/node-chrome:4.27.0-20241225 ``` With the previous command, the cleanup will be enabled, but will run every 2 hours (instead of 1), will kill browsers @@ -1475,22 +1475,22 @@ $ docker network create grid $ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub \ --health-cmd='/opt/bin/check-grid.sh --host 0.0.0.0 --port 4444' \ --health-interval=15s --health-timeout=30s --health-retries=5 \ - selenium/hub:4.27.0-20241204 + selenium/hub:4.27.0-20241225 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.27.0-20241204 + selenium/node-chrome:4.27.0-20241225 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.27.0-20241204 + selenium/node-edge:4.27.0-20241225 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.27.0-20241204 + selenium/node-firefox:4.27.0-20241225 ``` **Note:** The `\` line delimiter won't work on Windows-based terminals, try either `^` or a backtick. @@ -1610,7 +1610,7 @@ RUN mkdir -p -m755 /seluser/.pki/nssdb \ && chown -R 1200:1201 /seluser # Start from Selenium image and add relevant files from build image -FROM selenium/node-chrome:4.27.0-20241204 +FROM selenium/node-chrome:4.27.0-20241225 USER root COPY --from=build /seluser/ /home/seluser/ USER seluser @@ -1625,7 +1625,7 @@ RUN mkdir -p "/distribution" "/certs" && \ echo '{ "policies": { "Certificates": { "Install": ["/opt/firefox-latest/YOUR_CA.pem"] }} }' >"/distribution/policies.json" # Start from Selenium image and add relevant files from build image -FROM selenium/node-firefox:4.27.0-20241204 +FROM selenium/node-firefox:4.27.0-20241225 USER root COPY --from=build /certs /opt/firefox-latest COPY --from=build /distribution /opt/firefox-latest/distribution @@ -1648,9 +1648,9 @@ You can override it with the `SE_VNC_PORT` environment variable in case you want Here is an example with the standalone images, the same concept applies to the node images. ``` bash -$ docker run -d -p 4444:4444 -p 5900:5900 --shm-size="2g" selenium/standalone-chrome:4.27.0-20241204 -$ docker run -d -p 4445:4444 -p 5901:5900 --shm-size="2g" selenium/standalone-edge:4.27.0-20241204 -$ docker run -d -p 4446:4444 -p 5902:5900 --shm-size="2g" selenium/standalone-firefox:4.27.0-20241204 +$ docker run -d -p 4444:4444 -p 5900:5900 --shm-size="2g" selenium/standalone-chrome:4.27.0-20241225 +$ docker run -d -p 4445:4444 -p 5901:5900 --shm-size="2g" selenium/standalone-edge:4.27.0-20241225 +$ docker run -d -p 4446:4444 -p 5902:5900 --shm-size="2g" selenium/standalone-firefox:4.27.0-20241225 ``` Then, you would use in your VNC client: @@ -1678,9 +1678,9 @@ You can also override it with the `SE_NO_VNC_PORT` environment variable in case Here is an example with the standalone images, the same concept applies to the node images. ``` bash -$ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:4.27.0-20241204 -$ docker run -d -p 4445:4444 -p 7901:7900 --shm-size="2g" selenium/standalone-edge:4.27.0-20241204 -$ docker run -d -p 4446:4444 -p 7902:7900 --shm-size="2g" selenium/standalone-firefox:4.27.0-20241204 +$ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:4.27.0-20241225 +$ docker run -d -p 4445:4444 -p 7901:7900 --shm-size="2g" selenium/standalone-edge:4.27.0-20241225 +$ docker run -d -p 4446:4444 -p 7902:7900 --shm-size="2g" selenium/standalone-firefox:4.27.0-20241225 ``` Then, you would use in your browser: @@ -1705,7 +1705,7 @@ In order to enable tracing in the Selenium Grid container, the following command ```bash docker network create grid docker run -d -p 16686:16686 -p 4317:4317 --net grid --name jaeger jaegertracing/all-in-one:1.54 -docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.27.0-20241204 +docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.27.0-20241225 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ @@ -1713,7 +1713,7 @@ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ -e SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.27.0-20241204 + selenium/node-chrome:4.27.0-20241225 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ @@ -1721,7 +1721,7 @@ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ -e SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.27.0-20241204 + selenium/node-edge:4.27.0-20241225 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ @@ -1729,7 +1729,7 @@ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ -e SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.27.0-20241204 + selenium/node-firefox:4.27.0-20241225 ``` You can also refer to the below docker compose yaml files to be able to start a simple grid (or) a dynamic grid. @@ -1808,7 +1808,7 @@ container in the following way: ```bash docker run -d -p 4444:4444 --shm-size="2g" \ -v /home/ubuntu/files:/home/seluser/Downloads \ - selenium/standalone-chrome:4.27.0-20241204 + selenium/standalone-chrome:4.27.0-20241225 ``` That will mount the host `/home/ubuntu/files` directory diff --git a/charts/selenium-grid/CONFIGURATION.md b/charts/selenium-grid/CONFIGURATION.md index fb9e8c8fd..d608acf73 100644 --- a/charts/selenium-grid/CONFIGURATION.md +++ b/charts/selenium-grid/CONFIGURATION.md @@ -1,6 +1,6 @@ # selenium-grid -![Version: 0.38.1](https://img.shields.io/badge/Version-0.38.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.27.0-20241204](https://img.shields.io/badge/AppVersion-4.27.0--20241204-informational?style=flat-square) +![Version: 0.38.2](https://img.shields.io/badge/Version-0.38.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.27.0-20241225](https://img.shields.io/badge/AppVersion-4.27.0--20241225-informational?style=flat-square) A Helm chart for creating a Selenium Grid Server in Kubernetes @@ -31,9 +31,9 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes |-----|------|---------|-------------| | global.K8S_PUBLIC_IP | string | `""` | Public IP of the host running Kubernetes cluster. This is used to access the Selenium Grid from outside the cluster when ingress is disabled or enabled without a hostname is set. This is part of constructing SE_NODE_GRID_URL and rewrite URL of `se:vnc`, `se:cdp` in the capabilities when `ingress.hostname` is unset | | global.seleniumGrid.imageRegistry | string | `"selenium"` | Image registry for all selenium components | -| global.seleniumGrid.imageTag | string | `"4.27.0-20241204"` | Image tag for all selenium components | -| global.seleniumGrid.nodesImageTag | string | `"4.27.0-20241204"` | Image tag for browser's nodes | -| global.seleniumGrid.videoImageTag | string | `"ffmpeg-7.1-20241204"` | Image tag for browser's video recorder | +| global.seleniumGrid.imageTag | string | `"4.27.0-20241225"` | Image tag for all selenium components | +| global.seleniumGrid.nodesImageTag | string | `"4.27.0-20241225"` | Image tag for browser's nodes | +| global.seleniumGrid.videoImageTag | string | `"ffmpeg-7.1-20241225"` | Image tag for browser's video recorder | | global.seleniumGrid.kubectlImage | string | `"bitnami/kubectl:latest"` | kubectl image is used to execute kubectl commands in utility jobs | | global.seleniumGrid.imagePullSecret | string | `""` | Pull secret for all components, can be overridden individually | | global.seleniumGrid.logLevel | string | `"INFO"` | Log level for all components. Possible values describe here: https://www.selenium.dev/documentation/grid/configuration/cli_options/#logging | diff --git a/charts/selenium-grid/Chart.yaml b/charts/selenium-grid/Chart.yaml index 528440aaf..46eefb818 100644 --- a/charts/selenium-grid/Chart.yaml +++ b/charts/selenium-grid/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: selenium-grid description: A Helm chart for creating a Selenium Grid Server in Kubernetes type: application -version: 0.38.1 -appVersion: 4.27.0-20241204 +version: 0.38.2 +appVersion: 4.27.0-20241225 icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png dependencies: - repository: https://kedacore.github.io/charts diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index ecbaaede5..1f9658b3e 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -7,11 +7,11 @@ global: # -- Image registry for all selenium components imageRegistry: selenium # -- Image tag for all selenium components - imageTag: 4.27.0-20241204 + imageTag: 4.27.0-20241225 # -- Image tag for browser's nodes - nodesImageTag: 4.27.0-20241204 + nodesImageTag: 4.27.0-20241225 # -- Image tag for browser's video recorder - videoImageTag: ffmpeg-7.1-20241204 + videoImageTag: ffmpeg-7.1-20241225 # -- kubectl image is used to execute kubectl commands in utility jobs kubectlImage: bitnami/kubectl:latest # -- Pull secret for all components, can be overridden individually @@ -1848,15 +1848,15 @@ keda: # keda: # registry: selenium # repository: keda -# tag: "2.16.0-selenium-grid-20241204" +# tag: "2.16.1-selenium-grid-20241225" # metricsApiServer: # registry: selenium # repository: keda-metrics-apiserver -# tag: "2.16.0-selenium-grid-20241204" +# tag: "2.16.1-selenium-grid-20241225" # webhooks: # registry: selenium # repository: keda-admission-webhooks -# tag: "2.16.0-selenium-grid-20241204" +# tag: "2.16.1-selenium-grid-20241225" # -- Annotations for KEDA resources additionalAnnotations: http: diff --git a/docker-compose-v2-tracing.yml b/docker-compose-v2-tracing.yml index 4a0272f55..799ceb83e 100644 --- a/docker-compose-v2-tracing.yml +++ b/docker-compose-v2-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "4317:4317" chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - "6900:5900" edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -39,7 +39,7 @@ services: - "6901:5900" firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -54,7 +54,7 @@ services: - "6902:5900" selenium-hub: - image: selenium/hub:4.27.0-20241204 + image: selenium/hub:4.27.0-20241225 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v2.yml b/docker-compose-v2.yml index 42ff849d8..42492ec62 100644 --- a/docker-compose-v2.yml +++ b/docker-compose-v2.yml @@ -4,7 +4,7 @@ version: '2' services: chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -17,7 +17,7 @@ services: - "6900:5900" edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -30,7 +30,7 @@ services: - "6901:5900" firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -43,7 +43,7 @@ services: - "6902:5900" selenium-hub: - image: selenium/hub:4.27.0-20241204 + image: selenium/hub:4.27.0-20241225 environment: - SE_ENABLE_TRACING=false ports: diff --git a/docker-compose-v3-basicauth.yml b/docker-compose-v3-basicauth.yml index 965515ed3..d186bfbbc 100644 --- a/docker-compose-v3-basicauth.yml +++ b/docker-compose-v3-basicauth.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -15,7 +15,7 @@ services: - SE_ENABLE_TRACING=false edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -26,7 +26,7 @@ services: - SE_ENABLE_TRACING=false firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -37,7 +37,7 @@ services: - SE_ENABLE_TRACING=false selenium-hub: - image: selenium/hub:4.27.0-20241204 + image: selenium/hub:4.27.0-20241225 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-dev.yml b/docker-compose-v3-dev.yml index da40b79cc..8fd858c81 100644 --- a/docker-compose-v3-dev.yml +++ b/docker-compose-v3-dev.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -17,7 +17,7 @@ services: - SE_ENABLE_TRACING=false edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -30,7 +30,7 @@ services: - SE_ENABLE_TRACING=false firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -43,7 +43,7 @@ services: - SE_ENABLE_TRACING=false selenium-hub: - image: selenium/hub:4.27.0-20241204 + image: selenium/hub:4.27.0-20241225 container_name: selenium-hub volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar diff --git a/docker-compose-v3-dynamic-grid.yml b/docker-compose-v3-dynamic-grid.yml index af590dfc8..9fab621fb 100644 --- a/docker-compose-v3-dynamic-grid.yml +++ b/docker-compose-v3-dynamic-grid.yml @@ -4,7 +4,7 @@ version: "3" services: node-docker: - image: selenium/node-docker:4.27.0-20241204 + image: selenium/node-docker:4.27.0-20241225 volumes: - ./assets:/opt/selenium/assets - ./NodeDocker/config.toml:/opt/selenium/config.toml @@ -18,7 +18,7 @@ services: - SE_ENABLE_TRACING=false selenium-hub: - image: selenium/hub:4.27.0-20241204 + image: selenium/hub:4.27.0-20241225 container_name: selenium-hub environment: - SE_ENABLE_TRACING=false diff --git a/docker-compose-v3-full-grid-dev.yml b/docker-compose-v3-full-grid-dev.yml index 4208b5c17..df607764d 100644 --- a/docker-compose-v3-full-grid-dev.yml +++ b/docker-compose-v3-full-grid-dev.yml @@ -4,7 +4,7 @@ version: "3" services: selenium-event-bus: - image: selenium/event-bus:4.27.0-20241204 + image: selenium/event-bus:4.27.0-20241225 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-event-bus @@ -16,7 +16,7 @@ services: - "5557:5557" selenium-sessions: - image: selenium/sessions:4.27.0-20241204 + image: selenium/sessions:4.27.0-20241225 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-sessions @@ -31,7 +31,7 @@ services: - SE_ENABLE_TRACING=false selenium-session-queue: - image: selenium/session-queue:4.27.0-20241204 + image: selenium/session-queue:4.27.0-20241225 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-session-queue @@ -41,7 +41,7 @@ services: - "5559:5559" selenium-distributor: - image: selenium/distributor:4.27.0-20241204 + image: selenium/distributor:4.27.0-20241225 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-distributor @@ -62,7 +62,7 @@ services: - SE_ENABLE_TRACING=false selenium-router: - image: selenium/router:4.27.0-20241204 + image: selenium/router:4.27.0-20241225 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-router @@ -82,7 +82,7 @@ services: - SE_ENABLE_TRACING=false chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -95,7 +95,7 @@ services: - SE_ENABLE_TRACING=false edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -108,7 +108,7 @@ services: - SE_ENABLE_TRACING=false firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar diff --git a/docker-compose-v3-full-grid-external-datastore.yml b/docker-compose-v3-full-grid-external-datastore.yml index bba08d798..bcf40933c 100644 --- a/docker-compose-v3-full-grid-external-datastore.yml +++ b/docker-compose-v3-full-grid-external-datastore.yml @@ -4,7 +4,7 @@ version: "3" services: selenium-event-bus: - image: selenium/event-bus:4.27.0-20241204 + image: selenium/event-bus:4.27.0-20241225 container_name: selenium-event-bus environment: - SE_ENABLE_TRACING=false @@ -14,7 +14,7 @@ services: - "5557:5557" selenium-sessions: - image: selenium/sessions:4.27.0-20241204 + image: selenium/sessions:4.27.0-20241225 container_name: selenium-sessions ports: - "5556:5556" @@ -55,7 +55,7 @@ services: - "6379:6379" selenium-session-queue: - image: selenium/session-queue:4.27.0-20241204 + image: selenium/session-queue:4.27.0-20241225 container_name: selenium-session-queue environment: - SE_ENABLE_TRACING=false @@ -63,7 +63,7 @@ services: - "5559:5559" selenium-distributor: - image: selenium/distributor:4.27.0-20241204 + image: selenium/distributor:4.27.0-20241225 container_name: selenium-distributor ports: - "5553:5553" @@ -82,7 +82,7 @@ services: - SE_ENABLE_TRACING=false selenium-router: - image: selenium/router:4.27.0-20241204 + image: selenium/router:4.27.0-20241225 container_name: selenium-router ports: - "4444:4444" @@ -100,7 +100,7 @@ services: - SE_ENABLE_TRACING=false chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-event-bus @@ -111,7 +111,7 @@ services: - SE_ENABLE_TRACING=false edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-event-bus @@ -122,7 +122,7 @@ services: - SE_ENABLE_TRACING=false firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-event-bus diff --git a/docker-compose-v3-full-grid-secure.yml b/docker-compose-v3-full-grid-secure.yml index bed362084..37fdcce0a 100644 --- a/docker-compose-v3-full-grid-secure.yml +++ b/docker-compose-v3-full-grid-secure.yml @@ -4,7 +4,7 @@ version: "3" services: selenium-event-bus: - image: selenium/event-bus:4.27.0-20241204 + image: selenium/event-bus:4.27.0-20241225 container_name: selenium-event-bus ports: - "4442:4442" @@ -17,7 +17,7 @@ services: - SE_ENABLE_TRACING=false selenium-sessions: - image: selenium/sessions:4.27.0-20241204 + image: selenium/sessions:4.27.0-20241225 container_name: selenium-sessions ports: - "5556:5556" @@ -33,7 +33,7 @@ services: - SE_ENABLE_TRACING=false selenium-session-queue: - image: selenium/session-queue:4.27.0-20241204 + image: selenium/session-queue:4.27.0-20241225 container_name: selenium-session-queue volumes: - ./charts/selenium-grid/certs:/opt/selenium/secrets @@ -44,7 +44,7 @@ services: - SE_ENABLE_TRACING=false selenium-distributor: - image: selenium/distributor:4.27.0-20241204 + image: selenium/distributor:4.27.0-20241225 container_name: selenium-distributor ports: - "5553:5553" @@ -66,7 +66,7 @@ services: - SE_ENABLE_TRACING=false selenium-router: - image: selenium/router:4.27.0-20241204 + image: selenium/router:4.27.0-20241225 container_name: selenium-router ports: - "4444:4444" @@ -87,7 +87,7 @@ services: - SE_ENABLE_TRACING=false chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-event-bus @@ -103,7 +103,7 @@ services: - SE_ENABLE_TRACING=false edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-event-bus @@ -119,7 +119,7 @@ services: - SE_ENABLE_TRACING=false firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-event-bus diff --git a/docker-compose-v3-full-grid-swarm.yml b/docker-compose-v3-full-grid-swarm.yml index 185044568..cae4a4334 100644 --- a/docker-compose-v3-full-grid-swarm.yml +++ b/docker-compose-v3-full-grid-swarm.yml @@ -7,7 +7,7 @@ version: '3.7' services: chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -19,7 +19,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -31,7 +31,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -43,7 +43,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' selenium-hub: - image: selenium/hub:4.27.0-20241204 + image: selenium/hub:4.27.0-20241225 environment: - SE_ENABLE_TRACING=false ports: diff --git a/docker-compose-v3-full-grid-tracing.yml b/docker-compose-v3-full-grid-tracing.yml index dce62db68..c1acd5613 100644 --- a/docker-compose-v3-full-grid-tracing.yml +++ b/docker-compose-v3-full-grid-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "4317:4317" selenium-event-bus: - image: selenium/event-bus:4.27.0-20241204 + image: selenium/event-bus:4.27.0-20241225 container_name: selenium-event-bus ports: - "4442:4442" @@ -22,7 +22,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 selenium-sessions: - image: selenium/sessions:4.27.0-20241204 + image: selenium/sessions:4.27.0-20241225 container_name: selenium-sessions ports: - "5556:5556" @@ -36,7 +36,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 selenium-session-queue: - image: selenium/session-queue:4.27.0-20241204 + image: selenium/session-queue:4.27.0-20241225 container_name: selenium-session-queue ports: - "5559:5559" @@ -45,7 +45,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 selenium-distributor: - image: selenium/distributor:4.27.0-20241204 + image: selenium/distributor:4.27.0-20241225 container_name: selenium-distributor ports: - "5553:5553" @@ -65,7 +65,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 selenium-router: - image: selenium/router:4.27.0-20241204 + image: selenium/router:4.27.0-20241225 container_name: selenium-router ports: - "4444:4444" @@ -84,7 +84,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-event-bus @@ -96,7 +96,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-event-bus @@ -108,7 +108,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-event-bus diff --git a/docker-compose-v3-full-grid.yml b/docker-compose-v3-full-grid.yml index e6d9c82e5..b1e66ad2a 100644 --- a/docker-compose-v3-full-grid.yml +++ b/docker-compose-v3-full-grid.yml @@ -4,7 +4,7 @@ version: "3" services: selenium-event-bus: - image: selenium/event-bus:4.27.0-20241204 + image: selenium/event-bus:4.27.0-20241225 container_name: selenium-event-bus environment: - SE_ENABLE_TRACING=false @@ -14,7 +14,7 @@ services: - "5557:5557" selenium-sessions: - image: selenium/sessions:4.27.0-20241204 + image: selenium/sessions:4.27.0-20241225 container_name: selenium-sessions ports: - "5556:5556" @@ -27,7 +27,7 @@ services: - SE_ENABLE_TRACING=false selenium-session-queue: - image: selenium/session-queue:4.27.0-20241204 + image: selenium/session-queue:4.27.0-20241225 container_name: selenium-session-queue environment: - SE_ENABLE_TRACING=false @@ -35,7 +35,7 @@ services: - "5559:5559" selenium-distributor: - image: selenium/distributor:4.27.0-20241204 + image: selenium/distributor:4.27.0-20241225 container_name: selenium-distributor ports: - "5553:5553" @@ -54,7 +54,7 @@ services: - SE_ENABLE_TRACING=false selenium-router: - image: selenium/router:4.27.0-20241204 + image: selenium/router:4.27.0-20241225 container_name: selenium-router ports: - "4444:4444" @@ -72,7 +72,7 @@ services: - SE_ENABLE_TRACING=false chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-event-bus @@ -83,7 +83,7 @@ services: - SE_ENABLE_TRACING=false edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-event-bus @@ -94,7 +94,7 @@ services: - SE_ENABLE_TRACING=false firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-event-bus diff --git a/docker-compose-v3-swarm.yml b/docker-compose-v3-swarm.yml index 185044568..cae4a4334 100644 --- a/docker-compose-v3-swarm.yml +++ b/docker-compose-v3-swarm.yml @@ -7,7 +7,7 @@ version: '3.7' services: chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -19,7 +19,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -31,7 +31,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -43,7 +43,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' selenium-hub: - image: selenium/hub:4.27.0-20241204 + image: selenium/hub:4.27.0-20241225 environment: - SE_ENABLE_TRACING=false ports: diff --git a/docker-compose-v3-tracing.yml b/docker-compose-v3-tracing.yml index 41ebc942c..35ef14fc5 100644 --- a/docker-compose-v3-tracing.yml +++ b/docker-compose-v3-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "4317:4317" chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -22,7 +22,7 @@ services: - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -35,7 +35,7 @@ services: - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -48,7 +48,7 @@ services: - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 selenium-hub: - image: selenium/hub:4.27.0-20241204 + image: selenium/hub:4.27.0-20241225 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-video-in-node.yml b/docker-compose-v3-video-in-node.yml index f3ed9066b..5d8137383 100644 --- a/docker-compose-v3-video-in-node.yml +++ b/docker-compose-v3-video-in-node.yml @@ -7,7 +7,7 @@ services: deploy: mode: replicated replicas: 3 - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: deploy: mode: replicated replicas: 3 - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -41,7 +41,7 @@ services: deploy: mode: replicated replicas: 3 - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -55,7 +55,7 @@ services: - SE_NODE_GRID_URL=http://selenium-hub:4444 selenium-hub: - image: selenium/hub:4.27.0-20241204 + image: selenium/hub:4.27.0-20241225 container_name: selenium-hub environment: - SE_ENABLE_TRACING=false diff --git a/docker-compose-v3-video-upload-dynamic-grid.yml b/docker-compose-v3-video-upload-dynamic-grid.yml index c4be1d657..e08e548ce 100644 --- a/docker-compose-v3-video-upload-dynamic-grid.yml +++ b/docker-compose-v3-video-upload-dynamic-grid.yml @@ -16,7 +16,7 @@ services: stop_grace_period: 30s node-docker: - image: selenium/node-docker:4.27.0-20241204 + image: selenium/node-docker:4.27.0-20241225 volumes: - ./assets:/opt/selenium/assets - ./NodeDocker/config.toml:/opt/selenium/config.toml @@ -43,7 +43,7 @@ services: - SE_ENABLE_TRACING=false selenium-hub: - image: selenium/hub:4.27.0-20241204 + image: selenium/hub:4.27.0-20241225 container_name: selenium-hub environment: - SE_ENABLE_TRACING=false diff --git a/docker-compose-v3-video-upload-standalone.yml b/docker-compose-v3-video-upload-standalone.yml index 991431621..75e5cfc1e 100644 --- a/docker-compose-v3-video-upload-standalone.yml +++ b/docker-compose-v3-video-upload-standalone.yml @@ -17,7 +17,7 @@ services: stop_grace_period: 30s standalone_chrome: - image: selenium/standalone-chrome:4.27.0-20241204 + image: selenium/standalone-chrome:4.27.0-20241225 shm_size: 2gb ports: - "4444:4444" @@ -28,7 +28,7 @@ services: - SE_ENABLE_TRACING=false standalone_edge: - image: selenium/standalone-edge:4.27.0-20241204 + image: selenium/standalone-edge:4.27.0-20241225 shm_size: 2gb ports: - "5444:4444" @@ -39,7 +39,7 @@ services: - SE_ENABLE_TRACING=false standalone_firefox: - image: selenium/standalone-firefox:4.27.0-20241204 + image: selenium/standalone-firefox:4.27.0-20241225 shm_size: 2gb ports: - "6444:4444" @@ -50,7 +50,7 @@ services: - SE_ENABLE_TRACING=false chrome_video: - image: selenium/video:ffmpeg-7.1-20241204 + image: selenium/video:ffmpeg-7.1-20241225 depends_on: - standalone_chrome environment: @@ -74,7 +74,7 @@ services: stop_grace_period: 30s edge_video: - image: selenium/video:ffmpeg-7.1-20241204 + image: selenium/video:ffmpeg-7.1-20241225 depends_on: - standalone_edge environment: @@ -98,7 +98,7 @@ services: stop_grace_period: 30s firefox_video: - image: selenium/video:ffmpeg-7.1-20241204 + image: selenium/video:ffmpeg-7.1-20241225 depends_on: - standalone_firefox environment: diff --git a/docker-compose-v3-video-upload.yml b/docker-compose-v3-video-upload.yml index 63d8d3deb..4c1ea1d34 100644 --- a/docker-compose-v3-video-upload.yml +++ b/docker-compose-v3-video-upload.yml @@ -17,7 +17,7 @@ services: stop_grace_period: 30s chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -28,7 +28,7 @@ services: - SE_ENABLE_TRACING=false edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -39,7 +39,7 @@ services: - SE_ENABLE_TRACING=false firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -50,7 +50,7 @@ services: - SE_ENABLE_TRACING=false chrome_video: - image: selenium/video:ffmpeg-7.1-20241204 + image: selenium/video:ffmpeg-7.1-20241225 depends_on: - chrome environment: @@ -70,7 +70,7 @@ services: - RCLONE_CONFIG_MYFTP_FTP_CONCURRENCY=10 edge_video: - image: selenium/video:ffmpeg-7.1-20241204 + image: selenium/video:ffmpeg-7.1-20241225 depends_on: - edge environment: @@ -90,7 +90,7 @@ services: - RCLONE_CONFIG_MYFTP_FTP_CONCURRENCY=10 firefox_video: - image: selenium/video:ffmpeg-7.1-20241204 + image: selenium/video:ffmpeg-7.1-20241225 depends_on: - firefox environment: @@ -110,7 +110,7 @@ services: - RCLONE_CONFIG_MYFTP_FTP_CONCURRENCY=10 selenium-hub: - image: selenium/hub:4.27.0-20241204 + image: selenium/hub:4.27.0-20241225 container_name: selenium-hub environment: - SE_ENABLE_TRACING=false diff --git a/docker-compose-v3-video.yml b/docker-compose-v3-video.yml index cdd488ae7..1d90f3b3d 100644 --- a/docker-compose-v3-video.yml +++ b/docker-compose-v3-video.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -15,7 +15,7 @@ services: - SE_ENABLE_TRACING=false edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -26,7 +26,7 @@ services: - SE_ENABLE_TRACING=false firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -37,7 +37,7 @@ services: - SE_ENABLE_TRACING=false chrome_video: - image: selenium/video:ffmpeg-7.1-20241204 + image: selenium/video:ffmpeg-7.1-20241225 volumes: - /tmp/videos:/videos depends_on: @@ -49,7 +49,7 @@ services: - SE_VIDEO_FILE_NAME=auto edge_video: - image: selenium/video:ffmpeg-7.1-20241204 + image: selenium/video:ffmpeg-7.1-20241225 volumes: - /tmp/videos:/videos depends_on: @@ -61,7 +61,7 @@ services: - SE_VIDEO_FILE_NAME=auto firefox_video: - image: selenium/video:ffmpeg-7.1-20241204 + image: selenium/video:ffmpeg-7.1-20241225 volumes: - /tmp/videos:/videos depends_on: @@ -73,7 +73,7 @@ services: - SE_VIDEO_FILE_NAME=auto selenium-hub: - image: selenium/hub:4.27.0-20241204 + image: selenium/hub:4.27.0-20241225 container_name: selenium-hub environment: - SE_ENABLE_TRACING=false diff --git a/docker-compose-v3.yml b/docker-compose-v3.yml index a23542db4..b5f9d8197 100644 --- a/docker-compose-v3.yml +++ b/docker-compose-v3.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.27.0-20241204 + image: selenium/node-chrome:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -15,7 +15,7 @@ services: - SE_ENABLE_TRACING=false edge: - image: selenium/node-edge:4.27.0-20241204 + image: selenium/node-edge:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -26,7 +26,7 @@ services: - SE_ENABLE_TRACING=false firefox: - image: selenium/node-firefox:4.27.0-20241204 + image: selenium/node-firefox:4.27.0-20241225 shm_size: 2gb depends_on: - selenium-hub @@ -37,7 +37,7 @@ services: - SE_ENABLE_TRACING=false selenium-hub: - image: selenium/hub:4.27.0-20241204 + image: selenium/hub:4.27.0-20241225 container_name: selenium-hub environment: - SE_ENABLE_TRACING=false