Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename ZE repo and update coverage config #265

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading