Skip to content

Commit

Permalink
[java] Fixing grid tests broken by last buck upgrade, we should expli…
Browse files Browse the repository at this point in the history
…citly build server before using it
  • Loading branch information
barancev committed Apr 2, 2019
1 parent 98dbd69 commit 80a3cbf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
import static org.openqa.selenium.UnexpectedAlertBehaviour.IGNORE;
import static org.openqa.selenium.build.DevMode.isInDevMode;
import static org.openqa.selenium.remote.CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR;

import com.google.common.base.Throwables;
Expand Down Expand Up @@ -95,7 +96,7 @@ public static void buildJavascriptLibraries() throws IOException {
InProject.locate("java/client/build/production/com/thoughtworks/selenium/webdriven");
Files.createDirectories(dir);
for (String target : ATOM_TARGETS) {
Path atom = new BuckBuild().of("//javascript/selenium-atoms:" + target).go();
Path atom = new BuckBuild().of("//javascript/selenium-atoms:" + target).go(isInDevMode());
Files.copy(atom, dir.resolve(atom.getFileName()), REPLACE_EXISTING);
}
Path sizzle = InProject.locate("third_party/js/sizzle/sizzle.js");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package com.thoughtworks.selenium.testing;

import static org.openqa.selenium.build.DevMode.isInDevMode;

import org.openqa.selenium.build.BuckBuild;
import org.openqa.selenium.environment.TestEnvironment;
import org.openqa.selenium.environment.webserver.AppServer;
Expand All @@ -41,7 +43,7 @@ public class SeleniumTestEnvironment implements TestEnvironment {
public SeleniumTestEnvironment(int port, String... extraArgs) {
try {
Path serverJar = new BuckBuild()
.of("//java/server/test/org/openqa/selenium:server-with-tests").go();
.of("//java/server/test/org/openqa/selenium:server-with-tests").go(isInDevMode());

List<Object> args = new ArrayList<>();
if (Boolean.getBoolean("webdriver.debug")) {
Expand Down
4 changes: 2 additions & 2 deletions java/client/test/org/openqa/selenium/build/BuckBuild.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public BuckBuild of(String target) {
return this;
}

public Path go() throws IOException {
public Path go(boolean inDevMode) throws IOException {
Path projectRoot = InProject.locate("Rakefile").getParent();

if (!isInDevMode()) {
if (!inDevMode) {
// we should only need to do this when we're in dev mode
// when running in a test suite, our dependencies should already
// be listed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.openqa.selenium.testing;

import static org.openqa.selenium.build.DevMode.isInDevMode;

import org.openqa.selenium.build.BuckBuild;
import org.openqa.selenium.build.DevMode;
import org.openqa.selenium.build.InProject;
Expand Down Expand Up @@ -61,7 +63,7 @@ private static void copy(String buildTarget, String copyTo) {
return;
}

Path source = new BuckBuild().of(buildTarget).go();
Path source = new BuckBuild().of(buildTarget).go(isInDevMode());

Files.createDirectories(dest.getParent());
Files.copy(source, dest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.openqa.selenium.testing.drivers;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.openqa.selenium.build.DevMode.isInDevMode;

import org.openqa.selenium.build.BuckBuild;
import org.openqa.selenium.net.NetworkUtils;
Expand Down Expand Up @@ -114,7 +115,7 @@ public void stop() {
}

private String buildServerAndClasspath() throws IOException {
Path serverJar = new BuckBuild().of("//java/server/src/org/openqa/grid/selenium:selenium").go();
Path serverJar = new BuckBuild().of("//java/server/src/org/openqa/grid/selenium:selenium").go(true);
return serverJar.toAbsolutePath().toString();
}

Expand Down

0 comments on commit 80a3cbf

Please sign in to comment.