diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f78b90e..9f58bd03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,13 +19,15 @@ jobs: deps: name: Get all the necessary dependencies runs-on: ubuntu-latest + defaults: + run: + working-directory: components/electric steps: - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} # Tags are required for proper version inference, and this is the only way to pull the tags in fetch-depth: 0 - - run: ls -lah - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 - uses: erlef/setup-beam@v1 @@ -40,17 +42,17 @@ jobs: id: cache-deps uses: actions/cache@v3 with: - path: deps - key: ${{ runner.os }}-mixdeps-${{ hashFiles('**/mix.lock') }} + path: components/electric/deps + key: ${{ runner.os }}-mixdeps-${{ hashFiles('components/electric/**/mix.lock') }} - name: Cache compiled code id: cache-build uses: actions/cache@v3 with: path: | - _build/*/lib - !_build/*/lib/electric - key: ${{ runner.os }}-mixbuild-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('**/mix.lock') }} + components/electric/_build/*/lib + !components/electric/_build/*/lib/electric + key: ${{ runner.os }}-mixbuild-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('components/electric/**/mix.lock') }} - run: make deps pretest_compile @@ -58,6 +60,9 @@ jobs: name: elixir tests runs-on: ubuntu-latest needs: deps + defaults: + run: + working-directory: components/electric steps: - uses: actions/checkout@v3 with: @@ -78,17 +83,17 @@ jobs: id: cache-deps uses: actions/cache/restore@v3 with: - path: deps - key: ${{ runner.os }}-mixdeps-${{ hashFiles('**/mix.lock') }} + path: components/electric/deps + key: ${{ runner.os }}-mixdeps-${{ hashFiles('components/electric/**/mix.lock') }} - name: Restore compiled code id: cache-build uses: actions/cache/restore@v3 with: path: | - _build/*/lib - !_build/*/lib/electric - key: ${{ runner.os }}-mixbuild-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('**/mix.lock') }} + components/electric/_build/*/lib + !components/electric/_build/*/lib/electric + key: ${{ runner.os }}-mixbuild-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('components/electric/**/mix.lock') }} - uses: webfactory/ssh-agent@v0.5.4 with: @@ -105,15 +110,19 @@ jobs: - name: Report code coverage uses: zgosalvez/github-actions-report-lcov@v3 with: - coverage-files: cover/lcov.info + coverage-files: components/electric/cover/lcov.info artifact-name: code-coverage-report github-token: ${{ secrets.GITHUB_TOKEN }} update-comment: true + working-directory: components/electric dialyzer: name: dialyzer and formatting runs-on: ubuntu-latest needs: deps + defaults: + run: + working-directory: components/electric steps: - uses: actions/checkout@v3 with: @@ -131,22 +140,22 @@ jobs: id: cache-deps uses: actions/cache/restore@v3 with: - path: deps - key: ${{ runner.os }}-mixdeps-${{ hashFiles('**/mix.lock') }} + path: components/electric/deps + key: ${{ runner.os }}-mixdeps-${{ hashFiles('components/electric/**/mix.lock') }} - name: Restore compiled code id: cache-build uses: actions/cache/restore@v3 with: path: | - _build/*/lib - !_build/*/lib/electric - key: ${{ runner.os }}-mixbuild-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('**/mix.lock') }} + components/electric/_build/*/lib + !components/electric/_build/*/lib/electric + key: ${{ runner.os }}-mixbuild-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('components/electric/**/mix.lock') }} - name: Cache PLT uses: actions/cache@v3 with: - path: _build/*/*.plt + path: components/electric/_build/*/*.plt key: ${{ runner.os }}-plt-${{ github.ref_name }} restore-keys: ${{ runner.os }}-plt- @@ -163,6 +172,9 @@ jobs: name: E2E tests runs-on: ubuntu-latest needs: deps + defaults: + run: + working-directory: e2e env: VAXINE_IMAGE: europe-docker.pkg.dev/vaxine/vaxine-io/vaxine:latest steps: @@ -188,45 +200,45 @@ jobs: id: cache-deps uses: actions/cache/restore@v3 with: - path: deps - key: ${{ runner.os }}-mixdeps-${{ hashFiles('**/mix.lock') }} + path: components/electric/deps + key: ${{ runner.os }}-mixdeps-${{ hashFiles('components/electric/**/mix.lock') }} - name: Restore compiled code id: cache-build uses: actions/cache/restore@v3 with: path: | - _build/*/lib - !_build/*/lib/electric - key: ${{ runner.os }}-mixbuild-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('**/mix.lock') }} + components/electric/_build/*/lib + !components/electric/_build/*/lib/electric + key: ${{ runner.os }}-mixbuild-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('components/electric/**/mix.lock') }} + - run: | echo "ELECTRIC_VERSION=$(make --silent print_version_from_git)" >> $GITHUB_ENV + working-directory: components/electric - run: make docker-build-ci env: ELECTRIC_IMAGE_NAME: ghcr.io/${{ github.repository }}/electric + working-directory: components/electric - run: make pretest_compile + working-directory: components/electric - name: Cache built lux uses: actions/cache@v3 with: path: | - integration_tests/lux/bin - integration_tests/lux/ebin - integration_tests/lux/priv + e2e/lux/bin + e2e/lux/ebin + e2e/lux/priv key: ${{ runner.os }}-luxbuilt-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }} - run: make lux - working-directory: integration_tests - run: make vaxine - working-directory: integration_tests - run: make postgres - working-directory: integration_tests - run: make test id: tests - working-directory: integration_tests env: ELECTRIC_IMAGE_NAME: ghcr.io/${{ github.repository }}/electric ELECTRIC_IMAGE_TAG: ${{ env.ELECTRIC_VERSION }} @@ -236,4 +248,4 @@ jobs: if: ${{ always() }} with: name: lux_logs - path: integration_tests/lux_logs/run_* + path: e2e/lux_logs/run_* diff --git a/Makefile b/Makefile index 7d97c6fa..b1655fd2 100644 --- a/Makefile +++ b/Makefile @@ -1,106 +1,6 @@ +build_all: + make -C components/electric docker-build -.PHONY: build_tools deps compile tests start_dev_env stop_dev_env integration_tests rm_offset_storage print_version_from_git - -INFERRED_VERSION = $(shell git describe --abbrev=7 --tags --always --first-parent) - -print_version_from_git: - echo "${INFERRED_VERSION}" - -build_tools: - mix local.hex --force - mix local.rebar --force - -deps: - mix deps.get - -dialyzer: - mix dialyzer - -compile: - mix compile - -compile-%: - MIX_ENV="$*" mix compile - -release: - MIX_ENV="prod" mix release - -pretest_compile: deps - MIX_ENV="test" mix compile --force --warnings-as-error - -tests: - mix test --trace - -format: - mix format - -check-format: - mix format --check-formatted - -DC_CONFIG=compose.yaml - -start_dev_env: - docker compose -f ${DC_CONFIG} up -d - -export UID=$(shell id -u) -export GID=$(shell id -g) -start_dev_env_mounted: - mkdir -p _tmp_vaxine_data - docker compose -f compose-mounts.yaml up -d - -stop_dev_env: - docker compose -f ${DC_CONFIG} down - rm -rf _tmp_vaxine_data - -DOCKER_PREFIX:=$(shell basename $(CURDIR)) -docker-pgsql-%: - docker exec -it -e PGPASSWORD=password ${DOCKER_PREFIX}_$*_1 psql -h $* -U electric -d electric - -ELECTRIC_VERSION ?= ${INFERRED_VERSION} -docker-build: - docker build --build-arg ELECTRIC_VERSION=${ELECTRIC_VERSION} -t electric:local-build . - -docker-build-ci: - mkdir -p deps - docker build --build-arg ELECTRIC_VERSION=${ELECTRIC_VERSION} \ - -t ${ELECTRIC_IMAGE_NAME}:${ELECTRIC_VERSION} \ - -t electric:local-build . - docker push ${ELECTRIC_IMAGE_NAME}:${ELECTRIC_VERSION} -ifeq (${TAG_AS_LATEST}, true) - docker tag "${ELECTRIC_IMAGE_NAME}:${ELECTRIC_VERSION}" "${ELECTRIC_IMAGE_NAME}:latest" - docker push "${ELECTRIC_IMAGE_NAME}:latest" -endif - -docker-build-ci-crossplatform: - mkdir -p deps - docker buildx build --platform linux/arm64/v8,linux/amd64 --push \ - --build-arg ELECTRIC_VERSION=${ELECTRIC_VERSION} \ - -t ${ELECTRIC_IMAGE_NAME}:${ELECTRIC_VERSION} \ - -t ${ELECTRIC_IMAGE_NAME}:latest . - -docker-clean: -ifneq ($(docker images -q electric:local-build 2> /dev/null), "") - docker image rm -f electric:local-build -endif - -rm_offset_storage: - rm offset_storage_* - -update_protobuf: deps - mix electric.gen.proto.package \ - --output-path=./lib/electric/satellite/protobuf_package.ex \ - ./deps/satellite_proto/proto/satellite.proto - mix protox.generate \ - --output-path=./lib/electric/satellite/protobuf_messages.ex \ - ./deps/satellite_proto/proto/satellite.proto -shell: - iex -S mix - -shell_clean: - iex -S mix run --no-start - -apply_migration: - ./apply-local-migration.sh $(name) - -codespell: - codespell -L authentification --skip .git --skip deps +test_all: + make -C components/electric deps tests + make -C e2e test \ No newline at end of file diff --git a/.dockerignore b/components/electric/.dockerignore similarity index 100% rename from .dockerignore rename to components/electric/.dockerignore diff --git a/.formatter.exs b/components/electric/.formatter.exs similarity index 100% rename from .formatter.exs rename to components/electric/.formatter.exs diff --git a/components/electric/.gitignore b/components/electric/.gitignore new file mode 100644 index 00000000..0d279f8a --- /dev/null +++ b/components/electric/.gitignore @@ -0,0 +1,31 @@ +# The directory Mix will write compiled artifacts to. +/_build/ + +# If you run "mix test --cover", coverage assets end up here. +/cover/ + +# The directory Mix downloads your dependencies sources to. +/deps/ + +# Where third-party dependencies like ExDoc output generated docs. +/doc/ + +# Ignore .fetch files in case you like to edit your project deps locally. +/.fetch + +# If the VM crashes, it generates a dump, let's ignore it too. +erl_crash.dump + +# Also ignore archive artifacts (built via "mix archive.build"). +*.ez + +# Ignore package tarball (built via "mix hex.build"). +electric-*.tar + +# Temporary files, for example, from tests. +/tmp/ + +*offset_storage*.dat + +/archives +.node_repl_history \ No newline at end of file diff --git a/Dockerfile b/components/electric/Dockerfile similarity index 100% rename from Dockerfile rename to components/electric/Dockerfile diff --git a/components/electric/Makefile b/components/electric/Makefile new file mode 100644 index 00000000..f8eb3ae0 --- /dev/null +++ b/components/electric/Makefile @@ -0,0 +1,106 @@ + +.PHONY: build_tools deps compile tests start_dev_env stop_dev_env integration_tests rm_offset_storage print_version_from_git + +INFERRED_VERSION = $(shell git describe --abbrev=7 --tags --always --first-parent) + +print_version_from_git: + echo "${INFERRED_VERSION}" + +build_tools: + mix local.hex --force + mix local.rebar --force + +deps: + mix deps.get + +dialyzer: + mix dialyzer + +compile: + mix compile + +compile-%: + MIX_ENV="$*" mix compile + +release: + MIX_ENV="prod" mix release + +pretest_compile: deps + MIX_ENV="test" mix compile --force --warnings-as-error + +tests: + mix test --trace + +format: + mix format + +check-format: + mix format --check-formatted + +DC_CONFIG=dev/compose.yaml + +start_dev_env: + docker compose -f ${DC_CONFIG} up -d + +export UID=$(shell id -u) +export GID=$(shell id -g) +start_dev_env_mounted: + mkdir -p _tmp_vaxine_data + docker compose -f dev/compose-mounts.yaml up -d + +stop_dev_env: + docker compose -f ${DC_CONFIG} down + rm -rf _tmp_vaxine_data + +DOCKER_PREFIX:=$(shell basename $(CURDIR)) +docker-pgsql-%: + docker exec -it -e PGPASSWORD=password ${DOCKER_PREFIX}_$*_1 psql -h $* -U electric -d electric + +ELECTRIC_VERSION ?= ${INFERRED_VERSION} +docker-build: + docker build --build-arg ELECTRIC_VERSION=${ELECTRIC_VERSION} -t electric:local-build . + +docker-build-ci: + mkdir -p deps + docker build --build-arg ELECTRIC_VERSION=${ELECTRIC_VERSION} \ + -t ${ELECTRIC_IMAGE_NAME}:${ELECTRIC_VERSION} \ + -t electric:local-build . + docker push ${ELECTRIC_IMAGE_NAME}:${ELECTRIC_VERSION} +ifeq (${TAG_AS_LATEST}, true) + docker tag "${ELECTRIC_IMAGE_NAME}:${ELECTRIC_VERSION}" "${ELECTRIC_IMAGE_NAME}:latest" + docker push "${ELECTRIC_IMAGE_NAME}:latest" +endif + +docker-build-ci-crossplatform: + mkdir -p deps + docker buildx build --platform linux/arm64/v8,linux/amd64 --push \ + --build-arg ELECTRIC_VERSION=${ELECTRIC_VERSION} \ + -t ${ELECTRIC_IMAGE_NAME}:${ELECTRIC_VERSION} \ + -t ${ELECTRIC_IMAGE_NAME}:latest . + +docker-clean: +ifneq ($(docker images -q electric:local-build 2> /dev/null), "") + docker image rm -f electric:local-build +endif + +rm_offset_storage: + rm offset_storage_* + +update_protobuf: deps + mix electric.gen.proto.package \ + --output-path=./lib/electric/satellite/protobuf_package.ex \ + ./deps/satellite_proto/proto/satellite.proto + mix protox.generate \ + --output-path=./lib/electric/satellite/protobuf_messages.ex \ + ./deps/satellite_proto/proto/satellite.proto +shell: + iex -S mix + +shell_clean: + iex -S mix run --no-start + +apply_migration: + ./dev/apply-local-migration.sh $(name) + +codespell: + codespell -L authentification --skip .git --skip deps diff --git a/README.md b/components/electric/README.md similarity index 100% rename from README.md rename to components/electric/README.md diff --git a/config/config.exs b/components/electric/config/config.exs similarity index 100% rename from config/config.exs rename to components/electric/config/config.exs diff --git a/config/dev.exs b/components/electric/config/dev.exs similarity index 95% rename from config/dev.exs rename to components/electric/config/dev.exs index b7bc201f..540c5e86 100644 --- a/config/dev.exs +++ b/components/electric/config/dev.exs @@ -6,7 +6,8 @@ config :electric, Electric.Replication.OffsetStorage, file: "./offset_storage_da config :electric, Electric.Migrations, migration_file_name_suffix: "/postgres.sql", - dir: System.get_env("MIGRATIONS_DIR", "./integration_tests/migrations/migration_schemas/") + # Currently unused in dev & likely to be soon removed, but must be set for now + dir: System.get_env("MIGRATIONS_DIR", "./migrations") config :electric, Electric.Replication.Connectors, postgres_1: [ diff --git a/config/prod.exs b/components/electric/config/prod.exs similarity index 100% rename from config/prod.exs rename to components/electric/config/prod.exs diff --git a/config/runtime.exs b/components/electric/config/runtime.exs similarity index 100% rename from config/runtime.exs rename to components/electric/config/runtime.exs diff --git a/config/test.exs b/components/electric/config/test.exs similarity index 100% rename from config/test.exs rename to components/electric/config/test.exs diff --git a/apply-local-migration.sh b/components/electric/dev/apply-local-migration.sh similarity index 100% rename from apply-local-migration.sh rename to components/electric/dev/apply-local-migration.sh diff --git a/integration_tests/auth_mock.json b/components/electric/dev/auth_mock.json similarity index 100% rename from integration_tests/auth_mock.json rename to components/electric/dev/auth_mock.json diff --git a/compose-mounts.yaml b/components/electric/dev/compose-mounts.yaml similarity index 100% rename from compose-mounts.yaml rename to components/electric/dev/compose-mounts.yaml diff --git a/compose.yaml b/components/electric/dev/compose.yaml similarity index 96% rename from compose.yaml rename to components/electric/dev/compose.yaml index c4a10643..1abb0595 100644 --- a/compose.yaml +++ b/components/electric/dev/compose.yaml @@ -21,6 +21,7 @@ services: - "8087:8087" - "8088:8088" privileged: true + init: true db_a: image: europe-docker.pkg.dev/vaxine/vaxine-io/postgres:latest @@ -69,4 +70,4 @@ services: environment: MOCKSERVER_INITIALIZATION_JSON_PATH: /auth_mock.json volumes: - - ./integration_tests/auth_mock.json:/auth_mock.json:ro + - ./auth_mock.json:/auth_mock.json:ro diff --git a/init.sql b/components/electric/dev/init.sql similarity index 100% rename from init.sql rename to components/electric/dev/init.sql diff --git a/postgres.conf b/components/electric/dev/postgres.conf similarity index 100% rename from postgres.conf rename to components/electric/dev/postgres.conf diff --git a/dialyzer.ignore-warnings b/components/electric/dialyzer.ignore-warnings similarity index 100% rename from dialyzer.ignore-warnings rename to components/electric/dialyzer.ignore-warnings diff --git a/lib/electric.ex b/components/electric/lib/electric.ex similarity index 100% rename from lib/electric.ex rename to components/electric/lib/electric.ex diff --git a/lib/electric/application.ex b/components/electric/lib/electric/application.ex similarity index 100% rename from lib/electric/application.ex rename to components/electric/lib/electric/application.ex diff --git a/lib/electric/migration_utils.ex b/components/electric/lib/electric/migration_utils.ex similarity index 100% rename from lib/electric/migration_utils.ex rename to components/electric/lib/electric/migration_utils.ex diff --git a/lib/electric/plug/migrations.ex b/components/electric/lib/electric/plug/migrations.ex similarity index 100% rename from lib/electric/plug/migrations.ex rename to components/electric/lib/electric/plug/migrations.ex diff --git a/lib/electric/plug/router.ex b/components/electric/lib/electric/plug/router.ex similarity index 100% rename from lib/electric/plug/router.ex rename to components/electric/lib/electric/plug/router.ex diff --git a/lib/electric/plug/status.ex b/components/electric/lib/electric/plug/status.ex similarity index 100% rename from lib/electric/plug/status.ex rename to components/electric/lib/electric/plug/status.ex diff --git a/lib/electric/postgres/logical_replication.ex b/components/electric/lib/electric/postgres/logical_replication.ex similarity index 100% rename from lib/electric/postgres/logical_replication.ex rename to components/electric/lib/electric/postgres/logical_replication.ex diff --git a/lib/electric/postgres/logical_replication/decoder.ex b/components/electric/lib/electric/postgres/logical_replication/decoder.ex similarity index 100% rename from lib/electric/postgres/logical_replication/decoder.ex rename to components/electric/lib/electric/postgres/logical_replication/decoder.ex diff --git a/lib/electric/postgres/logical_replication/encoder.ex b/components/electric/lib/electric/postgres/logical_replication/encoder.ex similarity index 100% rename from lib/electric/postgres/logical_replication/encoder.ex rename to components/electric/lib/electric/postgres/logical_replication/encoder.ex diff --git a/lib/electric/postgres/logical_replication/messages.ex b/components/electric/lib/electric/postgres/logical_replication/messages.ex similarity index 100% rename from lib/electric/postgres/logical_replication/messages.ex rename to components/electric/lib/electric/postgres/logical_replication/messages.ex diff --git a/lib/electric/postgres/lsn.ex b/components/electric/lib/electric/postgres/lsn.ex similarity index 100% rename from lib/electric/postgres/lsn.ex rename to components/electric/lib/electric/postgres/lsn.ex diff --git a/lib/electric/postgres/messaging.ex b/components/electric/lib/electric/postgres/messaging.ex similarity index 100% rename from lib/electric/postgres/messaging.ex rename to components/electric/lib/electric/postgres/messaging.ex diff --git a/lib/electric/postgres/oid_database.ex b/components/electric/lib/electric/postgres/oid_database.ex similarity index 100% rename from lib/electric/postgres/oid_database.ex rename to components/electric/lib/electric/postgres/oid_database.ex diff --git a/lib/electric/postgres/postgres_manager.ex b/components/electric/lib/electric/postgres/postgres_manager.ex similarity index 100% rename from lib/electric/postgres/postgres_manager.ex rename to components/electric/lib/electric/postgres/postgres_manager.ex diff --git a/lib/electric/postgres/schema_registry.ex b/components/electric/lib/electric/postgres/schema_registry.ex similarity index 100% rename from lib/electric/postgres/schema_registry.ex rename to components/electric/lib/electric/postgres/schema_registry.ex diff --git a/lib/electric/postgres_server.ex b/components/electric/lib/electric/postgres_server.ex similarity index 100% rename from lib/electric/postgres_server.ex rename to components/electric/lib/electric/postgres_server.ex diff --git a/lib/electric/replication/changes.ex b/components/electric/lib/electric/replication/changes.ex similarity index 100% rename from lib/electric/replication/changes.ex rename to components/electric/lib/electric/replication/changes.ex diff --git a/lib/electric/replication/changes/ownership.ex b/components/electric/lib/electric/replication/changes/ownership.ex similarity index 100% rename from lib/electric/replication/changes/ownership.ex rename to components/electric/lib/electric/replication/changes/ownership.ex diff --git a/lib/electric/replication/connectors.ex b/components/electric/lib/electric/replication/connectors.ex similarity index 100% rename from lib/electric/replication/connectors.ex rename to components/electric/lib/electric/replication/connectors.ex diff --git a/lib/electric/replication/downstream_producer.ex b/components/electric/lib/electric/replication/downstream_producer.ex similarity index 100% rename from lib/electric/replication/downstream_producer.ex rename to components/electric/lib/electric/replication/downstream_producer.ex diff --git a/lib/electric/replication/metadata.ex b/components/electric/lib/electric/replication/metadata.ex similarity index 100% rename from lib/electric/replication/metadata.ex rename to components/electric/lib/electric/replication/metadata.ex diff --git a/lib/electric/replication/offset_storage.ex b/components/electric/lib/electric/replication/offset_storage.ex similarity index 100% rename from lib/electric/replication/offset_storage.ex rename to components/electric/lib/electric/replication/offset_storage.ex diff --git a/lib/electric/replication/postgres/client.ex b/components/electric/lib/electric/replication/postgres/client.ex similarity index 100% rename from lib/electric/replication/postgres/client.ex rename to components/electric/lib/electric/replication/postgres/client.ex diff --git a/lib/electric/replication/postgres/logical_replication_producer.ex b/components/electric/lib/electric/replication/postgres/logical_replication_producer.ex similarity index 100% rename from lib/electric/replication/postgres/logical_replication_producer.ex rename to components/electric/lib/electric/replication/postgres/logical_replication_producer.ex diff --git a/lib/electric/replication/postgres/slot_server.ex b/components/electric/lib/electric/replication/postgres/slot_server.ex similarity index 100% rename from lib/electric/replication/postgres/slot_server.ex rename to components/electric/lib/electric/replication/postgres/slot_server.ex diff --git a/lib/electric/replication/postgres/tcp_server.ex b/components/electric/lib/electric/replication/postgres/tcp_server.ex similarity index 100% rename from lib/electric/replication/postgres/tcp_server.ex rename to components/electric/lib/electric/replication/postgres/tcp_server.ex diff --git a/lib/electric/replication/postgres_connector.ex b/components/electric/lib/electric/replication/postgres_connector.ex similarity index 100% rename from lib/electric/replication/postgres_connector.ex rename to components/electric/lib/electric/replication/postgres_connector.ex diff --git a/lib/electric/replication/postgres_connector_sup.ex b/components/electric/lib/electric/replication/postgres_connector_sup.ex similarity index 100% rename from lib/electric/replication/postgres_connector_sup.ex rename to components/electric/lib/electric/replication/postgres_connector_sup.ex diff --git a/lib/electric/replication/row.ex b/components/electric/lib/electric/replication/row.ex similarity index 100% rename from lib/electric/replication/row.ex rename to components/electric/lib/electric/replication/row.ex diff --git a/lib/electric/replication/satellite_connector.ex b/components/electric/lib/electric/replication/satellite_connector.ex similarity index 100% rename from lib/electric/replication/satellite_connector.ex rename to components/electric/lib/electric/replication/satellite_connector.ex diff --git a/lib/electric/replication/vaxine.ex b/components/electric/lib/electric/replication/vaxine.ex similarity index 100% rename from lib/electric/replication/vaxine.ex rename to components/electric/lib/electric/replication/vaxine.ex diff --git a/lib/electric/replication/vaxine/log_consumer.ex b/components/electric/lib/electric/replication/vaxine/log_consumer.ex similarity index 100% rename from lib/electric/replication/vaxine/log_consumer.ex rename to components/electric/lib/electric/replication/vaxine/log_consumer.ex diff --git a/lib/electric/replication/vaxine/log_producer.ex b/components/electric/lib/electric/replication/vaxine/log_producer.ex similarity index 100% rename from lib/electric/replication/vaxine/log_producer.ex rename to components/electric/lib/electric/replication/vaxine/log_producer.ex diff --git a/lib/electric/replication/vaxine/transaction_builder.ex b/components/electric/lib/electric/replication/vaxine/transaction_builder.ex similarity index 100% rename from lib/electric/replication/vaxine/transaction_builder.ex rename to components/electric/lib/electric/replication/vaxine/transaction_builder.ex diff --git a/lib/electric/retry.ex b/components/electric/lib/electric/retry.ex similarity index 100% rename from lib/electric/retry.ex rename to components/electric/lib/electric/retry.ex diff --git a/lib/electric/satellite/auth.ex b/components/electric/lib/electric/satellite/auth.ex similarity index 100% rename from lib/electric/satellite/auth.ex rename to components/electric/lib/electric/satellite/auth.ex diff --git a/lib/electric/satellite/auth/insecure.ex b/components/electric/lib/electric/satellite/auth/insecure.ex similarity index 100% rename from lib/electric/satellite/auth/insecure.ex rename to components/electric/lib/electric/satellite/auth/insecure.ex diff --git a/lib/electric/satellite/auth/jwt.ex b/components/electric/lib/electric/satellite/auth/jwt.ex similarity index 100% rename from lib/electric/satellite/auth/jwt.ex rename to components/electric/lib/electric/satellite/auth/jwt.ex diff --git a/lib/electric/satellite/client_manager.ex b/components/electric/lib/electric/satellite/client_manager.ex similarity index 100% rename from lib/electric/satellite/client_manager.ex rename to components/electric/lib/electric/satellite/client_manager.ex diff --git a/lib/electric/satellite/lsn.ex b/components/electric/lib/electric/satellite/lsn.ex similarity index 100% rename from lib/electric/satellite/lsn.ex rename to components/electric/lib/electric/satellite/lsn.ex diff --git a/lib/electric/satellite/protobuf.ex b/components/electric/lib/electric/satellite/protobuf.ex similarity index 100% rename from lib/electric/satellite/protobuf.ex rename to components/electric/lib/electric/satellite/protobuf.ex diff --git a/lib/electric/satellite/protobuf_messages.ex b/components/electric/lib/electric/satellite/protobuf_messages.ex similarity index 100% rename from lib/electric/satellite/protobuf_messages.ex rename to components/electric/lib/electric/satellite/protobuf_messages.ex diff --git a/lib/electric/satellite/protobuf_package.ex b/components/electric/lib/electric/satellite/protobuf_package.ex similarity index 100% rename from lib/electric/satellite/protobuf_package.ex rename to components/electric/lib/electric/satellite/protobuf_package.ex diff --git a/lib/electric/satellite/protocol.ex b/components/electric/lib/electric/satellite/protocol.ex similarity index 100% rename from lib/electric/satellite/protocol.ex rename to components/electric/lib/electric/satellite/protocol.ex diff --git a/lib/electric/satellite/serialization.ex b/components/electric/lib/electric/satellite/serialization.ex similarity index 100% rename from lib/electric/satellite/serialization.ex rename to components/electric/lib/electric/satellite/serialization.ex diff --git a/lib/electric/satellite/ws_server.ex b/components/electric/lib/electric/satellite/ws_server.ex similarity index 100% rename from lib/electric/satellite/ws_server.ex rename to components/electric/lib/electric/satellite/ws_server.ex diff --git a/lib/electric/telemetry.ex b/components/electric/lib/electric/telemetry.ex similarity index 100% rename from lib/electric/telemetry.ex rename to components/electric/lib/electric/telemetry.ex diff --git a/lib/electric/telemetry/metrics.ex b/components/electric/lib/electric/telemetry/metrics.ex similarity index 100% rename from lib/electric/telemetry/metrics.ex rename to components/electric/lib/electric/telemetry/metrics.ex diff --git a/lib/electric/utils.ex b/components/electric/lib/electric/utils.ex similarity index 100% rename from lib/electric/utils.ex rename to components/electric/lib/electric/utils.ex diff --git a/lib/electric/vax_repo.ex b/components/electric/lib/electric/vax_repo.ex similarity index 100% rename from lib/electric/vax_repo.ex rename to components/electric/lib/electric/vax_repo.ex diff --git a/lib/mix/tasks/electric.gen.proto.package.ex b/components/electric/lib/mix/tasks/electric.gen.proto.package.ex similarity index 100% rename from lib/mix/tasks/electric.gen.proto.package.ex rename to components/electric/lib/mix/tasks/electric.gen.proto.package.ex diff --git a/lib/mix/tasks/electric.gen.token.ex b/components/electric/lib/mix/tasks/electric.gen.token.ex similarity index 100% rename from lib/mix/tasks/electric.gen.token.ex rename to components/electric/lib/mix/tasks/electric.gen.token.ex diff --git a/mix.exs b/components/electric/mix.exs similarity index 100% rename from mix.exs rename to components/electric/mix.exs diff --git a/mix.lock b/components/electric/mix.lock similarity index 100% rename from mix.lock rename to components/electric/mix.lock diff --git a/test/electric/postgres/logical_replication/decoder_test.exs b/components/electric/test/electric/postgres/logical_replication/decoder_test.exs similarity index 100% rename from test/electric/postgres/logical_replication/decoder_test.exs rename to components/electric/test/electric/postgres/logical_replication/decoder_test.exs diff --git a/test/electric/postgres/logical_replication/encoder_test.exs b/components/electric/test/electric/postgres/logical_replication/encoder_test.exs similarity index 100% rename from test/electric/postgres/logical_replication/encoder_test.exs rename to components/electric/test/electric/postgres/logical_replication/encoder_test.exs diff --git a/test/electric/postgres/logical_replication_test.exs b/components/electric/test/electric/postgres/logical_replication_test.exs similarity index 100% rename from test/electric/postgres/logical_replication_test.exs rename to components/electric/test/electric/postgres/logical_replication_test.exs diff --git a/test/electric/replication/changes/ownership_test.exs b/components/electric/test/electric/replication/changes/ownership_test.exs similarity index 100% rename from test/electric/replication/changes/ownership_test.exs rename to components/electric/test/electric/replication/changes/ownership_test.exs diff --git a/test/electric/replication/downstream_producer_test.exs b/components/electric/test/electric/replication/downstream_producer_test.exs similarity index 100% rename from test/electric/replication/downstream_producer_test.exs rename to components/electric/test/electric/replication/downstream_producer_test.exs diff --git a/test/electric/replication/offset_storage_test.exs b/components/electric/test/electric/replication/offset_storage_test.exs similarity index 100% rename from test/electric/replication/offset_storage_test.exs rename to components/electric/test/electric/replication/offset_storage_test.exs diff --git a/test/electric/replication/postgres/logical_replication_producer_test.exs b/components/electric/test/electric/replication/postgres/logical_replication_producer_test.exs similarity index 100% rename from test/electric/replication/postgres/logical_replication_producer_test.exs rename to components/electric/test/electric/replication/postgres/logical_replication_producer_test.exs diff --git a/test/electric/replication/postgres/slot_server_test.exs b/components/electric/test/electric/replication/postgres/slot_server_test.exs similarity index 100% rename from test/electric/replication/postgres/slot_server_test.exs rename to components/electric/test/electric/replication/postgres/slot_server_test.exs diff --git a/test/electric/replication/vaxine/log_consumer_test.exs b/components/electric/test/electric/replication/vaxine/log_consumer_test.exs similarity index 100% rename from test/electric/replication/vaxine/log_consumer_test.exs rename to components/electric/test/electric/replication/vaxine/log_consumer_test.exs diff --git a/test/electric/replication/vaxine/log_producer_test.exs b/components/electric/test/electric/replication/vaxine/log_producer_test.exs similarity index 100% rename from test/electric/replication/vaxine/log_producer_test.exs rename to components/electric/test/electric/replication/vaxine/log_producer_test.exs diff --git a/test/electric/replication/vaxine/transaction_builder_test.exs b/components/electric/test/electric/replication/vaxine/transaction_builder_test.exs similarity index 100% rename from test/electric/replication/vaxine/transaction_builder_test.exs rename to components/electric/test/electric/replication/vaxine/transaction_builder_test.exs diff --git a/test/electric/replication/vaxine/vx_client_message_example.exs b/components/electric/test/electric/replication/vaxine/vx_client_message_example.exs similarity index 100% rename from test/electric/replication/vaxine/vx_client_message_example.exs rename to components/electric/test/electric/replication/vaxine/vx_client_message_example.exs diff --git a/test/electric/satellite/satellite_pb_test.exs b/components/electric/test/electric/satellite/satellite_pb_test.exs similarity index 100% rename from test/electric/satellite/satellite_pb_test.exs rename to components/electric/test/electric/satellite/satellite_pb_test.exs diff --git a/test/electric/satellite/satellite_ws_test.exs b/components/electric/test/electric/satellite/satellite_ws_test.exs similarity index 100% rename from test/electric/satellite/satellite_ws_test.exs rename to components/electric/test/electric/satellite/satellite_ws_test.exs diff --git a/test/electric/satellite/satellte_serialization_test.exs b/components/electric/test/electric/satellite/satellte_serialization_test.exs similarity index 100% rename from test/electric/satellite/satellte_serialization_test.exs rename to components/electric/test/electric/satellite/satellte_serialization_test.exs diff --git a/test/electric/to_vaxine_test.exs b/components/electric/test/electric/to_vaxine_test.exs similarity index 100% rename from test/electric/to_vaxine_test.exs rename to components/electric/test/electric/to_vaxine_test.exs diff --git a/test/electric/utils_test.exs b/components/electric/test/electric/utils_test.exs similarity index 100% rename from test/electric/utils_test.exs rename to components/electric/test/electric/utils_test.exs diff --git a/test/electric_test.exs b/components/electric/test/electric_test.exs similarity index 100% rename from test/electric_test.exs rename to components/electric/test/electric_test.exs diff --git a/test/mix/tasks/electric.gen.token_test.exs b/components/electric/test/mix/tasks/electric.gen.token_test.exs similarity index 100% rename from test/mix/tasks/electric.gen.token_test.exs rename to components/electric/test/mix/tasks/electric.gen.token_test.exs diff --git a/test/support/downstream_producer_mock.ex b/components/electric/test/support/downstream_producer_mock.ex similarity index 100% rename from test/support/downstream_producer_mock.ex rename to components/electric/test/support/downstream_producer_mock.ex diff --git a/test/support/entry.ex b/components/electric/test/support/entry.ex similarity index 100% rename from test/support/entry.ex rename to components/electric/test/support/entry.ex diff --git a/test/support/postgres_repo.ex b/components/electric/test/support/postgres_repo.ex similarity index 100% rename from test/support/postgres_repo.ex rename to components/electric/test/support/postgres_repo.ex diff --git a/test/support/satellite_table.ex b/components/electric/test/support/satellite_table.ex similarity index 100% rename from test/support/satellite_table.ex rename to components/electric/test/support/satellite_table.ex diff --git a/test/support/satellite_ws_client.ex b/components/electric/test/support/satellite_ws_client.ex similarity index 100% rename from test/support/satellite_ws_client.ex rename to components/electric/test/support/satellite_ws_client.ex diff --git a/test/support/schema_registry_helper.ex b/components/electric/test/support/schema_registry_helper.ex similarity index 100% rename from test/support/schema_registry_helper.ex rename to components/electric/test/support/schema_registry_helper.ex diff --git a/test/test_helper.exs b/components/electric/test/test_helper.exs similarity index 100% rename from test/test_helper.exs rename to components/electric/test/test_helper.exs diff --git a/integration_tests/.gitignore b/e2e/.gitignore similarity index 100% rename from integration_tests/.gitignore rename to e2e/.gitignore diff --git a/integration_tests/00_shared_init.sql b/e2e/00_shared_init.sql similarity index 100% rename from integration_tests/00_shared_init.sql rename to e2e/00_shared_init.sql diff --git a/integration_tests/Makefile b/e2e/Makefile similarity index 100% rename from integration_tests/Makefile rename to e2e/Makefile diff --git a/integration_tests/README.md b/e2e/README.md similarity index 100% rename from integration_tests/README.md rename to e2e/README.md diff --git a/e2e/auth_mock.json b/e2e/auth_mock.json new file mode 100644 index 00000000..c9ae9e28 --- /dev/null +++ b/e2e/auth_mock.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "path": "/auth", + "body": { + "type": "JSON", + "json": { + "token": "token", + "cluster_id": "cluster_auth_id" + } + } + }, + "httpResponse": { + "statusCode": 200 + } + }, + { + "httpRequest": { + "path": "/auth", + "body": { + "type": "JSON", + "json": { + "token": "invalid_token", + "cluster_id": "cluster_auth_id" + } + } + }, + "httpResponse": { + "statusCode": 401 + } + } +] diff --git a/integration_tests/common.luxinc b/e2e/common.luxinc similarity index 100% rename from integration_tests/common.luxinc rename to e2e/common.luxinc diff --git a/integration_tests/common.mk b/e2e/common.mk similarity index 94% rename from integration_tests/common.mk rename to e2e/common.mk index 528b6a95..20521e09 100644 --- a/integration_tests/common.mk +++ b/e2e/common.mk @@ -1,10 +1,13 @@ export PROJECT_ROOT=$(shell git rev-parse --show-toplevel) -LUX=${PROJECT_ROOT}/integration_tests/lux/bin/lux + +mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) +export E2E_ROOT := $(dir $(mkfile_path)) + +LUX=${E2E_ROOT}/lux/bin/lux DOCKER_REGISTRY = europe-docker.pkg.dev/vaxine/vaxine-io DOCKER_REGISTRY2 = europe-docker.pkg.dev/vaxine/ci export BUILDER_IMAGE=${DOCKER_REGISTRY2}/electric-builder:latest - export ELIXIR_VERSION=1.13.4 export OTP_VERSION=24.3 export DEBIAN_VERSION=bullseye-20210902-slim @@ -92,14 +95,14 @@ start_sysbench: start_elixir_test_%: docker compose -f ${DOCKER_COMPOSE_FILE} run \ --rm --entrypoint=/bin/bash \ - --workdir=${PROJECT_ROOT}/integration_tests/elixir_client \ + --workdir=${E2E_ROOT}/elixir_client \ -e ELECTRIC_VERSION=`git describe --abbrev=7 --tags --always --first-parent` \ elixir_client_$* start_satellite_client_%: docker compose -f ${DOCKER_COMPOSE_FILE} run \ --rm --entrypoint=/bin/bash \ - --workdir=${PROJECT_ROOT}/integration_tests/satellite_client \ + --workdir=${E2E_ROOT}/satellite_client \ satellite_client_$* VAXINE_BRANCH?=main @@ -127,7 +130,7 @@ docker-psql-%: docker-attach-%: docker compose -f ${DOCKER_COMPOSE_FILE} exec $* bash -DOCKER_WORKDIR?=${PROJECT_ROOT} +DOCKER_WORKDIR?=${E2E_ROOT} docker-start-clean-%: docker compose -f ${DOCKER_COMPOSE_FILE} run --rm --entrypoint=/bin/sh \ diff --git a/integration_tests/docker/Dockerfile.sysbench b/e2e/docker/Dockerfile.sysbench similarity index 100% rename from integration_tests/docker/Dockerfile.sysbench rename to e2e/docker/Dockerfile.sysbench diff --git a/integration_tests/elixir_client/.gitignore b/e2e/elixir_client/.gitignore similarity index 100% rename from integration_tests/elixir_client/.gitignore rename to e2e/elixir_client/.gitignore diff --git a/integration_tests/elixir_client/Makefile b/e2e/elixir_client/Makefile similarity index 59% rename from integration_tests/elixir_client/Makefile rename to e2e/elixir_client/Makefile index 0c542879..e6b08052 100644 --- a/integration_tests/elixir_client/Makefile +++ b/e2e/elixir_client/Makefile @@ -2,19 +2,21 @@ include ../common.mk ELIXIR_BUILD_DOCKER=elixir_client DOCKER_COMPOSE_FILE=../services_templates.yaml -DOCKER_WORKDIR=${PROJECT_ROOT}/integration_tests/elixir_client +DOCKER_WORKDIR=${E2E_ROOT}/elixir_client export DOCKER_REPO ?= europe-docker.pkg.dev/vaxine/ci export BUILDER_IMAGE=${DOCKER_REPO}/electric-builder:latest +ELECTRIC_DIR=${PROJECT_ROOT}/components/electric + build: make docker-make MK_TARGET=local-build MK_DOCKER=${ELIXIR_BUILD_DOCKER} local-build: - (cd ../../ && make build_tools deps compile-test) + (cd ${ELECTRIC_DIR} && make build_tools deps compile-test) run_elixir: - (cd ../../ && iex -S mix run --no-start --no-deps-check -e "Application.put_env(:elixir, :ansi_enabled, false)") + (cd ${ELECTRIC_DIR} && iex -S mix run --no-start --no-deps-check -e "Application.put_env(:elixir, :ansi_enabled, false)") clean: rm -rf _build diff --git a/integration_tests/init.sql b/e2e/init.sql similarity index 100% rename from integration_tests/init.sql rename to e2e/init.sql diff --git a/integration_tests/migrations/Makefile b/e2e/migrations/Makefile similarity index 100% rename from integration_tests/migrations/Makefile rename to e2e/migrations/Makefile diff --git a/integration_tests/migrations/bidirectional.lux b/e2e/migrations/bidirectional.lux similarity index 100% rename from integration_tests/migrations/bidirectional.lux rename to e2e/migrations/bidirectional.lux diff --git a/integration_tests/migrations/compose.yaml b/e2e/migrations/compose.yaml similarity index 100% rename from integration_tests/migrations/compose.yaml rename to e2e/migrations/compose.yaml diff --git a/integration_tests/migrations/init.sql b/e2e/migrations/init.sql similarity index 100% rename from integration_tests/migrations/init.sql rename to e2e/migrations/init.sql diff --git a/integration_tests/migrations/m_null_default_support/1669232573_init/migration.sql b/e2e/migrations/m_null_default_support/1669232573_init/migration.sql similarity index 100% rename from integration_tests/migrations/m_null_default_support/1669232573_init/migration.sql rename to e2e/migrations/m_null_default_support/1669232573_init/migration.sql diff --git a/integration_tests/migrations/m_null_default_support/1669232573_init/postgres.sql b/e2e/migrations/m_null_default_support/1669232573_init/postgres.sql similarity index 100% rename from integration_tests/migrations/m_null_default_support/1669232573_init/postgres.sql rename to e2e/migrations/m_null_default_support/1669232573_init/postgres.sql diff --git a/integration_tests/migrations/m_null_default_support/index.js b/e2e/migrations/m_null_default_support/index.js similarity index 100% rename from integration_tests/migrations/m_null_default_support/index.js rename to e2e/migrations/m_null_default_support/index.js diff --git a/integration_tests/migrations/m_sanity_check/1669232573_init/migration.sql b/e2e/migrations/m_sanity_check/1669232573_init/migration.sql similarity index 100% rename from integration_tests/migrations/m_sanity_check/1669232573_init/migration.sql rename to e2e/migrations/m_sanity_check/1669232573_init/migration.sql diff --git a/integration_tests/migrations/m_sanity_check/1669232573_init/postgres.sql b/e2e/migrations/m_sanity_check/1669232573_init/postgres.sql similarity index 100% rename from integration_tests/migrations/m_sanity_check/1669232573_init/postgres.sql rename to e2e/migrations/m_sanity_check/1669232573_init/postgres.sql diff --git a/integration_tests/migrations/m_sanity_check/1669232634_add_column/migration.sql b/e2e/migrations/m_sanity_check/1669232634_add_column/migration.sql similarity index 100% rename from integration_tests/migrations/m_sanity_check/1669232634_add_column/migration.sql rename to e2e/migrations/m_sanity_check/1669232634_add_column/migration.sql diff --git a/integration_tests/migrations/m_sanity_check/1669232634_add_column/postgres.sql b/e2e/migrations/m_sanity_check/1669232634_add_column/postgres.sql similarity index 100% rename from integration_tests/migrations/m_sanity_check/1669232634_add_column/postgres.sql rename to e2e/migrations/m_sanity_check/1669232634_add_column/postgres.sql diff --git a/integration_tests/migrations/m_sanity_check/index.js b/e2e/migrations/m_sanity_check/index.js similarity index 100% rename from integration_tests/migrations/m_sanity_check/index.js rename to e2e/migrations/m_sanity_check/index.js diff --git a/integration_tests/migrations/satellite.luxinc b/e2e/migrations/satellite.luxinc similarity index 100% rename from integration_tests/migrations/satellite.luxinc rename to e2e/migrations/satellite.luxinc diff --git a/integration_tests/migrations/satellite_null_test.lux b/e2e/migrations/satellite_null_test.lux similarity index 100% rename from integration_tests/migrations/satellite_null_test.lux rename to e2e/migrations/satellite_null_test.lux diff --git a/integration_tests/migrations/satellite_test.lux b/e2e/migrations/satellite_test.lux similarity index 100% rename from integration_tests/migrations/satellite_test.lux rename to e2e/migrations/satellite_test.lux diff --git a/integration_tests/migrations/shared.luxinc b/e2e/migrations/shared.luxinc similarity index 82% rename from integration_tests/migrations/shared.luxinc rename to e2e/migrations/shared.luxinc index a05b5387..0849add4 100644 --- a/integration_tests/migrations/shared.luxinc +++ b/e2e/migrations/shared.luxinc @@ -32,7 +32,7 @@ [macro setup_rest migration_dir] [shell electric_1] [timeout 10] - !export MIGRATION_DIRS=${PROJECT_ROOT}/integration_tests/migrations/${migration_dir} + !export MIGRATION_DIRS=${E2E_ROOT}/migrations/${migration_dir} !make start_electric_1 -$fail_pattern ?START_REPLICATION SLOT @@ -40,7 +40,7 @@ [shell electric_2] [timeout 10] - !export MIGRATION_DIRS=${PROJECT_ROOT}/integration_tests/migrations/${migration_dir} + !export MIGRATION_DIRS=${E2E_ROOT}/migrations/${migration_dir} !make start_electric_2 -$fail_pattern ?START_REPLICATION SLOT @@ -50,7 +50,7 @@ [macro start_satellite name migration_dir] [shell satellite_${name}] - !export MIGRATION_DIRS=${PROJECT_ROOT}/integration_tests/migrations/${migration_dir} + !export MIGRATION_DIRS=${E2E_ROOT}/migrations/${migration_dir} !make start_satellite_client_${name} [endmacro] diff --git a/integration_tests/migrations/simple_test.lux b/e2e/migrations/simple_test.lux similarity index 100% rename from integration_tests/migrations/simple_test.lux rename to e2e/migrations/simple_test.lux diff --git a/integration_tests/multi_dc/.gitignore b/e2e/multi_dc/.gitignore similarity index 100% rename from integration_tests/multi_dc/.gitignore rename to e2e/multi_dc/.gitignore diff --git a/integration_tests/multi_dc/Makefile b/e2e/multi_dc/Makefile similarity index 100% rename from integration_tests/multi_dc/Makefile rename to e2e/multi_dc/Makefile diff --git a/integration_tests/multi_dc/compose.yaml b/e2e/multi_dc/compose.yaml similarity index 100% rename from integration_tests/multi_dc/compose.yaml rename to e2e/multi_dc/compose.yaml diff --git a/integration_tests/multi_dc/one_direction.lux b/e2e/multi_dc/one_direction.lux similarity index 100% rename from integration_tests/multi_dc/one_direction.lux rename to e2e/multi_dc/one_direction.lux diff --git a/integration_tests/multi_dc/shared.luxinc b/e2e/multi_dc/shared.luxinc similarity index 100% rename from integration_tests/multi_dc/shared.luxinc rename to e2e/multi_dc/shared.luxinc diff --git a/integration_tests/multi_dc/simple_test.lux b/e2e/multi_dc/simple_test.lux similarity index 100% rename from integration_tests/multi_dc/simple_test.lux rename to e2e/multi_dc/simple_test.lux diff --git a/integration_tests/multi_dc/sysbench_tests.lux b/e2e/multi_dc/sysbench_tests.lux similarity index 100% rename from integration_tests/multi_dc/sysbench_tests.lux rename to e2e/multi_dc/sysbench_tests.lux diff --git a/integration_tests/postgres.conf b/e2e/postgres.conf similarity index 100% rename from integration_tests/postgres.conf rename to e2e/postgres.conf diff --git a/integration_tests/satellite_client/.gitignore b/e2e/satellite_client/.gitignore similarity index 100% rename from integration_tests/satellite_client/.gitignore rename to e2e/satellite_client/.gitignore diff --git a/integration_tests/satellite_client/.prettierrc.json b/e2e/satellite_client/.prettierrc.json similarity index 100% rename from integration_tests/satellite_client/.prettierrc.json rename to e2e/satellite_client/.prettierrc.json diff --git a/integration_tests/satellite_client/Makefile b/e2e/satellite_client/Makefile similarity index 90% rename from integration_tests/satellite_client/Makefile rename to e2e/satellite_client/Makefile index a7907587..bf3ba5e9 100644 --- a/integration_tests/satellite_client/Makefile +++ b/e2e/satellite_client/Makefile @@ -2,7 +2,7 @@ include ../common.mk NODEJS_DOCKER=satellite_client DOCKER_COMPOSE_FILE=../services_templates.yaml -DOCKER_WORKDIR=${PROJECT_ROOT}/integration_tests/satellite_client +DOCKER_WORKDIR=${E2E_ROOT}/satellite_client node_modules: yarn install --frozen-lockfile --no-default-rc --network-concurrency 1 diff --git a/integration_tests/satellite_client/package.json b/e2e/satellite_client/package.json similarity index 100% rename from integration_tests/satellite_client/package.json rename to e2e/satellite_client/package.json diff --git a/integration_tests/satellite_client/src/client.ts b/e2e/satellite_client/src/client.ts similarity index 100% rename from integration_tests/satellite_client/src/client.ts rename to e2e/satellite_client/src/client.ts diff --git a/integration_tests/satellite_client/tsconfig.json b/e2e/satellite_client/tsconfig.json similarity index 100% rename from integration_tests/satellite_client/tsconfig.json rename to e2e/satellite_client/tsconfig.json diff --git a/integration_tests/satellite_client/yarn.lock b/e2e/satellite_client/yarn.lock similarity index 100% rename from integration_tests/satellite_client/yarn.lock rename to e2e/satellite_client/yarn.lock diff --git a/integration_tests/services_templates.yaml b/e2e/services_templates.yaml similarity index 82% rename from integration_tests/services_templates.yaml rename to e2e/services_templates.yaml index 6a890959..a9bf7b42 100644 --- a/integration_tests/services_templates.yaml +++ b/e2e/services_templates.yaml @@ -64,7 +64,7 @@ services: environment: SATELLITE_AUTH_SIGNING_ISS: dev.electric-sql.com SATELLITE_AUTH_SIGNING_KEY: integration-tests-signing-key-example - HOME: ${PROJECT_ROOT}/integration_tests/satellite_client + HOME: ${E2E_ROOT}/satellite_client SATELLITE_DB_PATH: "${SATELLITE_DB_PATH}" NODE_DISABLE_COLORS: 1 TERM: dumb @@ -73,7 +73,7 @@ services: volumes: # Deliberately mount folder below root, so that yarn/npm would not try # to access .git directory, as they do not handle git ls-remote properly - - ${PROJECT_ROOT}/integration_tests:${PROJECT_ROOT}/integration_tests:rw + - ${E2E_ROOT}:${E2E_ROOT}:rw - /etc/group:/etc/group:ro - /etc/passwd:/etc/passwd:ro - /etc/shadow:/etc/shadow:ro @@ -84,15 +84,15 @@ services: user: "${UID}:${GID}" environment: MIX_ENV: test - MIX_HOME: ${PROJECT_ROOT}/integration_tests/elixir_client/ - MIX_BUILD_ROOT: ${PROJECT_ROOT}/integration_tests/elixir_client/_build - MIX_DEPS_PATH: ${PROJECT_ROOT}/integration_tests/elixir_client/deps - HEX_HOME: ${PROJECT_ROOT}/integration_tests/elixir_client/.hex + MIX_HOME: ${E2E_ROOT}/elixir_client/ + MIX_BUILD_ROOT: ${E2E_ROOT}/elixir_client/_build + MIX_DEPS_PATH: ${E2E_ROOT}/elixir_client/deps + HEX_HOME: ${E2E_ROOT}/elixir_client/.hex UID: ${UID} GID: ${GID} volumes: - ${PROJECT_ROOT}:${PROJECT_ROOT}:ro - - ${PROJECT_ROOT}/integration_tests/elixir_client:${PROJECT_ROOT}/integration_tests/elixir_client + - ${E2E_ROOT}/elixir_client:${E2E_ROOT}/elixir_client - /etc/group:/etc/group:ro - /etc/passwd:/etc/passwd:ro - /etc/shadow:/etc/shadow:ro diff --git a/integration_tests/single_dc/.gitignore b/e2e/single_dc/.gitignore similarity index 100% rename from integration_tests/single_dc/.gitignore rename to e2e/single_dc/.gitignore diff --git a/integration_tests/single_dc/Makefile b/e2e/single_dc/Makefile similarity index 100% rename from integration_tests/single_dc/Makefile rename to e2e/single_dc/Makefile diff --git a/integration_tests/single_dc/bidirectional.lux b/e2e/single_dc/bidirectional.lux similarity index 100% rename from integration_tests/single_dc/bidirectional.lux rename to e2e/single_dc/bidirectional.lux diff --git a/integration_tests/single_dc/bidirectional_multiple_electric.lux b/e2e/single_dc/bidirectional_multiple_electric.lux similarity index 100% rename from integration_tests/single_dc/bidirectional_multiple_electric.lux rename to e2e/single_dc/bidirectional_multiple_electric.lux diff --git a/integration_tests/single_dc/bidirectional_reversed.lux b/e2e/single_dc/bidirectional_reversed.lux similarity index 100% rename from integration_tests/single_dc/bidirectional_reversed.lux rename to e2e/single_dc/bidirectional_reversed.lux diff --git a/integration_tests/single_dc/compose.yaml b/e2e/single_dc/compose.yaml similarity index 100% rename from integration_tests/single_dc/compose.yaml rename to e2e/single_dc/compose.yaml diff --git a/integration_tests/single_dc/insert_conflict.lux b/e2e/single_dc/insert_conflict.lux similarity index 100% rename from integration_tests/single_dc/insert_conflict.lux rename to e2e/single_dc/insert_conflict.lux diff --git a/integration_tests/single_dc/insert_insert.lux b/e2e/single_dc/insert_insert.lux similarity index 100% rename from integration_tests/single_dc/insert_insert.lux rename to e2e/single_dc/insert_insert.lux diff --git a/integration_tests/single_dc/one_direction.lux b/e2e/single_dc/one_direction.lux similarity index 100% rename from integration_tests/single_dc/one_direction.lux rename to e2e/single_dc/one_direction.lux diff --git a/integration_tests/single_dc/partial_replication.lux b/e2e/single_dc/partial_replication.lux similarity index 100% rename from integration_tests/single_dc/partial_replication.lux rename to e2e/single_dc/partial_replication.lux diff --git a/integration_tests/single_dc/shared.luxinc b/e2e/single_dc/shared.luxinc similarity index 100% rename from integration_tests/single_dc/shared.luxinc rename to e2e/single_dc/shared.luxinc diff --git a/integration_tests/single_dc/simple_test.lux b/e2e/single_dc/simple_test.lux similarity index 100% rename from integration_tests/single_dc/simple_test.lux rename to e2e/single_dc/simple_test.lux diff --git a/integration_tests/single_dc/sysbench_tests.lux b/e2e/single_dc/sysbench_tests.lux similarity index 100% rename from integration_tests/single_dc/sysbench_tests.lux rename to e2e/single_dc/sysbench_tests.lux diff --git a/integration_tests/single_dc/sysbench_ws.lux b/e2e/single_dc/sysbench_ws.lux similarity index 100% rename from integration_tests/single_dc/sysbench_ws.lux rename to e2e/single_dc/sysbench_ws.lux diff --git a/integration_tests/single_dc/update_wins.lux b/e2e/single_dc/update_wins.lux similarity index 100% rename from integration_tests/single_dc/update_wins.lux rename to e2e/single_dc/update_wins.lux