@zohodesk/testinglibrary 0.1.8-eslint-25 → 0.1.8-eslint-27
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.
|
@@ -26,5 +26,5 @@ function showMsgPopUp(condition) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
function getPopupJarPath() {
|
|
29
|
-
return _path.default.resolve(
|
|
29
|
+
return _path.default.resolve(__dirname, 'java-jar', 'IDEMessagePluginRecent.jar');
|
|
30
30
|
}
|
|
@@ -24,7 +24,7 @@ function getSummaryOfLint(cliParams) {
|
|
|
24
24
|
}
|
|
25
25
|
return {
|
|
26
26
|
projectName: $projectName,
|
|
27
|
-
reportUrl: `https://serverlinter-np.zohodesk.csez.zohocorpin.com/project/issues?id=${$projectName}&
|
|
27
|
+
reportUrl: `https://serverlinter-np.zohodesk.csez.zohocorpin.com/project/issues?id=${$projectName}&resolved=false`,
|
|
28
28
|
jsonReportPath: (0, _eslintLintStage.getReportPath)().toString()
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -9,7 +9,6 @@ exports.getProjectNameFrmGit = getProjectNameFrmGit;
|
|
|
9
9
|
exports.getSpawnOutput = getSpawnOutput;
|
|
10
10
|
exports.runSonarAnalysis = runSonarAnalysis;
|
|
11
11
|
var _path = _interopRequireDefault(require("path"));
|
|
12
|
-
var _fs = _interopRequireDefault(require("fs"));
|
|
13
12
|
var _child_process = require("child_process");
|
|
14
13
|
var _eslintLintStage = require("./eslintLintStage");
|
|
15
14
|
var _cliArgsToObject = require("../utils/cliArgsToObject");
|
|
@@ -43,19 +42,17 @@ function runSonarAnalysis(cliParams) {
|
|
|
43
42
|
} = getCredentials(login, password);
|
|
44
43
|
var project_name = repo && branch && branch ? `${repo}_${branch}_${username}` : 'UAT_Testing';
|
|
45
44
|
if (lintEnv === 'pre-commit') {
|
|
46
|
-
project_name = getProjectNameFrmGit()
|
|
45
|
+
project_name = `${getProjectNameFrmGit()}_pre-commit`;
|
|
47
46
|
}
|
|
48
|
-
console.log(filterSpecAndFeatureFiles((0, _eslintLintStage.getDiffFiles)(require((0, _eslintLintStage.getDiffJsonPath)(diffPath)))));
|
|
49
47
|
var resultFilesPath = diffPath ? (_filterSpecAndFeature = filterSpecAndFeatureFiles((0, _eslintLintStage.getDiffFiles)(require((0, _eslintLintStage.getDiffJsonPath)(diffPath))))) === null || _filterSpecAndFeature === void 0 ? void 0 : _filterSpecAndFeature.stepFilesPath.join(',') : [`${_path.default.resolve(process.cwd(), 'uat', 'modules')}`].join(',');
|
|
50
|
-
|
|
48
|
+
var source_directories = diffPath ? (_filterSpecAndFeature2 = filterSpecAndFeatureFiles((0, _eslintLintStage.getDiffFiles)(require((0, _eslintLintStage.getDiffJsonPath)(diffPath))))) === null || _filterSpecAndFeature2 === void 0 ? void 0 : _filterSpecAndFeature2.featureFilesPath : [' '];
|
|
51
49
|
if (lintEnv == 'pre-commit') {
|
|
52
50
|
resultFilesPath = filterSpecAndFeatureFiles((0, _eslintLintStage.gitDiffFiles)()).stepFilesPath.join(',');
|
|
53
51
|
}
|
|
54
52
|
if (lintEnv == 'pre-commit') {
|
|
55
53
|
source_directories = filterSpecAndFeatureFiles((0, _eslintLintStage.gitDiffFiles)()).featureFilesPath.join(',');
|
|
56
54
|
}
|
|
57
|
-
const command = ['-jar', sonar_scanner_path, `-Dsonar.host.url=${sonarqube_host_url}`, `-Dsonar.projectKey=${project_name}`, `-Dsonar.login=${Dlogin}`, `-Dsonar.password=${Dpassword}`, `-Dsonar.sources=${source_directories
|
|
58
|
-
console.log(command);
|
|
55
|
+
const command = ['-jar', sonar_scanner_path, `-Dsonar.host.url=${sonarqube_host_url}`, `-Dsonar.projectKey=${project_name}`, `-Dsonar.login=${Dlogin}`, `-Dsonar.password=${Dpassword}`, `-Dsonar.sources=${source_directories}`, `-Dsonar.tests=${resultFilesPath}`, '-Dsonar.language=js', `-Dsonar.working.directory=${getSonarArtifactsDir()}`, `-Dsonar.eslint.reportPaths=${(0, _eslintLintStage.getReportPath)()}`, '-Dsonar.javascript.lcov.reportPaths=coverage/lcov-report/lcov.info'];
|
|
59
56
|
const child_process = (0, _child_process.spawn)('java', command);
|
|
60
57
|
child_process.stdout.on('data', data => {
|
|
61
58
|
_logger.Logger.log(_logger.Logger.SUCCESS_TYPE, data);
|
|
@@ -110,10 +107,13 @@ function getRepoName() {
|
|
|
110
107
|
return repoName.pop().split('/').pop().split('.')[0];
|
|
111
108
|
}
|
|
112
109
|
function getBranchName() {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
var branchName = getSpawnOutput('git', ['branch']); // to get current branch
|
|
111
|
+
branchName = branchName.filter($branch => {
|
|
112
|
+
if ($branch.startsWith('*') || $branch.includes('*')) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
}).shift();
|
|
117
117
|
return branchName.trim();
|
|
118
118
|
}
|
|
119
119
|
function getSpawnOutput(command, params = []) {
|
package/build/utils/rootPath.js
CHANGED
|
@@ -47,7 +47,7 @@ function getExecutableBinaryPath(command) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
function getSonarJarPath() {
|
|
50
|
-
const jarPath = _path.default.resolve(
|
|
50
|
+
const jarPath = _path.default.resolve(__dirname, '..', 'lint-ci', 'java-jar', 'sonar-scanner-cli-4.8.0.2856.jar');
|
|
51
51
|
if ((0, _fileUtils.checkIfFileExists)(jarPath)) {
|
|
52
52
|
return jarPath;
|
|
53
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/testinglibrary",
|
|
3
|
-
"version": "0.1.8-eslint-
|
|
3
|
+
"version": "0.1.8-eslint-27",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"@babel/polyfill": "7.12.1",
|
|
51
51
|
"@babel/preset-env": "7.22.15",
|
|
52
52
|
"@babel/runtime": "7.22.15",
|
|
53
|
-
"commander": "^11.0.0"
|
|
54
|
-
"sonarqube-scanner": "^3.3.0"
|
|
53
|
+
"commander": "^11.0.0"
|
|
55
54
|
}
|
|
56
55
|
}
|