Skip to content

Commit

Permalink
Added Postman collection, Keploy tests, CI-CD integration, documentai…
Browse files Browse the repository at this point in the history
…on update
  • Loading branch information
himanshu-wedensday committed May 14, 2024
1 parent 35bb3c0 commit 8c94fc9
Show file tree
Hide file tree
Showing 74 changed files with 10,128 additions and 14,760 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@ jobs:
with:
cache: 'yarn'
node-version: ${{ matrix.node-version }}
- name: Install Yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Lint
run: yarn lint
- name: Install keploy
run: curl -O https://raw.githubusercontent.com/keploy/keploy/main/keploy.sh && source keploy.sh
- name: Run Keploy test
run: keploy -c "yarn e2eTest"
- name: Test
run: yarn test
- name: Total Coverage
run: yarn coverage:total
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<p>
An enterprise Mongo-Express REST API built using nodejs showcasing - Testing Strategy, mongoDB sharding, models, a REST API Interface, support for Redis, aggregation queries, aggregation caching, circuit-breakers, slack integration, RBAC, rate limited APIs and multi-container queues and schedulers.
</p>

---

<p>
Expand Down Expand Up @@ -80,6 +79,7 @@ A basic starter for a web app with node, express and mongoose -->
- Autogenerated swagger documentation
- Load testing using k6
- Support for i18n
- Support Keploy Test Integration

## Running Load tests

Expand Down Expand Up @@ -118,7 +118,33 @@ Run the following command to begin seeding
- ./seeders/seed.sh
- yarn start
- open browser to `localhost:9000` (port default to 9000)

## How to Run Tests
### Running Test with Jest
- To run the test using jest use command below

`yarn test`

### Running test with keploy
- Install Keploy using following command
` curl -O https://raw.githubusercontent.com/keploy/keploy/main/keploy.sh && source keploy.sh`
- To record the test with keploy Use the command below.

`keploy record -c 'yarn start'`

- To run the keploy test use following command

`keploy test -c 'yarn e2eTest'`
- To get Test coverage with keploy use command below

`yarn coverage:report`

Note: To run keploy test you must have lima for Mac and WSL for windows.
### Test Coverage
- To get Total coverage which includes unit-test coverage and keploy test coverage use command below:

`yarn coverage:total`

Note: To run keploy test you must have lima for Mac and WSL for windows.
## API Documentation

Once you've to the server started check out the api documentation at [/api-docs](http://localhost:9000/api-docs)
Expand Down
30 changes: 15 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
version: "3"
services:
app:
build:
context: .
args:
ENVIRONMENT_NAME: ${ENVIRONMENT_NAME}
dockerfile: Dockerfile
ports:
- "9000:9000"
env_file:
- .env.local
environment:
- REDIS_DOMAIN=redis
- MONGO_BASE_URI=mongo
depends_on:
- mongo
# app:
# build:
# context: .
# args:
# ENVIRONMENT_NAME: ${ENVIRONMENT_NAME}
# dockerfile: Dockerfile
# ports:
# - "9000:9000"
# env_file:
# - .env.local
# environment:
# - REDIS_DOMAIN=redis
# - MONGO_BASE_URI=mongo
# depends_on:
# - mongo

mongo:
container_name: mongo
Expand Down
Loading

0 comments on commit 8c94fc9

Please sign in to comment.