Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions src/org/labkey/test/pages/core/admin/ShowAdminPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ public void clickPostgresLocks()
clickSettingsLink("postgres locks");
}

public void clickPostgresTableSizes()
{
clickSettingsLink("postgres table sizes");
}

public List<WebElement> getAllAdminConsoleLinks()
{
goToSettingsSection();
Expand Down
14 changes: 14 additions & 0 deletions src/org/labkey/test/tests/PostgresQueriesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public void testQueries() throws IOException, CommandException
goToAdminConsole().clickPostgresLocks();
verifyLocksGrid();

// Verify locks grid as site admin
goToAdminConsole().clickPostgresTableSizes();
verifyTableSizesGrid();

// Verify project admin gets a 401 for locks grid
pushLocation();
Expand Down Expand Up @@ -150,6 +153,17 @@ private void verifyLocksGrid()
Assertions.assertThat(cols).as("pg_locks columns").contains("Locktype", "Virtualtransaction");
}

private void verifyTableSizesGrid()
{
assertTextPresent("pg_tablesizes");
DataRegionTable table = new DataRegionTable("query", this);
List<String> cols = table.getColumnLabels();
Assertions.assertThat(cols).as("pg_tablesizes columns").contains("Table Schema", "Table Name", "Table Size", "Index Size", "Total Size");
// Check a couple of expected tables
table.setFilter("table_schema", "Equals", "audit");
assertTextPresent("queryupdateauditdomain", "userauditdomain");
}

private void verifyActivityGrid(boolean expectDelete)
{
assertTextPresent("pg_stat_activity");
Expand Down