Exclude the temporary directory from scanning.
This commit is contained in:
parent
2841489ddf
commit
206e34cbb4
9 changed files with 85 additions and 16 deletions
25
lib/analysis-paths.test.js
generated
25
lib/analysis-paths.test.js
generated
|
|
@ -11,7 +11,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const ava_1 = __importDefault(require("ava"));
|
||||
const path = __importStar(require("path"));
|
||||
const analysisPaths = __importStar(require("./analysis-paths"));
|
||||
const logging_1 = require("./logging");
|
||||
const testing_utils_1 = require("./testing-utils");
|
||||
const util = __importStar(require("./util"));
|
||||
testing_utils_1.setupTests(ava_1.default);
|
||||
|
|
@ -27,7 +29,7 @@ ava_1.default("emptyPaths", async (t) => {
|
|||
toolCacheDir: tmpDir,
|
||||
codeQLCmd: "",
|
||||
};
|
||||
analysisPaths.includeAndExcludeAnalysisPaths(config);
|
||||
analysisPaths.includeAndExcludeAnalysisPaths(config, logging_1.getRunnerLogger(true));
|
||||
t.is(process.env["LGTM_INDEX_INCLUDE"], undefined);
|
||||
t.is(process.env["LGTM_INDEX_EXCLUDE"], undefined);
|
||||
t.is(process.env["LGTM_INDEX_FILTERS"], undefined);
|
||||
|
|
@ -45,10 +47,29 @@ ava_1.default("nonEmptyPaths", async (t) => {
|
|||
toolCacheDir: tmpDir,
|
||||
codeQLCmd: "",
|
||||
};
|
||||
analysisPaths.includeAndExcludeAnalysisPaths(config);
|
||||
analysisPaths.includeAndExcludeAnalysisPaths(config, logging_1.getRunnerLogger(true));
|
||||
t.is(process.env["LGTM_INDEX_INCLUDE"], "path1\npath2");
|
||||
t.is(process.env["LGTM_INDEX_EXCLUDE"], "path4\npath5");
|
||||
t.is(process.env["LGTM_INDEX_FILTERS"], "include:path1\ninclude:path2\ninclude:**/path3\nexclude:path4\nexclude:path5\nexclude:path6/**");
|
||||
});
|
||||
});
|
||||
ava_1.default("exclude temp dir", async (t) => {
|
||||
return await util.withTmpDir(async (toolCacheDir) => {
|
||||
const tempDir = path.join(process.cwd(), "codeql-runner-temp");
|
||||
const config = {
|
||||
languages: [],
|
||||
queries: {},
|
||||
pathsIgnore: [],
|
||||
paths: [],
|
||||
originalUserInput: {},
|
||||
tempDir,
|
||||
toolCacheDir,
|
||||
codeQLCmd: "",
|
||||
};
|
||||
analysisPaths.includeAndExcludeAnalysisPaths(config, logging_1.getRunnerLogger(true));
|
||||
t.is(process.env["LGTM_INDEX_INCLUDE"], undefined);
|
||||
t.is(process.env["LGTM_INDEX_EXCLUDE"], tempDir);
|
||||
t.is(process.env["LGTM_INDEX_FILTERS"], undefined);
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=analysis-paths.test.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue