Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
ead7f60
Fetch WAL Tables
insmac May 14, 2024
f577cde
Filtering
insmac May 14, 2024
f51109d
Suspended table indicator
insmac May 14, 2024
ce785a3
Pass WAL data to tables, show suspension
insmac May 14, 2024
e475aa0
TEMP: Use mocked query for `wal_tables()`
insmac May 14, 2024
00bd041
Toggle suspended filter
insmac May 14, 2024
713ac7e
Suspended counter: adjust tooltip
insmac May 14, 2024
a14059a
Filter column names, refactor `information_schema.columns()` into store
insmac May 14, 2024
56bc782
Bring back `Add` feature
insmac May 15, 2024
4e75c93
Suspension details popover component
insmac May 15, 2024
7749b07
Suspension popover: change types
insmac May 15, 2024
b20b76d
Suspension Popover: trigger UI
insmac May 15, 2024
15e2cb8
Suspension popover: Add resume logic
insmac May 16, 2024
443f816
Add OS-specific error code mapping
insmac May 16, 2024
dc94064
Merge branch 'main' into web-console/suspended-tables
insmac May 16, 2024
19948b4
Refactor `<Schema>` to use state based views
insmac May 17, 2024
981d782
Suspension Popover: fix DOM structure
insmac May 17, 2024
2bb2f07
Suspension Popover: updates, bring back mocks
insmac May 17, 2024
85e441e
Merge branch 'main' into web-console/suspended-tables
insmac May 17, 2024
bf7f4ba
Add clear query icon
insmac May 17, 2024
8ae9330
Merge branch 'web-console/suspended-tables' of https://github.com/que…
insmac May 17, 2024
657a37a
Suspension Popover: add submit states
insmac May 20, 2024
b941e86
Toolbar: dim filter icon slightly
insmac May 20, 2024
ca0c847
Add query highlighting
insmac May 20, 2024
9831302
Remove mocks
insmac May 20, 2024
11cd8a5
Fix: loader state
insmac May 20, 2024
723eb07
change `errorCode` to `errorMessage`
insmac May 22, 2024
6021c78
Remove OS errorCodes utils
insmac May 22, 2024
ab7a501
Cypress: Add tests around Tables UI
insmac May 23, 2024
9dba4cd
Add set of test scenarios for suspended tables
insmac May 23, 2024
de37fc7
Adjust the default timeout for CI purposes
insmac May 23, 2024
8909c7a
Add error tag support
insmac May 31, 2024
41ea5a9
Refactor tests to use `SUSPEND WAL` instead of `wal_tables()` mocks
insmac Jun 3, 2024
3df1d5d
Merge branch 'main' into web-console/suspended-tables
insmac Jun 3, 2024
a2fc743
Adjust schema header actions UI
insmac Jun 7, 2024
fdffe04
Hide suspended count with no suspended tables
insmac Jun 13, 2024
fd79b75
Remove `Add` action on row hover/click
insmac Jun 13, 2024
70fd845
Merge branch 'main' into web-console/suspended-tables
glasstiger Jun 14, 2024
7afc4a1
Merge branch 'main' into web-console/suspended-tables
insmac Jun 18, 2024
46e1f56
refactor `ErrorTag`, add new columns
insmac Jun 18, 2024
58ea5e0
Add Warning UI
insmac Jun 18, 2024
0bb2959
Integrate the build SQL
insmac Jun 18, 2024
2546e50
Add Partition type
insmac Jun 19, 2024
34f9510
Add `Run` shortcut
insmac Jun 19, 2024
5813fc3
Merge remote-tracking branch 'origin/main' into web-console/suspended…
glasstiger Jun 20, 2024
394009a
Merge branch 'main' into web-console/suspended-tables
glasstiger Jun 25, 2024
03b8625
Merge remote-tracking branch 'origin/main' into web-console/suspended…
glasstiger Jul 1, 2024
4939c05
fix failing cypress test
glasstiger Jul 1, 2024
58ccc7a
update questdb submodule
glasstiger Jul 2, 2024
742484e
Revert "Integrate the build SQL"
glasstiger Jul 3, 2024
ace0230
Revert "Add Warning UI"
glasstiger Jul 3, 2024
edee711
Revert "refactor `ErrorTag`, add new columns"
glasstiger Jul 3, 2024
333cbf5
remove unnecessary import
glasstiger Jul 3, 2024
ae6051a
Restart transaction -> Resume WAL
glasstiger Jul 3, 2024
c700322
Merge remote-tracking branch 'origin/main' into web-console/suspended…
glasstiger Jul 3, 2024
6ebf680
fixing merge
glasstiger Jul 3, 2024
4abfcec
Fix issue with appending queries
insmac Jul 3, 2024
2dccea5
simplify import
glasstiger Jul 3, 2024
eea2435
simplify import
glasstiger Jul 3, 2024
510373b
Abtract out `Resume WAL` test
insmac Jul 3, 2024
5daf2d2
Merge branch 'web-console/suspended-tables' of https://github.com/que…
insmac Jul 3, 2024
58db194
renaming error tags
glasstiger Jul 3, 2024
7f8afd7
Update suspension indications, remove table details
insmac Jul 5, 2024
3d13832
Merge branch 'web-console/suspended-tables' of https://github.com/que…
insmac Jul 5, 2024
5bce85d
New table icons
insmac Jul 8, 2024
fd7d0b8
Table icon tooltip
insmac Jul 8, 2024
e0cfd58
Table row cleanup
insmac Jul 8, 2024
28b917a
Create `SuspensionDialog` instead of popover
insmac Jul 8, 2024
97fbc7f
Refactor `SuspensionDialog` UI
insmac Jul 8, 2024
8200fab
`SuspensionDialog` styling updates
insmac Jul 8, 2024
a8fc8f8
Update error messages, cleanup popover
insmac Jul 9, 2024
507f172
Update tests
insmac Jul 9, 2024
798a0e6
Add server message text
insmac Jul 9, 2024
a2c5af3
Change modal behaviour post restart
insmac Jul 9, 2024
9826918
update OSS project
glasstiger Jul 10, 2024
e8172db
Add Warning logic mock
insmac Jul 10, 2024
4e750c7
Make error tags generic
insmac Jul 10, 2024
1b07ccf
Integrate warnings with the API
insmac Jul 10, 2024
c9ac207
Add warning test sheet
insmac Jul 10, 2024
6a544cf
Update hooks for `schema.spec.js`
insmac Jul 10, 2024
0c69df5
questdb submodule update
glasstiger Jul 11, 2024
1c06b9a
questdb submodule update
glasstiger Jul 11, 2024
91c279f
enable warnings simulation in cypress questdb instance
glasstiger Jul 11, 2024
66a3930
enable warnings simulation in cypress questdb instance
glasstiger Jul 11, 2024
e6a4d4d
experiment
glasstiger Jul 11, 2024
db5c009
fix warning related test failure
glasstiger Jul 11, 2024
14877dd
Refactor warning tests from mock to SQL commands
insmac Jul 11, 2024
06c7b0a
Adjust the Tables UI styling
insmac Jul 11, 2024
c21f7a1
Restyle table icons
insmac Jul 15, 2024
5ac2308
questdb submodule update
glasstiger Jul 15, 2024
22557c1
questdb submodule update
glasstiger Jul 15, 2024
cb3e975
questdb submodule update
glasstiger Jul 15, 2024
bb18c85
Fix table UI on small pane width
insmac Jul 15, 2024
4aee69f
Merge branch 'web-console/suspended-tables' of https://github.com/que…
insmac Jul 15, 2024
90ba1b0
questdb submodule update
glasstiger Jul 15, 2024
174f52b
update oss check script
glasstiger Jul 15, 2024
d49cdb7
Add table icon tooltips
insmac Jul 16, 2024
614c70e
Merge branch 'web-console/suspended-tables' of https://github.com/que…
insmac Jul 16, 2024
da44a54
Adjust tooltip
insmac Jul 16, 2024
0318722
tiny code cleanup
glasstiger Jul 16, 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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:

