-
Notifications
You must be signed in to change notification settings - Fork 1
APP-23838: Integration tests using real db #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fa1beb5
APP-23838: Integration tests using real db
94f91f8
Integration tests using real db
96dd24d
Integration tests using real db
8a36aba
Update action.yml
96cb181
Update action.yml
644eb1f
APP-23838: Integration tests using real db
c0d9ae9
Rename testing action
c616277
add redis_url
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,41 @@ | ||
| name: 'Testing' | ||
|
|
||
| inputs: | ||
| npm_token: | ||
| description: 'npm_token' | ||
| required: true | ||
| node_v: | ||
| type: string | ||
| required: false | ||
| default: "12.14.1" | ||
| redis_url: | ||
| type: string | ||
| required: false | ||
| db_url: | ||
| type: string | ||
| required: false | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| persist-credentials: false | ||
| - name: setup node | ||
| uses: actions/setup-node@master | ||
| with: | ||
| node-version: ${{ inputs.node_v }} | ||
|
|
||
| # install application dependencies | ||
| - uses: c-hive/gha-npm-cache@v1 | ||
| - name: Install Dependencies | ||
| shell: bash | ||
| run: npm install | ||
| - name: Run tests | ||
| shell: bash | ||
| env: | ||
| REDIS_URL: ${{ inputs.redis_url }} | ||
| DB_URL: ${{ inputs.db_url }} | ||
| run: | | ||
| env IS_LOCAL_LOG=true npm run test |
This file contains hidden or 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,52 @@ | ||
| name: Node testing with DB and Redis workflow | ||
|
|
||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| NPM_TOKEN: | ||
| required: true | ||
| inputs: | ||
| node_v: | ||
| type: string | ||
| required: false | ||
| default: "12.14.1" | ||
| env: | ||
| ## Sets environment variable | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| NODE_OPTIONS: "--max-old-space-size=4096" | ||
|
|
||
| jobs: | ||
| testing: | ||
| # The type of runner that the job will run on | ||
| # Containers must run in Linux based operating systems | ||
| runs-on: app_backend | ||
|
|
||
| container: node:${{ inputs.node_v }} | ||
|
|
||
| # Service containers to add` | ||
| services: | ||
| # Label used to access the service container | ||
| redis: | ||
| image: redis | ||
| # Set health checks to wait until redis has started | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| mysql: | ||
| image: mysql:5.7 | ||
| ports: | ||
| - 3306:3306 | ||
| env: | ||
| MYSQL_ROOT_PASSWORD: '1234' | ||
| # Steps represent a sequence of tasks that will be executed as part of the job | ||
| steps: | ||
| - name: Testing | ||
| uses: totango/shared-github-actions/.github/actions/testing@main | ||
| id: image | ||
| with: | ||
| node_v: ${{ inputs.node_v }} | ||
| npm_token: ${{ secrets.NPM_TOKEN }} | ||
| db_url: mysql | ||
| redis_url: redis |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.