1.0.9 • Published 4 years ago
bp-config-sanity-parser v1.0.9
bp-config-sanity-parser-package
A package that parse the configuration and returns the sanity tests package that match the config and the parses config object.
This package expose config-sanity-parser
class that get the configuration and returns the results.
Take a look at test/ConfigSanityTest.js
for implementation examples.
In order to run the sanity tests, in the services, you need to: 1. install the match sanity test packagages 2. write your configuration with this schema:
- "friends" will run "bp-friends-sanity-package",
- "logger" will run "bp-log-sanity",
- "mongodb" will run "bp-mongo-sanity",
- "sqldb" will run "bp-sqldb-sanity-package"
- "elasticsearch" will run "bp-elastic-sanity"
Elastic
npm i --save bp-elastic-sanity
{
"elasticsearch": {
"connectionString": {
"hosts": ["http://tl-prod-01:9200/", "http://tl-prod-02:9200/", "http://tl-prod-03:9200/"]
},
"types": {
"operationType": "operation",
"fieldType": "field",
"abilityType": "ability"
},
"index": "blackpearl_octavarium"
}
}
Mongo
npm i --save bp-mongo-sanity
{
"mongodb": {
"url": "mongodb://bp-dev-mssql/autoenv",
"collectionsName": ["aliases", "resources"]
}
}
SQL
npm i --save bp-sqldb-sanity
{
"sqldb": {
"connectionString": {
"user": "bpdb",
"password": "bpAdmin",
"server": "bp-dev-mssql",
"database": "autoenv_scheduler"
},
"tablesName":["table1","table2"]
}
}
Http
npm i --save bp-http-sanity
{
"httpRoutes": {
"samurai": {
"url": "http://samurai-integ:8080/api/count/",
"propertyA": "a",
"propertyB": "b"
},
"anotherHttpRoute": {
"url": "http://another-integ:8080/api/count/",
"propertyC": "c"
}
}
}
Installation
$ npm i --save bp-config-sanity-parser-package
Contributing
Just fork this repo and open a pull request when your are ready.
Development capabilities:
Features:
- Testing framework (mocha + chai + mochawesome reporter)
- Linting (eslint)
- Documentation generation (jsdoc + loke-jsdoc-theme)
- Reports and code hosting (webserver)
Gulp tasks:
- default - Runs the default scripts. Currently doesn't run any scripts.
run by typing 'gulp'
- test - Runs the code testing script. Runs the tests inside the test folder.
run by typing 'gulp test'
- lint - Runs the code linting script. Lints the code inside the lib folder.
run by typing 'gulp lint'
- lint:fix - Runs the code linting fix script. Fixes linting errors within the lib folder.
run by typing 'gulp lint:fix'
- lint:fix-specific - Runs the code linting fix specific script. Fixes linting errors within a specific provided file.
run by typing 'gulp lint:fix-specific'
- generate:documentation - Runs the documentation generation script. Generated documentation based on jsdoc comments (in the lib folder) and additional documentation (int the docs folder).
run by typing 'gulp generate:documentation'
- serve - Runs the serve script. Serves all files within the package.
run by typing 'gulp serve'
- clean:reports - Runs the reports cleaning script. Cleans all reports within the package.
run by typing 'gulp clean:reports'
enjoy :)
1.0.9
5 years ago