exframe-integration
v1.1.15
Published
A module for all(new/existing) microservices, used to set up development environment, run cucumber automation test cases. It can be easily integrated with existing microservices. It will help developers to set up their microservice development enviroment
Downloads
37
Readme
Exframe integration
A module for all(new/existing) microservices, used to set up development environment, run cucumber automation test cases. It can be easily integrated with existing microservices. It will help developers to set up their microservice development enviroment without worring about all dependencies.
Below are the important features of this module –
- To run automation test cases for our business model.
- To set up local development environment usefull for developers.
- To test and see test test report.
- To up all services, usefull for QA.
- Simple commands to integrate and run.
Prerequisites
Software and Tools:
npm
should be installed.npm --version
node
should be installed.node --version
docker
should be installed.docker --version
docker-compose
should be installed.docker-compose --version
Auth certificate:
Auth certificate should be installed properly in your machine to access local docker images. If it is not installed you will not be able to access all local docker repositories.
In Linux :
Follow below commands to install certificate
sudo mkdir /usr/local/share/ca-certificates/docker-dev-cert/
sudo cp ExzeoDockerHubCA.crt /usr/local/share/ca-certificates/docker-dev-cert/
sudo update-ca-certificates
sudo systemctl reload docker.service
Note Make sure ExzeoDockerHubCA.crt is placed inside your current directory from which you are exexuting the commands. Make sure ExzeoDockerHubCA.crt is placed inside your current directory from which you are exexuting the commands. Computer restart is required.
In Windows :
Please follow below steps :
- Open Windows Explorer, right-click the certificate, and choose Install certificate.
- Then, select the following options: Store location: local machine Check ‘place all certificates in the following store’ Click ‘Browser’, and select ‘Trusted Root Certificate Authorities’ Click ‘Finish’ Learn more about managing TLS certificates After adding the CA certificate to Windows, restart Docker for Windows.
Docker login:
Please make sure you are logged-in in 'docker' in your local machine. Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to Infra team to create new one for you. Please use following command to login :
docker login
Getting started
This section assumes you've working knowledge of Nodejs, npm, [Docker](https://en.wikipedia.org/wiki/Docker_(software) and Docker Compose
There are two scenario where you can use this module
New Project/Microservice using
exframe generator
(Specially for QA):- Install
exframe-generator
globally using below command:npm install exgrame-generator -g
- Create a sample project to run HIT, using below commands
exframe <project-name>
- Travel to your newly created project
cd <project-name>
- Run below command to download the npm package for HIT:
npm install
Upon execution fo above commands your existing service is all set for HIT.
- Install
Existing project/microservice
- Install
exframe-generator
globally using below command:npm install exgrame-generator -g
- Travel to your project directory, from root path, run th following command:
exframe upgrade
- Run below command to download the npm package for HIT:
npm install
Upon execution fo above 1,2,3 commands your existing service is all set for HIT.
- Install
Integration Commands
To start integration process, you need to run only this command :
npm run integration
Once you run above command, a prompt will ask few questions, these are as :
Question 1
Output 1- RUN Local Service with Automation. 2- RUN Local Service without Automation. 3- STOP Containers. 4- REMOVE Containers. 5- UP All Services with automation. 6- UP All Services without automatio.
Below are the description of above options :
1. RUN Local Service with Automatio.
*Specially for a developer who is working on a microservice and he/she wants to achieve below task:
- To set up all its dependent services for local service.
mongo
cfs
etc forpdf-generator
service. - To run
harmony-quality-control
test case on his local service.
2. RUN Local Service without Automation.
*Specially for a developer who is working on a microservice and he/she wants to achieve below task:
- To set up all its dependent services for local service.
mongo
cfs
etc forpdf-generator
service.
Note - This will not run automation test cases, it will only up all dependent containers/services.
3. STOP Containers.
Using this action you can stop all running containers.
4. REMOVE Containers.
To remove all stopped containers using a single command.
Note - Please stop all containers by selecting
3rd option
before performing this action.
5. UP all Services with automation.
This action helps QA guys to set up all containers for all mincro-services from master file, Automation result will be displayed upon successful completion of this action.
Question 2
Output Please enter harmony quality control branch name: (CG-Automation)
Please enter HQC branch name on which you want to run test cases, default value is CG-Automation
Question 3
Output prompt: Please enter harmony quality control model name.: (quoteModel)
Please enter HQC model name which you want on to run while running test cases, default value is quoteModel
.
NOTE: This feature is under developement.
Question 4
Output Do you want to pull latest images ? (True/False): (true)
Use this option to pull latest images from docker local repository. Default value is true
.
Question 5
prompt: Do you want to give other master source of YMLs ? If yes please enter its name: (master.yml)
If you want to use another YML source for master containers, default is master.yml
. Make sure name should be same as remote repository file name.
Troubleshooting
FAQs
I am getting
listen tcp 0.0.0.0:80 bind: address already in use
error Answer : Please stop currently running local service which is accupied 8080 port number. Please use3rd and 4th action
to stop and remove conainers. If problen persist, please follow below steps :- FInd out process id using below command
ps -aux | grep <service-term>
eg.mong
for mongodbpdf
for pdf-generator service - Kill the running process using below command:
sudo kill -9 pid
- FInd out process id using below command
How to list all containers ? Answer : To see all containers and its status use below command :
docker ps
// to list only up containersdocker ps -a
// to list all up and exited containersdocker ps -a -q
// to lis only container ids of up and exited containersHow to stop one or all containers using command ? Answer :Follow below commands :
docker stop $(docker ps -a -q)
// it will stop all stopped and Up containers.docker stop $(docker ps -a)
// It will stop all up containersdocker stop <containerId/containerName>
// it will stop a single containerHow to start one or all containers using command ? Answer :Follow below commands:
docker start $(docker ps -a -q)
// it will start all stopped and Up containers.docker start $(docker ps -a)
// It will start all up containersdocker start <containerId/containerName>
// it will start a single containerHow to remove one or all containers using command ? Answer :Follow below commands :
docker rm $(docker ps -a -q)
// it will remove all stopped and Up containers.docker rm $(docker ps -a)
// It will remove all up containersdocker rm <containerId/containerName>
// it will remove a single container