Skip to content

Commit

Permalink
Merge pull request #265 from zowe/chore/rename-ze-repo
Browse files Browse the repository at this point in the history
Rename ZE repo and update coverage config
  • Loading branch information
zFernand0 authored Apr 9, 2024
2 parents 696cf7c + 7bd36a7 commit a74f92d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 44 deletions.
61 changes: 23 additions & 38 deletions coverage-config.yaml
Original file line number Diff line number Diff line change
@@ -1,65 +1,50 @@
projects:
"zowe/perf-timing":
unit:
junit-artifact: perf-timing.yml/ubuntu-latest-18.x-results/unit/junit
lcov-artifact: perf-timing.yml/ubuntu-latest-18.x-results/unit/coverage
"zowe/imperative":
unit:
junit-artifact: imperative.yml/ubuntu-latest-18.x-results/unit/junit
lcov-artifact: imperative.yml/ubuntu-latest-18.x-results/unit/coverage
integration:
junit-artifact: imperative.yml/ubuntu-latest-18.x-results/integration/junit
system:
test-count: npm-jest
"zowe/zowe-cli":
unit:
junit-artifact: zowe-cli.yml/ubuntu-latest-18.x-results/unit
lcov-artifact: zowe-cli.yml/ubuntu-latest-18.x-results/unit/coverage
junit-artifact: zowe-cli.yml/ubuntu-latest-20.x-results/unit
lcov-artifact: zowe-cli.yml/ubuntu-latest-20.x-results/unit/coverage
integration:
junit-artifact: zowe-cli.yml/ubuntu-latest-18.x-results/integration
junit-artifact: zowe-cli.yml/ubuntu-latest-20.x-results/integration
system:
test-count: npm-jest
"zowe/zowe-cli-cics-plugin":
unit:
junit-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/unit
lcov-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/unit/coverage
"zowe/cics-for-zowe-client#main":
unit-cli:
junit-artifact: main.yml/ubuntu-latest-20.x-results/cli/__tests__/__results__/unit
lcov-artifact: main.yml/ubuntu-latest-20.x-results/cli/__tests__/__results__/unit/coverage
unit-sdk:
junit-artifact: main.yml/ubuntu-latest-20.x-results/sdk/__tests__/__results__/unit
lcov-artifact: main.yml/ubuntu-latest-20.x-results/sdk/__tests__/__results__/unit/coverage
unit-vsce:
junit-artifact: main.yml/ubuntu-latest-20.x-results/vsce/__tests__/__results__/unit
system:
test-count: npm-jest
test-count: npm-jest:packages/cli:packages/sdk
"zowe/zowe-cli-db2-plugin":
unit:
junit-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/unit
lcov-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/unit/coverage
junit-artifact: zowe-cli-plugin.yml/ubuntu-latest-20.x-results/unit
lcov-artifact: zowe-cli-plugin.yml/ubuntu-latest-20.x-results/unit/coverage
system:
test-count: npm-jest
"zowe/zowe-cli-ftp-plugin":
unit:
junit-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/unit
lcov-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/unit/coverage
system:
test-count: npm-jest
"zowe/zowe-cli-ims-plugin":
unit:
junit-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/unit
lcov-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/unit/coverage
integration:
junit-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/integration
junit-artifact: zowe-cli-plugin.yml/ubuntu-latest-20.x-results/unit
lcov-artifact: zowe-cli-plugin.yml/ubuntu-latest-20.x-results/unit/coverage
system:
test-count: npm-jest
"zowe/zowe-cli-mq-plugin":
unit:
junit-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/unit
lcov-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/unit/coverage
junit-artifact: zowe-cli-plugin.yml/ubuntu-latest-20.x-results/unit
lcov-artifact: zowe-cli-plugin.yml/ubuntu-latest-20.x-results/unit/coverage
integration:
junit-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/integration
junit-artifact: zowe-cli-plugin.yml/ubuntu-latest-20.x-results/integration
system:
test-count: npm-jest
"zowe/zowe-cli-scs-plugin":
unit:
junit-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/unit
lcov-artifact: zowe-cli-plugin.yml/ubuntu-latest-18.x-results/unit/coverage
junit-artifact: zowe-cli-plugin.yml/ubuntu-latest-20.x-results/unit
lcov-artifact: zowe-cli-plugin.yml/ubuntu-latest-20.x-results/unit/coverage
system:
test-count: npm-jest
"zowe/vscode-extension-for-zowe#main":
"zowe/zowe-explorer-vscode#main":
unit:
junit-artifact: zowe-explorer-ci.yml/zowe-explorer-results/unit
lcov-artifact: zowe-explorer-ci.yml/zowe-explorer-results/unit/coverage
Expand Down
15 changes: 9 additions & 6 deletions scripts/coverage-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,17 @@ async function checkLcovArtifact(repo, type, workflow, artifact, dirname) {
return { lineCoverage, hitLines, foundLines, branchCoverage, hitBranches, foundBranches };
};

async function checkTestCount(repo, type, tools) {
async function checkTestCount(repo, type, tools, ...subDirs) {
const tempDir = await gitCloneDir(repo);
await exec.exec("npm", ["install", "--ignore-scripts", "--silent"], { cwd: tempDir });
const output = await exec.getExecOutput("npm", ["run", `test:${type}`, "--", "--listTests"], { cwd: tempDir });
let numTests = 0;
for (const testFile of output.stdout.trim().split("\n").filter(line => line.includes(tempDir))) {
const testContents = stripComments(fs.readFileSync(testFile, "utf-8"));
numTests += (testContents.match(/\bit\(/g) || []).length;
for (const subDir of (subDirs.length ? subDirs : [""])) {
const output = await exec.getExecOutput("npm", ["run", `test:${type}`, "--", "--listTests"],
{ cwd: path.join(tempDir, subDir) });
for (const testFile of output.stdout.trim().split("\n").filter(line => line.includes(tempDir))) {
const testContents = stripComments(fs.readFileSync(testFile, "utf-8"));
numTests += (testContents.match(/\bit\(/g) || []).length;
}
}
return { numTests };
};
Expand All @@ -132,7 +135,7 @@ async function checkTestCount(repo, type, tools) {
covData = { ...covData, ...await checkLcovArtifact(repoName, testType, ...splitAndAppend(covConfig, "/", 3)) };
break;
case "test-count":
covData = { ...covData, ...await checkTestCount(repoName, testType, covConfig) };
covData = { ...covData, ...await checkTestCount(repoName, testType, ...covConfig.split(":")) };
break;
default:
throw new Error("Unsupported coverage type " + covType);
Expand Down

0 comments on commit a74f92d

Please sign in to comment.