Skip to content

Commit

Permalink
[bazel] Fix runfiles loading in JavaScript tests
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Apr 18, 2024
1 parent 0608c63 commit 3e8261d
Show file tree
Hide file tree
Showing 8 changed files with 21,784 additions and 1,551 deletions.
23,313 changes: 21,773 additions & 1,540 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion java/test/org/openqa/selenium/build/InProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static Path findProjectRoot() {
if (!Platform.getCurrent().is(WINDOWS)) {
dir = findRunfilesRoot();
if (dir != null) {
return dir.resolve("selenium").normalize();
return dir.resolve("_main").normalize();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public Collection<DynamicTest> dynamicTests() throws IOException {
try {
String url = "/" + s;
if (isBazel() && !url.startsWith("/common/generated/")) {
url = "/filez/selenium" + url;
url = "/filez/_main" + url;
}
return new URL(appServer.whereIs(url));
} catch (MalformedURLException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static Path getTestDirectory() {
Path testDir;
if (runfiles != null) {
// Running with bazel.
testDir = runfiles.resolve("selenium").resolve(testDirName);
testDir = runfiles.resolve("_main").resolve(testDirName);
} else {
// Legacy.
testDir = InProject.locate(testDirName);
Expand Down
2 changes: 1 addition & 1 deletion javascript/atoms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ browser. You can do this by starting a debug server:
bazel run javascript/atoms:test_debug_server
```

And then navigating to: <http://localhost:2310/filez/selenium/javascript/atoms/>
And then navigating to: <http://localhost:2310/filez/_main/javascript/atoms/>

You'll be able to browse around the filesystem until you find the test
you want to work on.
Expand Down
4 changes: 2 additions & 2 deletions javascript/atoms/test/test_bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
'../../deps.js'
];

if (location.pathname.lastIndexOf('/filez/selenium/javascript/', 0) === 0) {
if (location.pathname.lastIndexOf('/filez/_main/javascript/', 0) === 0) {
directoryPath = '';
files = [
'/filez/com_google_javascript_closure_library/closure/goog/base.js',
'/filez/selenium/javascript/atoms/deps.js',
'/filez/_main/javascript/atoms/deps.js',
];
}

Expand Down
4 changes: 2 additions & 2 deletions javascript/chrome-driver/test/test_bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@
'../../deps.js'
];

if (location.pathname.lastIndexOf('/filez/selenium/javascript/', 0) === 0) {
if (location.pathname.lastIndexOf('/filez/_main/javascript/', 0) === 0) {
directoryPath = '';
files = [
'/filez/com_google_javascript_closure_library/closure/goog/base.js',
'/filez/selenium/javascript/chrome-driver/deps.js',
'/filez/_main/javascript/chrome-driver/deps.js',
];
}

Expand Down
6 changes: 3 additions & 3 deletions javascript/webdriver/test/test_bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@
];


if (location.pathname.lastIndexOf('/filez/selenium/javascript/', 0) === 0
if (location.pathname.lastIndexOf('/filez/_main/javascript/', 0) === 0
|| location.pathname.lastIndexOf('/common/generated/javascript/', 0) === 0) {
directoryPath = '';
files = [
'/filez/com_google_javascript_closure_library/closure/goog/base.js',
'/filez/selenium/javascript/atoms/deps.js',
'/filez/selenium/javascript/webdriver/deps.js',
'/filez/_main/javascript/atoms/deps.js',
'/filez/_main/javascript/webdriver/deps.js',
];
}

Expand Down

0 comments on commit 3e8261d

Please sign in to comment.