Skip to content

Commit

Permalink
Cleanup, and run all, integrated.
Browse files Browse the repository at this point in the history
Still gotta actuall use the assignments data in the
ingestion.
  • Loading branch information
wayneseymour committed Sep 1, 2020
1 parent a5f1205 commit cfd0160
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 556 deletions.
8 changes: 4 additions & 4 deletions .ci/Jenkinsfile_coverage
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ kibanaPipeline(timeoutMinutes: 240) {
]) {
workers.base(name: 'coverage-worker', size: 'l', ramDisk: false, bootstrapped: false) {
catchError {
// kibanaTeamAssign.generateCodeOwners('.github/CODEOWNERS', "### Generate CODEOWNERS")
// kibanaCoverage.runTests()
// handleIngestion(TIME_STAMP)
kibanaTeamAssign.generateTeamAssignments("### Generate CODEOWNERS")
kibanaTeamAssign.generateCodeOwners('.github/CODEOWNERS', "### Generate CODEOWNERS")
kibanaCoverage.runTests()
handleIngestion(TIME_STAMP)
// kibanaTeamAssign.generateTeamAssignments("### Generate Team Assignments")
}
handleFail()
}
Expand Down
18 changes: 0 additions & 18 deletions enumerate_paths.sh

This file was deleted.

395 changes: 0 additions & 395 deletions src/dev/code_coverage/ingest_coverage/__tests__/matching.test.js

This file was deleted.

120 changes: 0 additions & 120 deletions src/dev/code_coverage/ingest_coverage/matching.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
export const enumeratePatterns = (rootPath) => (log) => (patternsMap) => {
const res = [];
const resPush = push(res);
const logNotFound = notFound(log)
const logNotFound = notFound(log);

for (const pattern of patternsMap) {
const [pathPattern, meta] = pattern;
Expand All @@ -53,11 +53,9 @@ export const enumeratePatterns = (rootPath) => (log) => (patternsMap) => {

const pluckMeta = flip2(pluck)(meta);
const [owner, exclusions] = ['coverageOwner', 'excludeFiles'].map(pluckMeta);
const creeper = (x) => creepFsSync(x, [], rootPath, owner, exclusions);

return function creepAllAsGlobs (pathPattern) {

const creeper = (x) => creepFsSync(x, [], rootPath, owner, exclusions);

return prokGlob(pathPattern)
.map(creeper)
.filter(dropEmpty);
Expand All @@ -72,18 +70,18 @@ function creepFsSync (dir, xs, rootPath, owner, exclusions) {
const trimRoot = trim(rootPath);
const aJoined = joinRoot(dir);
const isADir = isDir(aJoined);
const entries = isADir ? readdirSync(joinRoot(dir)) : [dir];

entries.forEach((entry) => {
(isADir ? readdirSync(joinRoot(dir)) : [dir])
.forEach(maybeRecurse);

return xs;

function maybeRecurse (entry) {
const full = isADir ? join(dir, entry) : entry;

if (statSync(full).isDirectory() && !isBlackListedDir(full)) {
if (statSync(full).isDirectory() && !isBlackListedDir(full))
xs = creepFsSync(full, xs, rootPath, owner, exclusions);
} else {
if (isWhiteListedFile(full) && !isExcluded(full, exclusions))
xs.push(`${trimRoot(full)} ${owner}`);
}
});

return xs;
else if (isWhiteListedFile(full) && !isExcluded(full, exclusions))
xs.push(`${trimRoot(full)} ${owner}`);
}
}
6 changes: 2 additions & 4 deletions src/dev/code_coverage/ingest_coverage/transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import * as Either from './either';
import { fromNullable, just } from './maybe';
import { always, id, noop } from './utils';
import { exactMatch, rootMatch, isGlob, globMatch } from './matching';

const maybeTotal = (x) => (x === 'total' ? Either.left(x) : Either.right(x));

Expand Down Expand Up @@ -99,10 +98,9 @@ export const coveredFilePath = (obj) => {
};

export const teamAssignment = (teamAssignments) => (obj) => {
const name = rootMatch(2)(teamAssignments)(obj);

console.log(`\n### teamAssignments: \n\t${teamAssignments}`);
return {
team: name,
team: '### Write something to grep the assignments :)',
...obj,
};
};
Expand Down
2 changes: 1 addition & 1 deletion src/dev/code_coverage/shell_scripts/ingest_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export DELAY
TEAM_ASSIGN_PATH=src/dev/code_coverage/ingest_coverage/team_assignment/team_assignments.txt

# Build team assignments dat file
node scripts/generate_team_assignments.js --dest $TEAM_ASSIGN_PATH
node scripts/generate_team_assignments.js --verbose --dest $TEAM_ASSIGN_PATH

for x in jest functional; do
echo "### Ingesting coverage for ${x}"
Expand Down
2 changes: 2 additions & 0 deletions vars/kibanaTeamAssign.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def generateTeamAssignments(title) {
# Build team assignments dat file
node scripts/generate_team_assignments.js --dest src/dev/code_coverage/ingest_coverage/team_assignment/team_assignments.txt
cat src/dev/code_coverage/ingest_coverage/team_assignment/team_assignments.txt
""", title)
}

Expand Down

0 comments on commit cfd0160

Please sign in to comment.