Skip to content

Commit 246d1d1

Browse files
authored
Merge branch 'trunk' into grid-slot-matcher
2 parents 7369c6a + c0b45ad commit 246d1d1

File tree

8 files changed

+154
-45
lines changed

8 files changed

+154
-45
lines changed

.github/workflows/bazel.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ jobs:
8282
steps:
8383
- name: Checkout source tree
8484
uses: actions/checkout@v4
85+
- name: Pull latest changes
86+
if: startsWith(github.head_ref, 'renovate/')
87+
run: git pull origin ${{ github.head_ref }}
8588
- name: Free space
8689
if: inputs.os != 'windows'
8790
run: ./scripts/github-actions/free-disk-space.sh

.github/workflows/ci-rbe.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
format:
1212
name: Format
13-
if: github.repository_owner == 'seleniumhq'
13+
if: github.repository_owner == 'seleniumhq' && startsWith(github.head_ref, 'renovate/') != true
1414
uses: ./.github/workflows/bazel.yml
1515
with:
1616
name: Check format script run
@@ -20,7 +20,7 @@ jobs:
2020

2121
test:
2222
name: Test
23-
if: github.repository_owner == 'seleniumhq'
23+
if: github.repository_owner == 'seleniumhq' && startsWith(github.head_ref, 'renovate/') != true
2424
uses: ./.github/workflows/bazel.yml
2525
with:
2626
name: All RBE tests
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI - Renovate - RBE
2+
3+
on:
4+
push:
5+
branches:
6+
- renovate/*
7+
workflow_dispatch:
8+
9+
jobs:
10+
format:
11+
runs-on: ubuntu-latest
12+
if: github.repository_owner == 'seleniumhq'
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v4
16+
- name: java - repin dependencies
17+
if: contains(join(github.event.commits.*.message), '[java]')
18+
run: REPIN=1 bazel run @maven//:pin
19+
- name: rust - repin dependencies
20+
if: contains(join(github.event.commits.*.message), '[rust]')
21+
run: CARGO_BAZEL_REPIN=true bazel sync --only=crates
22+
- name: js - repin dependencies
23+
if: contains(join(github.event.commits.*.message), '[js]')
24+
run: bazel run -- @pnpm//:pnpm install --dir $PWD --lockfile-only
25+
- name: dotnet - repin dependencies
26+
if: contains(join(github.event.commits.*.message), '[dotnet]')
27+
run: ./dotnet/update-deps.sh
28+
- name: py - repin dependencies
29+
if: contains(join(github.event.commits.*.message), '[py]')
30+
run: bazel run //py:requirements.update
31+
- name: Commit files
32+
run: |
33+
export CHANGES=$(git status -s)
34+
if [ -n "$CHANGES" ]; then
35+
git config --local user.email "[email protected]"
36+
git config --local user.name "Selenium CI Bot"
37+
git add .
38+
git commit -m 'Repin dependencies'
39+
git push
40+
fi
41+
42+
check-format:
43+
needs: format
44+
name: Check format
45+
if: github.repository_owner == 'seleniumhq'
46+
uses: ./.github/workflows/bazel.yml
47+
with:
48+
name: Check format script run
49+
caching: false
50+
ruby-version: jruby-9.4.8.0
51+
run: ./scripts/github-actions/check-format.sh
52+
53+
test:
54+
name: Test
55+
if: github.repository_owner == 'seleniumhq'
56+
uses: ./.github/workflows/bazel.yml
57+
with:
58+
name: All RBE tests
59+
caching: false
60+
ruby-version: jruby-9.4.8.0
61+
run: ./scripts/github-actions/ci-build.sh

dotnet/src/webdriver/SessionId.cs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,27 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using System;
21+
22+
#nullable enable
23+
2024
namespace OpenQA.Selenium
2125
{
2226
/// <summary>
2327
/// Provides a mechanism for maintaining a session for a test
2428
/// </summary>
2529
public class SessionId
2630
{
27-
private string sessionOpaqueKey;
31+
private readonly string sessionOpaqueKey;
2832

2933
/// <summary>
3034
/// Initializes a new instance of the <see cref="SessionId"/> class
3135
/// </summary>
3236
/// <param name="opaqueKey">Key for the session in use</param>
37+
/// <exception cref="ArgumentNullException">If <paramref name="opaqueKey"/> is <see langword="null"/>.</exception>
3338
public SessionId(string opaqueKey)
3439
{
35-
this.sessionOpaqueKey = opaqueKey;
40+
this.sessionOpaqueKey = opaqueKey ?? throw new ArgumentNullException(nameof(opaqueKey));
3641
}
3742

3843
/// <summary>
@@ -54,20 +59,13 @@ public override int GetHashCode()
5459
}
5560

5661
/// <summary>
57-
/// Compares two Sessions
62+
/// Indicates whether the current session ID value is the same as <paramref name="obj"/>.
5863
/// </summary>
59-
/// <param name="obj">Session to compare</param>
60-
/// <returns>True if they are equal or False if they are not</returns>
61-
public override bool Equals(object obj)
64+
/// <param name="obj">The session to compare to.</param>
65+
/// <returns><see langword="true"/> if the values are equal; otherwise, <see langword="false"/>.</returns>
66+
public override bool Equals(object? obj)
6267
{
63-
bool objectsAreEqual = false;
64-
SessionId other = obj as SessionId;
65-
if (other != null)
66-
{
67-
objectsAreEqual = this.sessionOpaqueKey.Equals(other.sessionOpaqueKey);
68-
}
69-
70-
return objectsAreEqual;
68+
return obj is SessionId otherSession && this.sessionOpaqueKey.Equals(otherSession.sessionOpaqueKey);
7169
}
7270
}
7371
}

dotnet/src/webdriver/WebDriver.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using System.Collections;
2525
using System.Collections.Generic;
2626
using System.Collections.ObjectModel;
27+
using System.Diagnostics.CodeAnalysis;
2728
using System.Globalization;
2829
using System.Threading.Tasks;
2930

@@ -44,7 +45,7 @@ public class WebDriver : IWebDriver, ISearchContext, IJavaScriptExecutor, IFinds
4445
private IFileDetector fileDetector = new DefaultFileDetector();
4546
private NetworkManager network;
4647
private WebElementFactory elementFactory;
47-
private SessionId sessionId;
48+
4849
private List<string> registeredCommands = new List<string>();
4950

5051
/// <summary>
@@ -191,10 +192,7 @@ public bool IsActionExecutor
191192
/// <summary>
192193
/// Gets the <see cref="SessionId"/> for the current session of this driver.
193194
/// </summary>
194-
public SessionId SessionId
195-
{
196-
get { return this.sessionId; }
197-
}
195+
public SessionId SessionId { get; private set; }
198196

199197
/// <summary>
200198
/// Gets or sets the <see cref="IFileDetector"/> responsible for detecting
@@ -612,7 +610,7 @@ protected virtual Response Execute(string driverCommandToExecute,
612610
/// <returns>A <see cref="Response"/> containing information about the success or failure of the command and any data returned by the command.</returns>
613611
protected virtual async Task<Response> ExecuteAsync(string driverCommandToExecute, Dictionary<string, object> parameters)
614612
{
615-
Command commandToExecute = new Command(this.sessionId, driverCommandToExecute, parameters);
613+
Command commandToExecute = new Command(SessionId, driverCommandToExecute, parameters);
616614

617615
Response commandResponse;
618616

@@ -641,6 +639,7 @@ protected virtual async Task<Response> ExecuteAsync(string driverCommandToExecut
641639
/// Starts a session with the driver
642640
/// </summary>
643641
/// <param name="capabilities">Capabilities of the browser</param>
642+
[MemberNotNull(nameof(SessionId))]
644643
protected void StartSession(ICapabilities capabilities)
645644
{
646645
Dictionary<string, object> parameters = new Dictionary<string, object>();
@@ -679,7 +678,9 @@ protected void StartSession(ICapabilities capabilities)
679678

680679
ReturnedCapabilities returnedCapabilities = new ReturnedCapabilities(rawCapabilities);
681680
this.capabilities = returnedCapabilities;
682-
this.sessionId = new SessionId(response.SessionId);
681+
682+
string sessionId = response.SessionId ?? throw new WebDriverException($"The remote end did not respond with ID of a session when it was required. {response.Value}");
683+
this.SessionId = new SessionId(sessionId);
683684
}
684685

685686
/// <summary>
@@ -723,7 +724,7 @@ protected virtual void Dispose(bool disposing)
723724
{
724725
try
725726
{
726-
if (this.sessionId is not null)
727+
if (this.SessionId is not null)
727728
{
728729
this.Execute(DriverCommand.Quit, null);
729730
}
@@ -739,7 +740,7 @@ protected virtual void Dispose(bool disposing)
739740
}
740741
finally
741742
{
742-
this.sessionId = null;
743+
this.SessionId = null;
743744
}
744745
this.executor.Dispose();
745746
}

dotnet/test/common/DevTools/DevToolsProfilerTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ private void ValidateProfile(CurrentCdpVersion.Profiler.Profile profiler)
131131
{
132132
Assert.That(profiler, Is.Not.Null);
133133
Assert.That(profiler.Nodes, Is.Not.Null);
134-
Assert.That(profiler.StartTime, Is.Not.Null);
135-
Assert.That(profiler.EndTime, Is.Not.Null);
134+
Assert.That(profiler.StartTime, Is.Not.Zero);
135+
Assert.That(profiler.EndTime, Is.Not.Zero);
136136
Assert.That(profiler.TimeDeltas, Is.Not.Null);
137137
foreach (var delta in profiler.TimeDeltas)
138138
{
139-
Assert.That(delta, Is.Not.Null);
139+
Assert.That(delta, Is.Not.Zero);
140140
}
141141

142142
foreach (var node in profiler.Nodes)

dotnet/test/common/DevTools/DevToolsTestFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void Setup()
3939
devTools = driver as IDevTools;
4040
if (devTools == null)
4141
{
42-
Assert.Ignore("{0} does not support Chrome DevTools Protocol", EnvironmentManager.Instance.Browser);
42+
Assert.Ignore($"{EnvironmentManager.Instance.Browser} does not support Chrome DevTools Protocol");
4343
return;
4444
}
4545

renovate.json

Lines changed: 62 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,82 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": ["config:recommended"],
4-
"labels": ["dependencies"],
54
"packageRules": [
65
{
7-
"matchPackageNames": ["bazel", "bazelisk"],
8-
"commitMessageSuffix": "[dotnet][java][js][py][rb][rust]"
6+
"matchManagers": [ "bazel", "bazel-module", "bazelisk" ],
7+
"matchPackageNames": [ "!rules_java", "!rules_jvm_external", "!contrib_rules_jvm", "!rules_dotnet", "!aspect_rules_js", "!aspect_rules_ts", "!rules_nodejs", "!rules_python", "!rules_ruby", "!rules_cc" ],
8+
"matchDatasources": [ "!maven" ],
9+
"commitMessagePrefix": "[dotnet][java][js][py][rb][rust]",
10+
"labels": [ "dependencies", "c-build" ]
911
},
1012
{
11-
"matchPackageNames": ["nuget"],
12-
"commitMessagePrefix": "[dotnet]"
13+
"matchManagers": [ "nuget" ],
14+
"commitMessagePrefix": "[dotnet]",
15+
"labels": [ "dependencies", "c-dotnet" ]
1316
},
1417
{
15-
"matchPackageNames": ["maven"],
16-
"commitMessagePrefix": "[java]"
18+
"matchPackageNames": [ "rules_dotnet" ],
19+
"commitMessagePrefix": "[dotnet]",
20+
"labels": [ "dependencies", "c-dotnet" ]
1721
},
1822
{
19-
"matchPackageNames": ["npm"],
20-
"commitMessagePrefix": "[js]"
23+
"matchManagers": [ "bazel", "bazel-module" ],
24+
"matchDatasources": ["maven"],
25+
"versioning": "maven",
26+
"commitMessagePrefix": "[java]",
27+
"labels": [ "dependencies", "c-java" ]
2128
},
2229
{
23-
"matchPackageNames": ["pip_requirements"],
24-
"commitMessagePrefix": "[py]"
30+
"matchManagers": [ "bazel-module" ],
31+
"matchPackageNames": [ "rules_java", "rules_jvm_external", "contrib_rules_jvm" ],
32+
"commitMessagePrefix": "[java]",
33+
"labels": [ "dependencies", "c-java" ]
2534
},
2635
{
27-
"matchPackageNames": ["bundler", "ruby-version"],
28-
"commitMessagePrefix": "[rb]"
36+
"matchManagers": [ "maven" ],
37+
"commitMessagePrefix": "[java]",
38+
"labels": [ "dependencies", "c-java" ]
2939
},
3040
{
31-
"matchPackageNames": ["cargo"],
32-
"commitMessagePrefix": "[rust]"
41+
"matchManagers": [ "npm" ],
42+
"commitMessagePrefix": "[js]",
43+
"labels": [ "dependencies", "c-nodejs" ]
44+
},
45+
{
46+
"matchPackageNames": [ "aspect_rules_js", "aspect_rules_ts", "rules_nodejs" ],
47+
"commitMessagePrefix": "[js]",
48+
"labels": [ "dependencies", "c-nodejs" ]
49+
},
50+
{
51+
"matchManagers": [ "pip_requirements", "pip_setup" ],
52+
"commitMessagePrefix": "[py]",
53+
"labels": [ "dependencies", "c-py" ]
54+
},
55+
{
56+
"matchPackageNames": [ "rules_python" ],
57+
"commitMessagePrefix": "[py]",
58+
"labels": [ "dependencies", "c-py" ]
59+
},
60+
{
61+
"matchManagers": [ "bundler", "ruby-version" ],
62+
"commitMessagePrefix": "[rb]",
63+
"labels": [ "dependencies", "c-rb" ]
64+
},
65+
{
66+
"matchPackageNames": [ "rules_ruby" ],
67+
"commitMessagePrefix": "[rb]",
68+
"labels": [ "dependencies", "c-rb" ]
69+
},
70+
{
71+
"matchManagers": [ "cargo" ],
72+
"commitMessagePrefix": "[rust]",
73+
"labels": [ "dependencies", "c-rust" ]
74+
},
75+
{
76+
"matchPackageNames": [ "rules_cc" ],
77+
"commitMessagePrefix": "[rust]",
78+
"labels": [ "dependencies", "c-rust" ]
3379
}
3480
],
35-
"prConcurrentLimit": 5
81+
"prConcurrentLimit": 10
3682
}

0 commit comments

Comments
 (0)