@itentialopensource/adapter-db_mysql 0.1.16 → 0.2.1
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/.eslintignore +1 -0
- package/AUTH.md +25 -0
- package/CALLS.md +40 -0
- package/CHANGELOG.md +16 -0
- package/CODE_OF_CONDUCT.md +12 -17
- package/CONTRIBUTING.md +3 -148
- package/ENHANCE.md +28 -0
- package/PROPERTIES.md +111 -0
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +22 -0
- package/TAB1.md +11 -0
- package/TAB2.md +73 -0
- package/TROUBLESHOOT.md +28 -0
- package/changelogs/changelog.md +104 -0
- package/compliance-report.json +9 -0
- package/compliance-report.txt +5 -0
- package/error.json +12 -0
- package/metadata.json +90 -0
- package/package.json +22 -25
- package/propertiesDecorators.json +14 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/sampleProperties.json +1 -3
- package/test/unit/adapterTestUnit.js +28 -16
- package/utils/adapterInfo.js +206 -0
- package/utils/artifactize.js +1 -1
- package/utils/packModificationScript.js +1 -1
- package/utils/removeHooks.js +20 -0
- package/utils/testRunner.js +17 -17
- package/workflows/README.md +0 -3
- package/workflows/mysql-test1.json +0 -1
package/utils/testRunner.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/* @copyright Itential, LLC 2019 */
|
|
3
3
|
|
|
4
|
+
const execute = require('child_process').exec;
|
|
4
5
|
const fs = require('fs-extra');
|
|
5
6
|
const rl = require('readline-sync');
|
|
6
|
-
const execute = require('child_process').exec;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* This script will determine the type of integration test to run
|
|
@@ -47,11 +47,11 @@ function replaceTestVars(test) {
|
|
|
47
47
|
let intTest = fs.readFileSync(test, 'utf8');
|
|
48
48
|
|
|
49
49
|
// replace stub variable but check if it exists first
|
|
50
|
-
let sindex = intTest.indexOf('
|
|
50
|
+
let sindex = intTest.indexOf('samProps.stub');
|
|
51
51
|
let eindex = intTest.indexOf(';', sindex);
|
|
52
52
|
let replStr = intTest.substring(sindex, eindex + 1);
|
|
53
53
|
if (sindex > -1) {
|
|
54
|
-
intTest = intTest.replace(replStr, `
|
|
54
|
+
intTest = intTest.replace(replStr, `samProps.stub = ${stub};`);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
// replace isRapidFail variable but check if it exists first
|
|
@@ -71,46 +71,46 @@ function replaceTestVars(test) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// replace host variable
|
|
74
|
-
sindex = intTest.indexOf('
|
|
74
|
+
sindex = intTest.indexOf('samProps.host');
|
|
75
75
|
eindex = intTest.indexOf(';', sindex);
|
|
76
76
|
replStr = intTest.substring(sindex, eindex + 1);
|
|
77
|
-
intTest = intTest.replace(replStr, `
|
|
77
|
+
intTest = intTest.replace(replStr, `samProps.host = '${host}';`);
|
|
78
78
|
|
|
79
79
|
// replace username variable
|
|
80
|
-
sindex = intTest.indexOf('
|
|
80
|
+
sindex = intTest.indexOf('samProps.authentication.username');
|
|
81
81
|
eindex = intTest.indexOf(';', sindex);
|
|
82
82
|
replStr = intTest.substring(sindex, eindex + 1);
|
|
83
|
-
intTest = intTest.replace(replStr, `
|
|
83
|
+
intTest = intTest.replace(replStr, `samProps.authentication.username = '${username}';`);
|
|
84
84
|
|
|
85
85
|
// replace password variable
|
|
86
|
-
sindex = intTest.indexOf('
|
|
86
|
+
sindex = intTest.indexOf('samProps.authentication.password');
|
|
87
87
|
eindex = intTest.indexOf(';', sindex);
|
|
88
88
|
replStr = intTest.substring(sindex, eindex + 1);
|
|
89
|
-
intTest = intTest.replace(replStr, `
|
|
89
|
+
intTest = intTest.replace(replStr, `samProps.authentication.password = '${password}';`);
|
|
90
90
|
|
|
91
91
|
// replace protocol variable
|
|
92
|
-
sindex = intTest.indexOf('
|
|
92
|
+
sindex = intTest.indexOf('samProps.protocol');
|
|
93
93
|
eindex = intTest.indexOf(';', sindex);
|
|
94
94
|
replStr = intTest.substring(sindex, eindex + 1);
|
|
95
|
-
intTest = intTest.replace(replStr, `
|
|
95
|
+
intTest = intTest.replace(replStr, `samProps.protocol = '${protocol}';`);
|
|
96
96
|
|
|
97
97
|
// replace port variable
|
|
98
|
-
sindex = intTest.indexOf('
|
|
98
|
+
sindex = intTest.indexOf('samProps.port');
|
|
99
99
|
eindex = intTest.indexOf(';', sindex);
|
|
100
100
|
replStr = intTest.substring(sindex, eindex + 1);
|
|
101
|
-
intTest = intTest.replace(replStr, `
|
|
101
|
+
intTest = intTest.replace(replStr, `samProps.port = ${port};`);
|
|
102
102
|
|
|
103
103
|
// replace sslenable variable
|
|
104
|
-
sindex = intTest.indexOf('
|
|
104
|
+
sindex = intTest.indexOf('samProps.ssl.enabled');
|
|
105
105
|
eindex = intTest.indexOf(';', sindex);
|
|
106
106
|
replStr = intTest.substring(sindex, eindex + 1);
|
|
107
|
-
intTest = intTest.replace(replStr, `
|
|
107
|
+
intTest = intTest.replace(replStr, `samProps.ssl.enabled = ${sslenable};`);
|
|
108
108
|
|
|
109
109
|
// replace sslinvalid variable
|
|
110
|
-
sindex = intTest.indexOf('
|
|
110
|
+
sindex = intTest.indexOf('samProps.ssl.accept_invalid_cert');
|
|
111
111
|
eindex = intTest.indexOf(';', sindex);
|
|
112
112
|
replStr = intTest.substring(sindex, eindex + 1);
|
|
113
|
-
intTest = intTest.replace(replStr, `
|
|
113
|
+
intTest = intTest.replace(replStr, `samProps.ssl.accept_invalid_cert = ${sslinvalid};`);
|
|
114
114
|
|
|
115
115
|
console.log(`Updates to ${test} complete`);
|
|
116
116
|
fs.writeFileSync(test, intTest);
|
package/workflows/README.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"mysql-test1","tasks":{"9711":{"name":"select","summary":"","description":"","location":"Adapter","locationType":"MySQL","app":"MySQL","displayName":"MySQL","type":"automatic","variables":{"incoming":{"sql":"SELECT * FROM Dogs;","adapter_id":"db_mysql"},"outgoing":{"result":null},"error":""},"deprecated":false,"matched":[],"groups":[],"actor":"Pronghorn","x":0.37222222222222223,"y":0.4584103512014787,"scheduled":false},"workflow_start":{"name":"workflow_start","groups":[],"x":0,"y":0.5},"workflow_end":{"name":"workflow_end","groups":[],"x":1,"y":0.5},"4dfc":{"name":"update","summary":"update item into MySQL server.","description":"update item into MySQL server.","location":"Adapter","locationType":"MySQL","app":"MySQL","displayName":"MySQL","type":"automatic","variables":{"incoming":{"sql":"UPDATE Dogs SET Name=\"dogs001\" WHERE DogID=1;","adapter_id":"db_mysql"},"outgoing":{"result":null},"error":""},"deprecated":false,"matched":[],"groups":[],"actor":"Pronghorn","x":0.55,"y":0.25693160813308685,"scheduled":false},"9d3f":{"name":"delete","summary":"delete item from MySQL server.","description":"delete item from MySQL server.","location":"Adapter","locationType":"MySQL","app":"MySQL","displayName":"MySQL","type":"automatic","variables":{"incoming":{"sql":"DELETE FROM Dogs WHERE DogID=1;","adapter_id":"db_mysql"},"outgoing":{"result":null},"error":""},"deprecated":false,"matched":[],"groups":[],"actor":"Pronghorn","x":0.5537037037037037,"y":0.7301293900184843,"scheduled":false},"e077":{"name":"create","summary":"create a table into MySQL server.","description":"create a table into MySQL server.","location":"Adapter","locationType":"MySQL","app":"MySQL","displayName":"MySQL","type":"automatic","variables":{"incoming":{"sql":"CREATE TABLE Dogs (DogID int, Name varchar(255));","adapter_id":"db_mysql"},"outgoing":{"result":null},"error":""},"deprecated":false,"matched":[],"groups":[],"actor":"Pronghorn","x":0.1648148148148148,"y":0.29390018484288355,"scheduled":false},"f00d":{"name":"insert","summary":"insert item into MySQL server.","description":"insert item into MySQL server.","location":"Adapter","locationType":"MySQL","app":"MySQL","displayName":"MySQL","type":"automatic","variables":{"incoming":{"sql":"INSERT INTO Dogs (DogID, Name) VALUES (1, \"dog001\");","adapter_id":"db_mysql"},"outgoing":{"result":null},"error":""},"deprecated":false,"matched":[],"groups":[],"actor":"Pronghorn","x":0.1787037037037037,"y":0.6136783733826248,"scheduled":false},"e4e8":{"name":"drop","summary":"drop table from MySQL server.","description":"drop table from MySQL server.","location":"Adapter","locationType":"MySQL","app":"MySQL","displayName":"MySQL","type":"automatic","variables":{"incoming":{"sql":"DROP TABLE Dogs;","adapter_id":"db_mysql"},"outgoing":{"result":null},"error":""},"deprecated":false,"matched":[],"groups":[],"actor":"Pronghorn","x":0.7814814814814814,"y":0.4787430683918669,"scheduled":false}},"transitions":{"9711":{"4dfc":{"type":"standard","state":"success"}},"workflow_start":{"e077":{"type":"standard","state":"success"}},"workflow_end":{},"4dfc":{"9d3f":{"type":"standard","state":"success"}},"9d3f":{"e4e8":{"type":"standard","state":"success"}},"e077":{"f00d":{"type":"standard","state":"success"}},"f00d":{"9711":{"type":"standard","state":"success"}},"e4e8":{"workflow_end":{"type":"standard","state":"success"}}},"font_size":12,"created":"2019-11-14T20:50:06.537Z","created_by":{"provenance":"Local AAA","username":"admin@pronghorn","firstname":"admin","inactive":false,"email":""},"groups":[],"last_updated":"2019-11-15T21:18:48.929Z","last_updated_by":{"provenance":"Local AAA","username":"admin@pronghorn","firstname":"admin","inactive":false,"email":""},"type":"automation","description":null}
|