@itentialopensource/adapter-db_mssql 0.3.0 → 1.0.0
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/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/TROUBLESHOOT.md +28 -0
- package/adapter.js +44 -1
- package/error.json +12 -0
- package/metadata.json +49 -0
- package/package.json +19 -18
- package/pronghorn.json +134 -16
- package/propertiesDecorators.json +14 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/sampleProperties.json +4 -2
- package/test/integration/adapterTestIntegration.js +23 -1
- package/test/unit/adapterTestUnit.js +53 -17
- package/utils/adapterInfo.js +206 -0
- package/utils/artifactize.js +1 -1
- package/utils/packModificationScript.js +2 -2
- package/utils/removeHooks.js +20 -0
- package/utils/testRunner.js +17 -17
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This script will uninstall pre-commit or pre-push hooks in case there's ever a need to
|
|
5
|
+
* commit/push something that has issues
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const precommitPath = '.git/hooks/pre-commit';
|
|
9
|
+
const prepushPath = '.git/hooks/pre-push';
|
|
10
|
+
fs.unlink(precommitPath, (err) => {
|
|
11
|
+
if (err && err.code !== 'ENOENT') {
|
|
12
|
+
console.log(`${err.message}`);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
fs.unlink(prepushPath, (err) => {
|
|
17
|
+
if (err && err.code !== 'ENOENT') {
|
|
18
|
+
console.log(`${err.message}`);
|
|
19
|
+
}
|
|
20
|
+
});
|
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);
|