Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS API should expose if a table is refreshing #4999

Merged
merged 48 commits into from
Jan 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b048f9c
Hacked together tests
niloc132 Apr 14, 2023
c05823a
Tests build, but do not pass
niloc132 Apr 19, 2023
30d1df4
bad idea: opt in to a huge payload from the server - should instead
niloc132 Sep 28, 2023
47a68cd
quick hack to decrease treemap costs - fix with non-random loading
niloc132 Sep 28, 2023
ea53236
spotless for ci
niloc132 Oct 23, 2023
e8ddd50
fix regression in formatting longs
niloc132 Nov 2, 2023
5f8cb54
integration tests run, fail
niloc132 Nov 2, 2023
a855985
Tests are passing in manual mode, except filter setup
niloc132 Nov 3, 2023
06a17a5
Tidy up tests, disable filter tests for now
niloc132 Nov 3, 2023
354fd48
Add additional integration tests
niloc132 Nov 6, 2023
d8ad542
null values test
niloc132 Nov 6, 2023
9df4859
POtential totals table test
niloc132 Nov 6, 2023
d9da1ca
Attempt at reusing code from gwt-core test
niloc132 Dec 21, 2023
6e6326d
Nearly working tests from gradle, with TODOs
niloc132 Dec 23, 2023
92e6f3a
Checkpoint commit, gwt test tasks pass, check fails
niloc132 Dec 27, 2023
37639a0
Dirty hack to avoid esoco's assumption that compile must run after test
niloc132 Dec 27, 2023
03939d9
Don't run gwt tests with in quick
niloc132 Dec 27, 2023
0d15ac3
Remove unused build file, raise timeout on a test
niloc132 Dec 27, 2023
49b9b95
Merge branch 'main' into js-flight
niloc132 Dec 27, 2023
0d02ff3
Clean up readability, use a registry image
niloc132 Dec 27, 2023
dd54ea8
tidy things up to working in CI
niloc132 Dec 27, 2023
e16cbb7
Revert SubscriptionTableData, WorkerConnection
niloc132 Dec 27, 2023
4af1341
Final cleanup (?)
niloc132 Dec 27, 2023
8cd5215
Add server support for indicating that a hierarchical table is
niloc132 Dec 7, 2023
fca4cb0
Populate simpler js types to expose isRefreshing()
niloc132 Dec 7, 2023
3928d91
Update generated gwt bindings
niloc132 Dec 7, 2023
2e5ff31
Update other generated proto code
niloc132 Dec 7, 2023
7986f4a
Finish off the feature, cleanup
niloc132 Dec 29, 2023
43a102f
Parameterize port and timeouts, other cleanup
niloc132 Jan 2, 2024
2bab42b
Rework networking so hopefully docker-desktop behaves
niloc132 Jan 2, 2024
b26a0b1
Revert "Combine auth wiring codegen in a single plugin"
niloc132 Dec 29, 2023
cf04ac0
Review fix
niloc132 Jan 2, 2024
a773b1c
Merge branch 'main' into 4485-isRefreshing
niloc132 Jan 2, 2024
c1d4863
Also update generated go
niloc132 Jan 2, 2024
d61c783
Add healthcheck, cleanup
niloc132 Jan 2, 2024
a11687d
Clean up forked test runner
niloc132 Jan 2, 2024
e03f3e7
Inline more wd runstyle contents
niloc132 Jan 2, 2024
ab0bb30
Change up timeouts a bit
mofojed Jan 3, 2024
4413dcf
Increase a few more timeouts and make them unique
niloc132 Jan 3, 2024
0250bcb
Merge branch 'js-flight' into 4485-isRefreshing
niloc132 Jan 3, 2024
067d3cd
Start adding refreshing test
niloc132 Jan 3, 2024
a0c4f0d
Add missing basic column types
niloc132 Jan 3, 2024
c134116
Merge branch 'js-flight' into 4485-isRefreshing
niloc132 Jan 3, 2024
6b04a90
Add test for treetable, table.isClosed
niloc132 Jan 7, 2024
713007d
Fix selenium port mapping
niloc132 Jan 9, 2024
1758aef
Merge branch 'js-flight' into 4485-isRefreshing
niloc132 Jan 17, 2024
fcd8a92
Merge branch 'main' into 4485-isRefreshing
niloc132 Jan 17, 2024
b17d69b
spotless
niloc132 Jan 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up forked test runner
  • Loading branch information
niloc132 committed Jan 2, 2024
commit a11687de7215c3eba724ccdfe37e9f823e3f3d34
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;

