https://github.com/jaystack/corp-check-test
e2e tests for corp-check
https://github.com/jaystack/corp-check-test
Last synced: 3 months ago
JSON representation
e2e tests for corp-check
- Host: GitHub
- URL: https://github.com/jaystack/corp-check-test
- Owner: jaystack
- License: mit
- Created: 2017-10-27T09:19:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-12T09:07:51.000Z (almost 7 years ago)
- Last Synced: 2025-01-16T05:55:56.672Z (4 months ago)
- Language: TypeScript
- Size: 67.4 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# corp-check-test
e2e tests for Corp-Check services## Architecture
The e2e tests binding point is the restful api: `corp-check-rest`. Tests are running in composed dokcer containers. The e2e test contains the following services:
- **MongoDB**: It is a basic MongoDB image.
- **RabbitMQ**: It is a basic RabbitMQ image with management tool.
- **Local npm registry**: That mocks the npm registry. Before running tests the test process publishes mock packages into this registry. They are in `registry/packages`. It is not possible to use a package name twice with the same version, because publishing runs only once before running the tests.
- **Search service for npm registry**: That mocks the npm's search service. To define mock scores for a package you should describe a `scores` property into its `package.json`. Examples in `registry/packages/...`
- **Corp-Check rest service**: This image is pulled from the Corp-Check docker registry in aws. The docker tag is provided from the `ENV` parameter (see below).
- **Corp-Check worker service**: This image is pulled from the Corp-Check docker registry in aws. The docker tag is provided from the `ENV` parameter (see below).
- **test process**: This process runs the tests with `jest`. This process consists of two parts: the registry initialization and the jest running. The registry initialization is defined in `registry/init.sh`Every service is defined in `docker-compose.tpl.yml`. This template is manifested by the parameters.
## Parameters
- `ENV`: Value set: `dev`, `stage`, `prod`. That determines that which images should use for `corp-check-rest` and `corp-check-worker`.
- `AWS_CRED_SOURCE`: The `.aws` folder path on the host machine. It is necessary for docker login to pulling the Corp-Check service images.## How to run
The e2e tests also can run as a compact job for CI tools, and they can run in watch mode for developing.
### CI mode
```
sh test.sh
```### Watch mode
```
sh test.sh watch
```Watch mode does not run the `test` process in docker. Instead of that it runs on your local machine in `--watch` mode with jest.