Change category uniqueness test
Turboscan only allows a single combination of tool name and automation details id for testing category uniqueness. Previously, the check in the action was not entirely correct since it only looked at the _category_ and not the combination of the category and the tool name. It's even more precise now since it is looking at the actual, computed value of the automation details id, rather than an inputted value of the category. This change also includes a refactoring where the action is now avoiding multiple parsing/stringifying of the sarif files. Instead, sarif is parsed once at the start of the process and stringified once, after sarif processing is completely finished.
This commit is contained in:
parent
cbabe47a0b
commit
8454e21c9c
18 changed files with 416 additions and 162 deletions
2
lib/util.test.js
generated
2
lib/util.test.js
generated
|
|
@ -35,7 +35,7 @@ const util = __importStar(require("./util"));
|
|||
(0, testing_utils_1.setupTests)(ava_1.default);
|
||||
(0, ava_1.default)("getToolNames", (t) => {
|
||||
const input = fs.readFileSync(`${__dirname}/../src/testdata/tool-names.sarif`, "utf8");
|
||||
const toolNames = util.getToolNames(input);
|
||||
const toolNames = util.getToolNames(JSON.parse(input));
|
||||
t.deepEqual(toolNames, ["CodeQL command-line toolchain", "ESLint"]);
|
||||
});
|
||||
(0, ava_1.default)("getMemoryFlag() should return the correct --ram flag", (t) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue