-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(integration-tests): Setup integration tests (#85)
* feat(integration-tests): Setup integration tests * test(integration-tests): Update action to run integration tests * test(integration-tests): Fix pipeline * test(integration-tests): Fix tests * fix(integration-tests): Remove cwd * test(integration-tests): Update config
- Loading branch information
Showing
14 changed files
with
1,175 additions
and
14 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.jest-cache/* | ||
.jest-coverage/* | ||
node_modules/* | ||
integration-tests/* | ||
|
||
**/dist/* | ||
**/node_modules/* | ||
|
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 |
---|---|---|
|
@@ -10,6 +10,9 @@ on: | |
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [14.x, 15., 16.x] | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
@@ -22,13 +25,54 @@ jobs: | |
fetch-depth: 0 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v2.4.1 | ||
uses: actions/setup-node@v3.1.1 | ||
with: | ||
node-version: "14" | ||
cache: "npm" | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: 'npm install' | ||
run: npm install | ||
|
||
- name: 'run unit tests' | ||
run: npm run test | ||
|
||
integration-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [14.x, 15., 16.x] | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: medusa-extender | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: 'prepare packages and install' | ||
run: | | ||
npm i && npm run build && npm pack --pack-destination integration-tests && PACKAGE_NAME=$(cat package.json | grep version | head -1 | awk -F: '{ print "medusa-extender-", $2, ".tgz" }' | sed 's/[ ",]//g') && cd integration-tests && npm i ${PACKAGE_NAME} && npm i | ||
- name: 'run integration tests' | ||
run: cd integration-tests && npm run test:integration | ||
env: | ||
DB_PASSWORD: postgres | ||
IS_CI: true |
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,9 @@ | ||
dist | ||
node_modules | ||
tsconfig.tsbuildinfo | ||
|
||
.env | ||
.env.local | ||
.env.test | ||
|
||
package-lock.json |
Oops, something went wrong.