-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vax-230] Introduce Satellite E2E tests.
Fix: github CI to use actual branch commit instead the merge on top of main. (actions/checkout#881) Fix: caching for docker and CI to make it more strict. We no longer pick local-build image on CI for integration tests Fix: migration tests that previously were skipped on CI Fix: postgres manager is handling multiple requests originated from the schema. Fix: satellite protocol code would previously crash on start/stop/start replication flow.
- Loading branch information
1 parent
67d0248
commit e1992c0
Showing
36 changed files
with
1,513 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,59 +16,88 @@ jobs: | |
name: Get all the necessary dependencies | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- run: ls -lah | ||
- name: Inject slug/short variables | ||
uses: rlespinasse/github-slug-action@v4 | ||
- uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: "24.3" | ||
elixir-version: "1.13" | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.KEY_TO_ACCESS_SATELLITE_JS_PROTO }} | ||
|
||
- name: Try to reuse cached deps | ||
id: cache-deps | ||
uses: actions/cache@v3 | ||
with: | ||
path: deps | ||
key: ${{ runner.os }}-mixdeps-${{ hashFiles('**/mix.lock') }} | ||
|
||
- run: make deps pretest_compile | ||
- uses: actions/cache@v3 | ||
|
||
- name: Cache compiled code | ||
id: cache-build | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
deps | ||
_build | ||
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-mix | ||
path: _build | ||
key: ${{ runner.os }}-mixbuild-${{ env.GITHUB_SHA_SHORT }} | ||
|
||
tests: | ||
name: elixir tests and dialyzer | ||
runs-on: ubuntu-latest | ||
needs: deps | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Inject slug/short variables | ||
uses: rlespinasse/github-slug-action@v4 | ||
- uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: "24.3" | ||
elixir-version: "1.13" | ||
- name: Prepare auxillary services | ||
run: make start_dev_env | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
deps | ||
_build | ||
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-mix | ||
|
||
- name: Try to reuse cached deps | ||
id: cache-deps | ||
uses: actions/cache@v3 | ||
with: | ||
path: deps | ||
key: ${{ runner.os }}-mixdeps-${{ hashFiles('**/mix.lock') }} | ||
|
||
- name: Cache compiled code | ||
id: cache-build | ||
uses: actions/cache@v3 | ||
with: | ||
path: _build | ||
key: ${{ runner.os }}-mixbuild-${{ env.GITHUB_SHA_SHORT }} | ||
|
||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.KEY_TO_ACCESS_SATELLITE_JS_PROTO }} | ||
|
||
- run: make pretest_compile | ||
|
||
- run: mix coveralls.lcov | ||
env: | ||
MIX_ENV: test | ||
|
||
- name: Report code coverage | ||
uses: zgosalvez/github-actions-report-lcov@v1 | ||
with: | ||
coverage-files: cover/lcov.info | ||
artifact-name: code-coverage-report | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Dialyzer | ||
run: make dialyzer | ||
|
||
- run: make check-format | ||
|
||
e2e_tests: | ||
|
@@ -78,7 +107,10 @@ jobs: | |
env: | ||
VAXINE_IMAGE: europe-docker.pkg.dev/vaxine/vaxine-io/vaxine:latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Inject slug/short variables | ||
uses: rlespinasse/github-slug-action@v4 | ||
- name: Log in to the Container registry | ||
|
@@ -87,19 +119,30 @@ jobs: | |
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
deps | ||
_build | ||
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-mix | ||
- uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: "24.3" | ||
elixir-version: "1.13" | ||
|
||
- name: Try to reuse cached deps | ||
id: cache-deps | ||
uses: actions/cache@v3 | ||
with: | ||
path: deps | ||
key: ${{ runner.os }}-mixdeps-${{ hashFiles('**/mix.lock') }} | ||
|
||
- name: Cache compiled code | ||
id: cache-build | ||
uses: actions/cache@v3 | ||
with: | ||
path: _build | ||
key: ${{ runner.os }}-mixbuild-${{ env.GITHUB_SHA_SHORT }} | ||
|
||
- run: make docker-build-ci | ||
env: | ||
ELECTRIC_IMAGE_NAME: ghcr.io/${{ github.repository }}/electric | ||
ELECTRIC_IMAGE_TAG: ${{ env.GITHUB_HEAD_REF_SLUG || 'main' }} | ||
|
||
ELECTRIC_IMAGE_TAG: ${{ env.GITHUB_SHA_SHORT || 'main' }} | ||
- run: make pretest_compile | ||
- run: make lux | ||
working-directory: integration_tests | ||
|
||
|
@@ -112,6 +155,9 @@ jobs: | |
- run: make test | ||
id: tests | ||
working-directory: integration_tests | ||
env: | ||
ELECTRIC_IMAGE_NAME: ghcr.io/${{ github.repository }}/electric | ||
ELECTRIC_IMAGE_TAG: ${{ env.GITHUB_SHA_SHORT || 'main' }} | ||
|
||
- name: Upload lux logs | ||
uses: actions/upload-artifact@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.