Skip to content

Commit

Permalink
Move e2e tests to packages folder
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-dp committed Jul 1, 2024
1 parent e0071be commit 5bdffe7
Show file tree
Hide file tree
Showing 107 changed files with 99 additions and 99 deletions.
6 changes: 3 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This `.dockerignore` file is used when building docker images from the repository root.
# In particular, we're building the `e2e/satellite_client` that way, because it relies on
# In particular, we're building the `packages/e2e/satellite_client` that way, because it relies on
# other packages within the monorepo. Without this, the context sent to docker build engine
# is over 5Gb due to all the dependencies we don't need anyway.

Expand All @@ -15,5 +15,5 @@
**/.npm
**/.cache

e2e/lux
e2e/lux_logs
packages/e2e/lux
packages/e2e/lux_logs
26 changes: 13 additions & 13 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
# Root files
- "*"
- "!pnpm-lock.yaml"
- "!clients/typescript/**" # Satellite tests run in a separate workflow
- "!packages/client/**" # Satellite tests run in a separate workflow
# CI files not related to GH actions
- ".buildkite/**"
- "**/README.md"
Expand All @@ -31,7 +31,7 @@ jobs:
write_to_pg_mode: [logical_replication, direct_writes]
defaults:
run:
working-directory: e2e
working-directory: packages/e2e
env:
BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_TEST_ANALYTICS_E2E }}
ELECTRIC_WRITE_TO_PG_MODE: ${{ matrix.write_to_pg_mode }}
Expand Down Expand Up @@ -75,9 +75,9 @@ jobs:
uses: actions/cache@v4
with:
path: |
e2e/lux/bin
e2e/lux/ebin
e2e/lux/priv
packages/e2e/lux/bin
packages/e2e/lux/ebin
packages/e2e/lux/priv
key: ${{ runner.os }}-luxbuilt-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}

- run: make lux
Expand All @@ -94,10 +94,10 @@ jobs:
if: ${{ failure() && steps.tests.outcome == 'failure' }}
with:
name: lux_logs
path: e2e/**/lux_logs/run_*
path: packages/e2e/**/lux_logs/run_*
- name: Upload test results to Buildkite analytics
if: ${{ !cancelled() && steps.tests.outcome != 'skipped' && env.BUILDKITE_ANALYTICS_TOKEN != '' }}
working-directory: e2e/lux_logs/latest_run
working-directory: packages/e2e/lux_logs/latest_run
run: |
curl \
-X POST \
Expand All @@ -122,7 +122,7 @@ jobs:
name: E2E Satellite tests (Dialect ${{ matrix.dialect }} - uses DAL? ${{ matrix.dal }})
defaults:
run:
working-directory: e2e
working-directory: packages/e2e
env:
BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_TEST_ANALYTICS_E2E }}
DIALECT: ${{ matrix.dialect }}
Expand Down Expand Up @@ -166,9 +166,9 @@ jobs:
uses: actions/cache@v4
with:
path: |
e2e/lux/bin
e2e/lux/ebin
e2e/lux/priv
packages/e2e/lux/bin
packages/e2e/lux/ebin
packages/e2e/lux/priv
key: ${{ runner.os }}-luxbuilt-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}

- run: make lux
Expand All @@ -185,10 +185,10 @@ jobs:
if: ${{ failure() && steps.tests.outcome == 'failure' }}
with:
name: lux_logs
path: e2e/**/lux_logs/run_*
path: packages/e2e/**/lux_logs/run_*
- name: Upload test results to Buildkite analytics
if: ${{ !cancelled() && steps.tests.outcome != 'skipped' && env.BUILDKITE_ANALYTICS_TOKEN != '' }}
working-directory: e2e/lux_logs/latest_run
working-directory: packages/e2e/lux_logs/latest_run
run: |
curl \
-X POST \
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ build_all:
test_all:
make -C packages/electric deps tests
make -C packages/client deps tests
make -C generator deps tests
make -C e2e test
make -C packages/generator deps tests
make -C packages/e2e test

update_protobuf:
make -C packages/electric update_protobuf
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ This is the main repository for the ElectricSQL source code. Key components incl

- [packages/client](https://github.com/electric-sql/electric/tree/main/packages/client) — TypeScript client that provides SQLite driver adapters, reactivity and a type-safe data access library
- [packages/electric](https://github.com/electric-sql/electric/tree/main/packages/electric) — Elixir sync service that manages active-active replication between Postgres and SQLite
- [generator](https://github.com/electric-sql/electric/tree/main/generator) — Prisma generator that creates the type safe data access library
- [packages/generator](https://github.com/electric-sql/electric/tree/main/packages/generator) — Prisma generator that creates the type safe data access library
- [protocol/satellite.proto](https://github.com/electric-sql/electric/tree/main/protocol/satellite.proto) — Protocol Buffers definition of the Satellite replication protocol

See the Makefiles for test and build instructions and the [e2e](https://github.com/electric-sql/electric/tree/main/e2e) folder for integration tests.
See the Makefiles for test and build instructions and the [e2e](https://github.com/electric-sql/electric/tree/main/packages/e2e) folder for integration tests.

## Team

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../common.mk

build:
docker buildx build --load ${CACHING_SETTINGS} -f ./Dockerfile -t prisma_example:local ${PROJECT_ROOT}/e2e/prisma_example
docker buildx build --load ${CACHING_SETTINGS} -f ./Dockerfile -t prisma_example:local ${PROJECT_ROOT}/packages/e2e/prisma_example
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ COPY packages/client ./packages/client
COPY common ./common
COPY packages/generator ./packages/generator
COPY packages/drivers ./packages/drivers
COPY e2e/satellite_client/package.json ./e2e/satellite_client/
COPY packages/e2e/satellite_client/package.json ./packages/e2e/satellite_client/
RUN pnpm install -r --offline --filter @internal/satellite-client^...
RUN pnpm run -r --filter @internal/satellite-client^... build
RUN pnpm install --offline --filter @internal/satellite-client

# E2E Client build
COPY e2e/satellite_client/src ./e2e/satellite_client/src
COPY e2e/satellite_client/tsconfig.json ./e2e/satellite_client
COPY packages/e2e/satellite_client/src ./packages/e2e/satellite_client/src
COPY packages/e2e/satellite_client/tsconfig.json ./packages/e2e/satellite_client
RUN pnpm run --filter @internal/satellite-client build

# Deploy an isolated node_modules + src in which the E2E Client will be run
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ defmodule Electric.Replication.Postgres.LogicalReplicationProducer do
# connection is opened. In particular, trying to call `Client.get_server_versions()` before
# creating the main slot results in the replication stream not delivering transactions from
# Postgres when Electric is running in the direct_writes mode, which manifests as a
# failure of e2e/tests/02.02_migrations_get_streamed_to_satellite.lux.
# failure of packages/e2e/tests/02.02_migrations_get_streamed_to_satellite.lux.
{:ok, _slot_name} <- Client.create_main_slot(repl_conn, main_slot),
{:ok, _slot_name, main_slot_lsn} <-
Client.create_temporary_slot(repl_conn, main_slot, tmp_slot),
Expand Down
146 changes: 73 additions & 73 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
packages:
- 'e2e/satellite_client'
- 'examples/starter'
- 'generator'
- 'packages/*'
- 'packages/e2e/satellite_client'

0 comments on commit 5bdffe7

Please sign in to comment.