- name: Start QuestDB
run: ./tmp/questdb-*-rt-linux-amd64/bin/questdb.sh start -d ./tmp/dbroot
env:
QDB_DEV_MODE_ENABLED: "true"

- uses: actions/setup-node@v4
with:
Expand Down
55 changes: 55 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions packages/browser-tests/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const {
} = require("@simonsmith/cypress-image-snapshot/plugin");

module.exports = defineConfig({
defaultCommandTimeout: 10000,
e2e: {
defaultCommandTimeout: 30000,
screenshotOnRunFailure: false,
Expand Down
44 changes: 40 additions & 4 deletions packages/browser-tests/cypress/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ const { ctrlOrCmd, escapeRegExp } = require("./utils");

const baseUrl = "http://localhost:9999";

const tableSchemas = {
btc_trades:
"CREATE TABLE IF NOT EXISTS 'btc_trades' (symbol SYMBOL capacity 256 CACHE, side SYMBOL capacity 256 CACHE, price DOUBLE, amount DOUBLE, timestamp TIMESTAMP) timestamp (timestamp) PARTITION BY DAY WAL DEDUP UPSERT KEYS(symbol, price, amount, timestamp);",
chicago_weather_stations:
"CREATE TABLE IF NOT EXISTS 'chicago_weather_stations' (MeasurementTimestamp TIMESTAMP, StationName SYMBOL capacity 256 CACHE, AirTemperature DOUBLE, WetBulbTemperature DOUBLE, Humidity INT, RainIntensity DOUBLE, IntervalRain DOUBLE, TotalRain DOUBLE, PrecipitationType INT, WindDirection INT, WindSpeed DOUBLE, MaximumWindSpeed DOUBLE, BarometricPressure DOUBLE, SolarRadiation INT, Heading INT, BatteryLife DOUBLE, MeasurementTimestampLabel STRING, MeasurementID STRING) timestamp (MeasurementTimestamp) PARTITION BY MONTH WAL DEDUP UPSERT KEYS(MeasurementTimestamp, StationName);",
ecommerce_stats:
"CREATE TABLE IF NOT EXISTS 'ecommerce_stats' (ts TIMESTAMP, country SYMBOL capacity 256 CACHE, category SYMBOL capacity 256 CACHE, visits LONG, unique_visitors LONG, sales DOUBLE, number_of_products INT) timestamp (ts) PARTITION BY DAY WAL DEDUP UPSERT KEYS(ts, country, category);",
gitlog:
"CREATE TABLE IF NOT EXISTS 'gitlog' (committed_datetime TIMESTAMP, repo SYMBOL capacity 256 CACHE, author_name SYMBOL capacity 256 CACHE, summary STRING, size INT, insertions INT, deletions INT, lines INT, files INT) timestamp (committed_datetime) PARTITION BY MONTH WAL DEDUP UPSERT KEYS(committed_datetime, repo, author_name);",
};

before(() => {
Cypress.on("uncaught:exception", (err) => {
// this error can be safely ignored
Expand Down Expand Up @@ -57,6 +68,7 @@ beforeEach(() => {
req.reply("{}");
}
).as("addTelemetry");

cy.intercept(
{
method: "GET",
Expand All @@ -67,8 +79,17 @@ beforeEach(() => {
req.reply("[]");
}
);

cy.request({
method: "GET",
url: `${baseUrl}/exec?query=${encodeURIComponent(`select simulate_warnings('', '');`)}`,
});
});

Cypress.Commands.add("getByDataHook", (name) =>
cy.get(`[data-hook="${name}"]`)
);

Cypress.Commands.add("getGrid", () =>
cy.get(".qg-viewport .qg-canvas").should("be.visible")
);
Expand All @@ -95,10 +116,11 @@ Cypress.Commands.add("runLine", () => {
cy.wait("@exec");
});

Cypress.Commands.add("clickRun", () => {
cy.intercept("/exec*").as("exec");
return cy.get("button").contains("Run").click().wait("@exec");
});
Cypress.Commands.add("clickRun",
() => {
cy.intercept("/exec*").as("exec");
return cy.get("button").contains("Run").click().wait("@exec");
});

Cypress.Commands.add("clearEditor", () =>
cy.typeQuery(`${ctrlOrCmd}a{backspace}`)
Expand Down Expand Up @@ -172,6 +194,20 @@ Cypress.Commands.add("getExpandedNotifications", () =>
cy.get('[data-hook="notifications-expanded"]')
);

Cypress.Commands.add("createTable", (name) => {
cy.request({
method: "GET",
url: `${baseUrl}/exec?query=${encodeURIComponent(tableSchemas[name])};`,
});
});

Cypress.Commands.add("dropTable", (name) => {
cy.request({
method: "GET",
url: `${baseUrl}/exec?query=${encodeURIComponent(`DROP TABLE ${name};`)}`,
});
});

Cypress.Commands.add("interceptQuery", (query, alias, response) => {
cy.intercept(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe("Auth - UI", () => {

it("should display UI auth", () => {
cy.wait("@settings");
cy.get('[data-hook="auth-login"]').should("be.visible");
cy.getByDataHook("auth-login").should("be.visible");
cy.getEditor().should("not.exist");
});
});
Expand All @@ -71,8 +71,8 @@ describe("Auth - OIDC", () => {

it("should display UI auth with OIDC support", () => {
cy.wait("@settings");
cy.get('[data-hook="auth-login"]').should("be.visible");
cy.get('[data-hook="button-sso-login"]').should("be.visible");
cy.getByDataHook("auth-login").should("be.visible");
cy.getByDataHook("button-sso-login").should("be.visible");
cy.getEditor().should("not.exist");
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ describe("questdb grid", () => {
cy.runLine();
cy.wait(100);

cy.getGridRows()
.should("have.length", 7)
.getGridRow(0)
.should("contain", "1");
cy.getGridRows().should("have.length", 7);
cy.getGridRow(0).should("contain", "1");

cy.getGridViewport().scrollTo("bottom");
cy.getGridRows().should("have.length", 7);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ describe("questdb import", () => {
});

it("display import panel", () => {
cy.get('[data-hook="import-panel-button"]').click();
cy.get('[data-hook="import-dropbox"]').should("be.visible");
cy.getByDataHook("import-panel-button").click();
cy.getByDataHook("import-dropbox").should("be.visible");
cy.matchImageSnapshot();
});
});
145 changes: 145 additions & 0 deletions packages/browser-tests/cypress/integration/console/schema.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
/// <reference types="cypress" />

const baseUrl = "http://localhost:9999";

const tables = [
"btc_trades",
"chicago_weather_stations",
"ecommerce_stats",
"gitlog",
];

describe("questdb schema with working tables", () => {
before(() => {
cy.visit(baseUrl);
tables.forEach((table) => {
cy.createTable(table);
});
});

it("should show all the tables when there are no suspended", () => {
tables.forEach((table) => {
cy.getByDataHook("schema-table-title").should("contain", table);
});
cy.getByDataHook("schema-filter-suspended-button").should("not.exist");
cy.getByDataHook("schema-suspension-popover-trigger").should("not.exist");
});

it("should filter the table with input field", () => {
// Table name search
cy.get('input[name="table_filter"]').type("btc_trades");
cy.getByDataHook("schema-search-clear-button").should("exist");
cy.getByDataHook("schema-table-title").should("contain", "btc_trades");
cy.getByDataHook("schema-table-title").should("not.contain", "ź");
cy.getByDataHook("schema-table-title").should(
"not.contain",
"ecommerce_stats"
);
cy.getByDataHook("schema-table-title").should("not.contain", "gitlog");
cy.getByDataHook("schema-search-clear-button").click();
cy.getByDataHook("schema-table-title").should(
"have.length.least",
tables.length
);

// Column name search
cy.get('input[name="table_filter"]').type("timestamp");
cy.getByDataHook("schema-table-title").should("contain", "btc_trades");
cy.getByDataHook("schema-table-title").should(
"not.contain",
"chicago_weather_stations"
);
cy.getByDataHook("schema-search-clear-button").click();
cy.getByDataHook("schema-table-title").should(
"contain",
"chicago_weather_stations"
);
});

after(() => {
tables.forEach((table) => {
cy.dropTable(table);
});
});
});

describe("questdb schema with suspended tables with Linux OS error codes", () => {
before(() => {
cy.visit(baseUrl);
cy.getEditorContent().should("be.visible");
cy.clearEditor();
tables.forEach((table) => {
cy.createTable(table);
});
cy.typeQuery(
"ALTER TABLE btc_trades SUSPEND WAL WITH 24, 'Too many open files';"
)
.clickRun()
.clearEditor();

cy.typeQuery(
"ALTER TABLE ecommerce_stats SUSPEND WAL WITH 12, 'Out of memory';"
)
.clickRun()
.clearEditor();
});
beforeEach(() => {
cy.visit(baseUrl);
cy.getEditorContent().should("be.visible");
cy.clearEditor();
});

it("should work with 2 suspended tables, btc_trades and ecommerce_stats", () => {
cy.getByDataHook("schema-filter-suspended-button").should(
"not.be.disabled"
);
cy.getByDataHook("schema-filter-suspended-button").should("contain", "2");
});

it("should filter out non-suspended tables on click", () => {
cy.getByDataHook("schema-filter-suspended-button").click();
cy.getByDataHook("schema-table-title").should("have.length", 2);
cy.getByDataHook("schema-table-title").should("contain", "btc_trades");
cy.getByDataHook("schema-table-title").should("contain", "ecommerce_stats");
cy.getByDataHook("schema-table-title").should("not.contain", "gitlog");
cy.getByDataHook("schema-table-title").should(
"not.contain",
"chicago_weather_stations"
);
cy.getByDataHook("schema-filter-suspended-button").click();
});

it("should show the suspension dialog on click with details for btc_trades", () => {
cy.get('input[name="table_filter"]').click().type("btc_trades");
cy.getByDataHook("schema-suspension-dialog-trigger").click();
cy.getByDataHook("schema-suspension-dialog").should(
"have.attr",
"data-table-name",
"btc_trades"
);
cy.getByDataHook("schema-suspension-dialog-error-message").should(
"contain",
"Too many open files, please, increase the maximum number of open file handlers OS limit"
);
cy.getByDataHook("schema-suspension-dialog-error-link").should(
"have.attr",
"href",
"https://questdb.io/docs/deployment/capacity-planning/#maximum-open-files"
);
});

it("should resume WAL for btc_trades from the suspension popover", () => {
cy.get('input[name="table_filter"]').click().type("btc_trades");
cy.contains("Suspended").click();
cy.getByDataHook("schema-suspension-dialog-restart-transaction").click();
cy.getByDataHook("schema-suspension-dialog-dismiss").click();
cy.getByDataHook("schema-suspension-dialog").should("not.exist");
cy.getByDataHook("schema-suspension-dialog-trigger").should("not.exist");
});

after(() => {
tables.forEach((table) => {
cy.dropTable(table);
});
});
});
Loading