Skip to content

Commit

Permalink
chore(electric): Update E2E tests to use the proxy_1 shell for migrat…
Browse files Browse the repository at this point in the history
…ions (#570)
  • Loading branch information
alco authored Oct 30, 2023
1 parent d6b2ec9 commit 54136a7
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion e2e/tests/02.01_postgres_data_streams_to_satellite.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[include _shared.luxinc]

[invoke setup]
[invoke electrify_table entries ]
[invoke electrify_table entries]

[global user_id_1=1]
[newshell user_1_ws1]
Expand Down
1 change: 0 additions & 1 deletion e2e/tests/02.02_migrations_get_streamed_to_satellite.lux
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
BEGIN;
CALL electric.migration_version('$migration_version');
CREATE TABLE mtable1 (id uuid PRIMARY KEY);
-- CALL electric.electrify('mtable1');
ALTER TABLE mtable1 ENABLE ELECTRIC;
COMMIT;
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
id UUID PRIMARY KEY,
content VARCHAR NOT NULL
);
-- CALL electric.electrify('public.items');
ALTER TABLE public.items ENABLE ELECTRIC;

INSERT INTO items(id, content) VALUES ('00000000-0000-0000-0000-000000000011', 'first item');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
[global migration2_vsn=20230719_02]

# Create two migrations with electrified tables on the server.
[shell pg_1]
[invoke migrate_pg $migration1_vsn "CREATE TABLE public.foo (id TEXT PRIMARY KEY);CALL electric.electrify('public.foo');"]
[invoke migrate_pg $migration2_vsn "CREATE TABLE public.bar (id TEXT PRIMARY KEY);CALL electric.electrify('public.bar');"]
[shell proxy_1]
[invoke migrate_pg $migration1_vsn "CREATE TABLE public.foo (id TEXT PRIMARY KEY);ALTER TABLE public.foo ENABLE ELECTRIC;"]
[invoke migrate_pg $migration2_vsn "CREATE TABLE public.bar (id TEXT PRIMARY KEY);ALTER TABLE public.bar ENABLE ELECTRIC;"]

# Bundle the first migration on the client.
[global client_migrations=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
[global migration2_vsn=20230719_02]

# Create two migrations with electrified tables on the server.
[shell pg_1]
[invoke migrate_pg $migration1_vsn "CREATE TABLE public.foo (id TEXT PRIMARY KEY);CALL electric.electrify('public.foo');"]
[invoke migrate_pg $migration2_vsn "CREATE TABLE public.bar (id TEXT PRIMARY KEY);CALL electric.electrify('public.bar');"]
[shell proxy_1]
[invoke migrate_pg $migration1_vsn "CREATE TABLE public.foo (id TEXT PRIMARY KEY);ALTER TABLE public.foo ENABLE ELECTRIC;"]
[invoke migrate_pg $migration2_vsn "CREATE TABLE public.bar (id TEXT PRIMARY KEY);ALTER TABLE public.bar ENABLE ELECTRIC;"]

[invoke setup_client 1 "electric_1" 5133]

Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/03.13_node_satellite_can_sync_timestamps.lux
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

[invoke setup]

[shell pg_1]
[shell proxy_1]
[local sql=
"""
CREATE TABLE public.timestamps (
id TEXT PRIMARY KEY,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMPTZ NOT NULL
);
CALL electric.electrify('public.timestamps');
ALTER TABLE public.timestamps ENABLE ELECTRIC;
"""]
[invoke migrate_pg 20230823 $sql]

Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/03.14_node_satellite_can_sync_dates_and_times.lux
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

[invoke setup]

[shell pg_1]
[shell proxy_1]
[local sql=
"""
CREATE TABLE public.datetimes (
id TEXT PRIMARY KEY,
d DATE,
t TIME
);
CALL electric.electrify('public.datetimes');
ALTER TABLE public.datetimes ENABLE ELECTRIC;
"""]
[invoke migrate_pg 20230913 $sql]

Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/03.15_node_satellite_can_sync_booleans.lux
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

[invoke setup]

[shell pg_1]
[shell proxy_1]
[local sql=
"""
CREATE TABLE public.bools (
id TEXT PRIMARY KEY,
b BOOLEAN
);
CALL electric.electrify('public.bools');
ALTER TABLE public.bools ENABLE ELECTRIC;
"""]
[invoke migrate_pg 20230908 $sql]

Expand Down
2 changes: 0 additions & 2 deletions e2e/tests/04.01_electric_api_returns_migrations.lux
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
BEGIN;
CALL electric.migration_version('$migration_version_1');
CREATE TABLE mtable1 (id uuid PRIMARY KEY);
-- CALL electric.electrify('mtable1');
ALTER TABLE mtable1 ENABLE ELECTRIC;
COMMIT;
"""
Expand All @@ -23,7 +22,6 @@
BEGIN;
CALL electric.migration_version('$migration_version_2');
CREATE TABLE mtable2 (id uuid PRIMARY KEY);
-- CALL electric.electrify('mtable2');
ALTER TABLE mtable2 ENABLE ELECTRIC;
COMMIT;
"""
Expand Down
6 changes: 3 additions & 3 deletions e2e/tests/05.05_compensations_within_same_tx_are_fine.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[invoke setup]

[shell pg_1]
[shell proxy_1]
[local sql=
"""
CREATE TABLE public.items (
Expand All @@ -15,8 +15,8 @@
content TEXT NOT NULL,
item_id TEXT REFERENCES public.items(id)
);
CALL electric.electrify('public.items');
CALL electric.electrify('public.other_items');
ALTER TABLE public.items ENABLE ELECTRIC;
ALTER TABLE public.other_items ENABLE ELECTRIC;
"""]
[invoke migrate_pg 11111 $sql]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

[invoke setup]

[shell pg_1]
[shell proxy_1]
[local sql=
"""
CREATE TABLE public."camelCase" (
id TEXT PRIMARY KEY,
"userId" TEXT
);
CALL electric.electrify('public."camelCase"');
--ALTER TABLE public."camelCase" ENABLE ELECTRIC;
"""]
[invoke migrate_pg 20230921 $sql]

Expand Down
1 change: 0 additions & 1 deletion e2e/tests/_shared.luxinc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
intvalue_null integer,
intvalue_null_default integer
);
-- CALL electric.electrify('public.items');
ALTER TABLE public.items ENABLE ELECTRIC;
"""]
[invoke migrate_pg $version $sql]
Expand Down

0 comments on commit 54136a7

Please sign in to comment.