Skip to content

Commit

Permalink
Add pack download to its own log group
Browse files Browse the repository at this point in the history
Also, make the baseline count message less awkward sounding.
  • Loading branch information
Andrew Eisenberg committed Jun 9, 2021
1 parent 96e7de3 commit a2e96a4
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
EXPECTED_RULES="javascript/example/empty-or-one-block javascript/example/empty-or-one-block javascript/example/two-block"
# use tr to replace newlines with spaces and xargs to trim leading and trailing whitespace
RULES="$(cat javascript-custom.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | xargs)"
RULES="$(cat javascript.sarif | jq -r '.runs[0].results[].ruleId' | sort | tr "\n" " " | xargs)"
echo "Found matching rules '$RULES'"
if [ "$RULES" != "$EXPECTED_RULES" ]; then
echo "Did not match expected rules '$EXPECTED_RULES'."
Expand Down
6 changes: 4 additions & 2 deletions lib/analyze.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/analyze.js.map

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions lib/analyze.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/analyze.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/config-utils.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/config-utils.test.js.map

Large diffs are not rendered by default.

32 changes: 25 additions & 7 deletions src/analyze.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,31 @@ test("status report fields and search path setting", async (t) => {
getRunnerLogger(true)
);
const hasPacks = language in packs;
t.deepEqual(Object.keys(builtinStatusReport).length, hasPacks ? 2 : 1);
t.true(
`analyze_builtin_queries_${language}_duration_ms` in builtinStatusReport
);
t.true(
`interpret_results_${language}_duration_ms` in builtinStatusReport
);
const statusReportKeys = Object.keys(builtinStatusReport).sort();
if (hasPacks) {
t.deepEqual(statusReportKeys.length, 3, statusReportKeys.toString());
t.deepEqual(
statusReportKeys[0],
`analyze_builtin_queries_${language}_duration_ms`
);
t.deepEqual(
statusReportKeys[1],
`analyze_custom_queries_${language}_duration_ms`
);
t.deepEqual(
statusReportKeys[2],
`interpret_results_${language}_duration_ms`
);
} else {
t.deepEqual(
statusReportKeys[0],
`analyze_builtin_queries_${language}_duration_ms`
);
t.deepEqual(
statusReportKeys[1],
`interpret_results_${language}_duration_ms`
);
}

config.queries[language] = {
builtin: [],
Expand Down
Loading

0 comments on commit a2e96a4

Please sign in to comment.