-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding a coverage workflow * Ignoring test coverage artifacts * Installing istanbul and wireit commands * Fixed --workspace parameter * Must use CONTEXT from "@realm/integration-tests" * Updated the package-lock.json * Adjusting timeouts and reporter * Update pr-coverage.yml * Using docker image to increase speed * Adding a wait-on the server * Authenticate docker to pull the server * Disabling app reuse now that we're running against docker * Moved ignore of coverage artifacts to the root * Instrumenting SDK for coverage * Documented reuseApp context variable * Removed unneeded "source-map-support"
- Loading branch information
1 parent
0f5c45c
commit 2ba48d3
Showing
10 changed files
with
1,118 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Test Coverage | ||
on: ["push", "pull_request"] | ||
|
||
concurrency: | ||
group: ${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
REALM_DISABLE_ANALYTICS: 1 | ||
MOCHA_TIMEOUT: 60000 # 1 minute | ||
LONG_TIMEOUT: 300000 # 5 minutes | ||
SERVER_TAG: latest | ||
# REALM_BASE_URL: ${{ secrets.REALM_QA_BASE_URL }} | ||
# REALM_PUBLIC_KEY: ${{ secrets.ATLAS_QA_PUBLIC_API_KEY }} | ||
# REALM_PRIVATE_KEY: ${{ secrets.ATLAS_QA_PRIVATE_API_KEY }} | ||
|
||
jobs: | ||
run: | ||
name: Build and tests with coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: "recursive" | ||
|
||
- name: Setup node version | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: npm | ||
|
||
- name: Setup Wireit cache | ||
uses: google/wireit@setup-github-actions-caching/v1 | ||
|
||
- name: Environment setup | ||
run: sudo apt-get install ccache ninja-build | ||
|
||
- name: ccache | ||
uses: hendrikmuhs/ccache-action@v1 | ||
with: | ||
key: coverage | ||
max-size: '2.0G' | ||
|
||
- name: Docker Login | ||
uses: azure/docker-login@v1 | ||
with: | ||
login-server: ghcr.io | ||
username: realm-ci | ||
password: ${{ secrets.REALM_CI_GITHUB_API_KEY }} | ||
|
||
- name: Start server | ||
run: docker run --detach --env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY --publish 9090:9090 ghcr.io/realm/ci/mongodb-realm-test-server:${{ env.SERVER_TAG }} | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.BAAS_AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.BAAS_AWS_SECRET_ACCESS_KEY }} | ||
|
||
- name: Install dependencies | ||
# Ignoring scripts to prevent a prebuilt from getting fetched / built | ||
run: npm ci --ignore-scripts | ||
|
||
- name: Wait for the server to start | ||
run: npx wait-on http://localhost:9090 | ||
|
||
- name: Run tests with coverage | ||
timeout-minutes: 60 | ||
env: | ||
CONTEXT: syncLogLevel=warn,longTimeout=${{ env.LONG_TIMEOUT }},reuseApp=false | ||
# CONTEXT: syncLogLevel=warn,longTimeout=${{ env.LONG_TIMEOUT }},realmBaseUrl=${{ secrets.REALM_QA_BASE_URL }},mongodbClusterName=${{ secrets.ATLAS_QA_DAILY_CLUSTER_NAME }},privateKey=${{ secrets.ATLAS_QA_PRIVATE_API_KEY }},publicKey=${{ secrets.ATLAS_QA_PUBLIC_API_KEY }} | ||
run: npm run ci:coverage --workspace @realm/integration-tests -- --reporter mocha-github-actions-reporter --timeout ${{ env.MOCHA_TIMEOUT }} | ||
|
||
- name: Coveralls | ||
uses: coverallsapp/github-action@v2 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
realm-apps | ||
realm-apps/ |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "@istanbuljs/nyc-config-typescript", | ||
"all": true, | ||
"cwd": "../..", | ||
"include": [ | ||
"packages/realm/src/**" | ||
] | ||
} |
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.