Skip to content
Open
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
494 changes: 391 additions & 103 deletions web-common/tests/fixtures/rill-dev-fixtures.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,18 @@ export async function waitForReconciliation(page: Page, timeoutMs = 60_000) {

return dataResources;
}

/**
* Navigates to a URL that depends on freshly created or edited resources, then
* waits for the project to finish reconciling before returning. Use this in
* place of a bare `page.goto(...)` whenever the destination needs resources to
* be ready (the recurring cause of navigate-before-reconcile flakiness).
*/
export async function gotoWhenReady(
page: Page,
url: string,
timeoutMs = 60_000,
) {
await page.goto(url);
await waitForReconciliation(page, timeoutMs);
}
5 changes: 5 additions & 0 deletions web-local/tests/connectors/clickhouse-connector.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ test.describe("ClickHouse connector", () => {
});

test.describe("Welcome screen", () => {
// The welcome flow needs an uninitialized project, so use a pristine
// instance rather than the shared per-worker runtime (which keeps a
// rill.yaml present). The Home page block below stays on the shared runtime.
test.use({ freshInstance: true });

test("Create connector using individual fields", async ({ page }) => {
// Open the connect to clickhouse modal
await page.getByLabel("Connect to clickhouse").click();
Expand Down
6 changes: 4 additions & 2 deletions web-local/tests/connectors/motherduck-connector.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { test } from "../setup/base";
import { updateCodeEditor } from "../utils/commonHelpers";

test.describe("MotherDuck welcome flow", () => {
// Start from an empty workspace to exercise the onboarding path
test.use({ project: undefined });
// Start from an empty workspace to exercise the onboarding path. The welcome
// flow needs an uninitialized project, so use a pristine instance rather than
// the shared per-worker runtime (which keeps a rill.yaml present).
test.use({ project: undefined, freshInstance: true });

test("initializes MotherDuck from welcome screen and persists secrets before connector", async ({
page,
Expand Down
5 changes: 5 additions & 0 deletions web-local/tests/connectors/postgres-connector.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ test.describe.skip("Postgres connector", () => {
});

test.describe("Welcome screen", () => {
// The welcome flow needs an uninitialized project, so use a pristine
// instance rather than the shared per-worker runtime. The Home page block
// below stays on the shared runtime.
test.use({ freshInstance: true });

test("Create connector using individual fields", async ({ page }) => {
await page.getByLabel("See more connectors").click();
await enterPostgresCredentials(page, postgresOne);
Expand Down
2 changes: 1 addition & 1 deletion web-local/tests/explores/annotations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { V1TimeGrain } from "@rilldata/web-common/runtime-client/gen/index.schem
import { interactWithTimeRangeMenu } from "@rilldata/web-common/tests/utils/explore-interactions";
import { DateTime } from "luxon";
import { test } from "../setup/base";
import { waitForReconciliation } from "../utils/wait-for-reconciliation";
import { waitForReconciliation } from "@rilldata/web-common/tests/utils/wait-for-reconciliation";

// Annotation timestamps as they'll be serialized from DuckDB (UTC).
// All annotations that may be visible at day grain in "Last 7 days":
Expand Down
2 changes: 1 addition & 1 deletion web-local/tests/explores/open-query.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test } from "../setup/base";
import { waitForReconciliation } from "../utils/wait-for-reconciliation.ts";
import { waitForReconciliation } from "@rilldata/web-common/tests/utils/wait-for-reconciliation";

test.describe("Query-to-Explore routing", () => {
test.use({ project: "AdBids" });
Expand Down
2 changes: 1 addition & 1 deletion web-local/tests/explores/time-grain-derivation.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, type Page } from "@playwright/test";
import { test } from "../setup/base";
import { waitForReconciliation } from "../utils/wait-for-reconciliation.ts";
import { waitForReconciliation } from "@rilldata/web-common/tests/utils/wait-for-reconciliation";

test.describe("Time grain derivation from URL", () => {
test.use({ project: "AdBids" });
Expand Down
2 changes: 1 addition & 1 deletion web-local/tests/explores/visual-explore-editing.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from "@playwright/test";
import { test } from "../setup/base";
import { waitForReconciliation } from "../utils/wait-for-reconciliation";
import { waitForReconciliation } from "@rilldata/web-common/tests/utils/wait-for-reconciliation";
import { gotoNavEntry } from "../utils/waitHelpers";

test.describe("visual explore editing", () => {
Expand Down
7 changes: 6 additions & 1 deletion web-local/tests/init.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import { EXAMPLES } from "@rilldata/web-common/features/welcome/constants";
import { expect } from "playwright/test";
import { test } from "./setup/base";
import { splitFolderAndFileName } from "@rilldata/web-common/features/entity-management/file-path-utils.ts";
import { waitForReconciliation } from "./utils/wait-for-reconciliation";
import { waitForReconciliation } from "@rilldata/web-common/tests/utils/wait-for-reconciliation";

// These tests drive the welcome / project-initialization flow, which only
// appears for an uninitialized project. The shared per-worker runtime always
// keeps a rill.yaml present, so these need their own pristine instance.
test.use({ freshInstance: true });

test.describe("Example project initialization", () => {
EXAMPLES.forEach((example) => {
Expand Down
4 changes: 4 additions & 0 deletions web-local/tests/rill-yaml.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ async function expectRillYAMLToContainOlapConnector(page: Page, text: string) {
}

test.describe("Default olap_connector behavior", () => {
// Exercises the empty/uninitialized project flow, which needs a pristine
// instance rather than the shared per-worker runtime (which keeps a rill.yaml).
test.use({ freshInstance: true });

test("Should set default olap_connector to duckdb for empty project", async ({
page,
}) => {
Expand Down
84 changes: 0 additions & 84 deletions web-local/tests/utils/startRuntimeForEachTest.ts

This file was deleted.

Loading