@mojaloop/ml-testing-toolkit-client-lib 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/client.js +3 -3
- package/src/router.js +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.5](https://github.com/mojaloop/ml-testing-toolkit-client-lib/compare/v0.0.4...v0.0.5) (2022-06-06)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* fixed an issue with commander dependancy upgrade ([3c0cdaf](https://github.com/mojaloop/ml-testing-toolkit-client-lib/commit/3c0cdaf78ade5eb8b759251da4a18028c5eacab4))
|
|
11
|
+
|
|
5
12
|
### [0.0.4](https://github.com/mojaloop/ml-testing-toolkit-client-lib/compare/v0.0.3...v0.0.4) (2022-06-06)
|
|
6
13
|
|
|
7
14
|
### [0.0.3](https://github.com/mojaloop/ml-testing-toolkit-client-lib/compare/v0.0.2...v0.0.3) (2022-05-31)
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
* Georgi Logodazhki <georgi.logodazhki@modusbox.com> (Original Author)
|
|
22
22
|
--------------
|
|
23
23
|
******/
|
|
24
|
-
const
|
|
24
|
+
const { program } = require('commander')
|
|
25
25
|
const router = require('./router')
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
program
|
|
28
28
|
.version('1.0.0', '-v, --version')
|
|
29
29
|
.option('-c, --config <config>', 'default configuration: {"mode": "outbound", "reportFormat": "json"}')
|
|
30
30
|
.option('-m, --mode <mode>', 'default: "outbound" --- supported modes: "monitoring", "outbound", "testcaseDefinitionReport"')
|
|
@@ -46,4 +46,4 @@ commander
|
|
|
46
46
|
})
|
|
47
47
|
.parse(process.argv)
|
|
48
48
|
|
|
49
|
-
router.cli(
|
|
49
|
+
router.cli(program.opts())
|
package/src/router.js
CHANGED
|
@@ -28,7 +28,7 @@ const { TraceHeaderUtils } = require('@mojaloop/ml-testing-toolkit-shared-lib')
|
|
|
28
28
|
|
|
29
29
|
const TESTS_EXECUTION_TIMEOUT = 1000 * 60 * 15 // 15min timout
|
|
30
30
|
|
|
31
|
-
const cli = (
|
|
31
|
+
const cli = (commanderOptions) => {
|
|
32
32
|
const configFile = {
|
|
33
33
|
mode: 'outbound',
|
|
34
34
|
reportFormat: 'json',
|
|
@@ -38,26 +38,26 @@ const cli = (commander) => {
|
|
|
38
38
|
breakRunOnError: false
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
if (fs.existsSync(
|
|
42
|
-
const newConfig = JSON.parse(fs.readFileSync(
|
|
41
|
+
if (fs.existsSync(commanderOptions.config)) {
|
|
42
|
+
const newConfig = JSON.parse(fs.readFileSync(commanderOptions.config, 'utf8'))
|
|
43
43
|
_.merge(configFile, newConfig)
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
const config = {
|
|
47
|
-
mode:
|
|
48
|
-
inputFiles:
|
|
49
|
-
logLevel:
|
|
50
|
-
breakRunOnError:
|
|
51
|
-
environmentFile:
|
|
52
|
-
reportFormat:
|
|
53
|
-
reportAutoFilenameEnable:
|
|
54
|
-
reportTarget:
|
|
55
|
-
slackWebhookUrl:
|
|
47
|
+
mode: commanderOptions.mode || configFile.mode,
|
|
48
|
+
inputFiles: commanderOptions.inputFiles,
|
|
49
|
+
logLevel: commanderOptions.logLevel || configFile.logLevel,
|
|
50
|
+
breakRunOnError: commanderOptions.breakRunOnError || configFile.breakRunOnError,
|
|
51
|
+
environmentFile: commanderOptions.environmentFile,
|
|
52
|
+
reportFormat: commanderOptions.reportFormat || configFile.reportFormat,
|
|
53
|
+
reportAutoFilenameEnable: commanderOptions.reportAutoFilenameEnable === 'true' || configFile.reportAutoFilenameEnable === true,
|
|
54
|
+
reportTarget: commanderOptions.reportTarget || configFile.reportTarget,
|
|
55
|
+
slackWebhookUrl: commanderOptions.slackWebhookUrl || configFile.slackWebhookUrl,
|
|
56
56
|
slackPassedImage: configFile.slackPassedImage,
|
|
57
57
|
slackFailedImage: configFile.slackFailedImage,
|
|
58
|
-
baseURL:
|
|
59
|
-
extraSummaryInformation:
|
|
60
|
-
labels:
|
|
58
|
+
baseURL: commanderOptions.baseUrl || configFile.baseURL,
|
|
59
|
+
extraSummaryInformation: commanderOptions.extraSummaryInformation || configFile.extraSummaryInformation,
|
|
60
|
+
labels: commanderOptions.labels || configFile.labels
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
objectStore.set('config', config)
|
|
@@ -88,7 +88,7 @@ const cli = (commander) => {
|
|
|
88
88
|
break
|
|
89
89
|
case 'testcaseDefinitionReport':
|
|
90
90
|
if (config.inputFiles) {
|
|
91
|
-
if (!
|
|
91
|
+
if (!commanderOptions.reportFormat) {
|
|
92
92
|
config.reportFormat = 'printhtml'
|
|
93
93
|
objectStore.set('config', config)
|
|
94
94
|
}
|