/**
* RunStyle implementation to delegate to Selenium RemoteWebDriver implementations. Simplified version
* of implementation found in <a href="https://github.com/gwtproject/gwt-core">gwt-core</a>.
*/
public class RunStyleRemoteWebDriver extends RunStyle {

public static class RemoteWebDriverConfiguration {
Expand All @@ -39,14 +44,27 @@ public void setBrowserCapabilities(List<Map<String, ?>> browserCapabilities) {
}
}

public class ConfigurationException extends Exception {
}

private List<RemoteWebDriver> browsers = new ArrayList<>();
private Thread keepalive;
private final List<RemoteWebDriver> browsers = new ArrayList<>();
private final Thread keepalive;

public RunStyleRemoteWebDriver(JUnitShell shell) {
super(shell);

keepalive = new Thread(() -> {
while (true) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
break;
}
for (RemoteWebDriver browser : browsers) {
// As in RunStyleSelenium, simple way to poll the browser and ensure it is still alive, even if
// not actively being used at the moment.
browser.getTitle();
}
}
});
keepalive.setDaemon(true);
}

/**
Expand All @@ -56,21 +74,20 @@ public RunStyleRemoteWebDriver(JUnitShell shell) {
* @param args the command line argument string passed from JUnitShell
* @return the configuration to use when running these tests
*/
protected RemoteWebDriverConfiguration readConfiguration(String args)
throws ConfigurationException {
protected Optional<RemoteWebDriverConfiguration> readConfiguration(String args) {
RemoteWebDriverConfiguration config = new RemoteWebDriverConfiguration();
if (args == null || args.length() == 0) {
if (args == null || args.isEmpty()) {
getLogger().log(TreeLogger.ERROR,
"RemoteWebDriver runstyle requires a parameter of the form protocol://hostname:port?browser1[,browser2]");
throw new ConfigurationException();
return Optional.empty();
}

String[] parts = args.split("\\?");
String url = parts[0];
URL remoteAddress = null;
URL remoteAddress;
try {
remoteAddress = new URL(url);
if (remoteAddress.getPath().equals("")
if (remoteAddress.getPath().isEmpty()
|| (remoteAddress.getPath().equals("/") && !url.endsWith("/"))) {
getLogger().log(TreeLogger.INFO, "No path specified in webdriver remote url, using default of /wd/hub");
config.setRemoteWebDriverUrl(url + "/wd/hub");
Expand All @@ -79,7 +96,7 @@ protected RemoteWebDriverConfiguration readConfiguration(String args)
}
} catch (MalformedURLException e) {
getLogger().log(TreeLogger.ERROR, e.getMessage(), e);
throw new ConfigurationException();
return Optional.empty();
}

// build each driver based on parts[1].split(",")
Expand All @@ -91,29 +108,27 @@ protected RemoteWebDriverConfiguration readConfiguration(String args)
config.getBrowserCapabilities().add(capabilities.asMap());
}

return config;
return Optional.of(config);
}


@Override
public final int initialize(String args) {
final RemoteWebDriverConfiguration config;
try {
config = readConfiguration(args);
} catch (ConfigurationException failed) {
final Optional<RemoteWebDriverConfiguration> config = readConfiguration(args);
if (config.isEmpty()) {
// log should already have details about what went wrong, we will just return the failure value
return -1;
}

final URL remoteAddress;
try {
remoteAddress = new URL(config.getRemoteWebDriverUrl());
remoteAddress = new URL(config.get().getRemoteWebDriverUrl());
} catch (MalformedURLException e) {
getLogger().log(TreeLogger.ERROR, e.getMessage(), e);
return -1;
}

for (Map<String, ?> capabilityMap : config.getBrowserCapabilities()) {
for (Map<String, ?> capabilityMap : config.get().getBrowserCapabilities()) {
DesiredCapabilities capabilities = new DesiredCapabilities(capabilityMap);

try {
Expand All @@ -125,43 +140,25 @@ public final int initialize(String args) {
}
}

Runtime.getRuntime()
.addShutdownHook(
new Thread(
() -> {
if (keepalive != null) {
keepalive.interrupt();
}
for (RemoteWebDriver browser : browsers) {
try {
browser.close();
} catch (Exception ignored) {
// ignore, we're shutting down, continue shutting down others
}
}
}));
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
keepalive.interrupt();
for (RemoteWebDriver browser : browsers) {
try {
browser.close();
} catch (Exception ignored) {
// ignore, we're shutting down, continue shutting down others
}
}
}));
return browsers.size();
}

@Override
public void launchModule(String moduleName) throws UnableToCompleteException {
// since WebDriver.get is blocking, start a keepalive thread first
keepalive =
new Thread(
() -> {
while (true) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
break;
}
for (RemoteWebDriver browser : browsers) {
browser.getTitle(); // as in RunStyleSelenium, simple way to poll the browser
}
}
});
keepalive.setDaemon(true);
// Since WebDriver.get is blocking, start the keepalive thread first
keepalive.start();

// Starts each browser to run the tests at the url specified by JUnit+GWT.
for (RemoteWebDriver browser : browsers) {
browser.get(shell.getModuleUrl(moduleName));
}
Expand Down