-
Notifications
You must be signed in to change notification settings - Fork 226
New setting to specify number of paths per alert #931
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -79,6 +79,7 @@ const CACHE_SIZE_SETTING = new Setting('cacheSize', RUNNING_QUERIES_SETTING); | |||||||
| const TIMEOUT_SETTING = new Setting('timeout', RUNNING_QUERIES_SETTING); | ||||||||
| const MEMORY_SETTING = new Setting('memory', RUNNING_QUERIES_SETTING); | ||||||||
| const DEBUG_SETTING = new Setting('debug', RUNNING_QUERIES_SETTING); | ||||||||
| const MAX_PATHS = new Setting('maxPaths', RUNNING_QUERIES_SETTING); | ||||||||
| const RUNNING_TESTS_SETTING = new Setting('runningTests', ROOT_SETTING); | ||||||||
| const RESULTS_DISPLAY_SETTING = new Setting('resultsDisplay', ROOT_SETTING); | ||||||||
|
|
||||||||
|
|
@@ -112,12 +113,13 @@ export interface QueryHistoryConfig { | |||||||
| onDidChangeConfiguration: Event<void>; | ||||||||
| } | ||||||||
|
|
||||||||
| const CLI_SETTINGS = [ADDITIONAL_TEST_ARGUMENTS_SETTING, NUMBER_OF_TEST_THREADS_SETTING, NUMBER_OF_THREADS_SETTING]; | ||||||||
| const CLI_SETTINGS = [ADDITIONAL_TEST_ARGUMENTS_SETTING, NUMBER_OF_TEST_THREADS_SETTING, NUMBER_OF_THREADS_SETTING, MAX_PATHS]; | ||||||||
|
|
||||||||
| export interface CliConfig { | ||||||||
| additionalTestArguments: string[]; | ||||||||
| numberTestThreads: number; | ||||||||
| numberThreads: number; | ||||||||
| maxPaths: number; | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can unit test this - take a look at https://github.com/github/vscode-codeql/blob/main/extensions/ql-vscode/src/vscode-tests/minimal-workspace/config.test.ts and add it to the list of values. (I think it will go under the CLIConfigListener rather than the QueryServerConfigListener.)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added it to that test file here. Silly question, but what should
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a silly question, I wondered the same while looking at it. I think the intent is to test a range of values that we expect to be handled: for this kind of test it's a good idea to check the minimum, the maximum, some common value in the middle, and a zero/empty value. If the test is capable of handling errors, then also test some value that shouldn't be allowed.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like the test only lets me test 2 values? vscode-codeql/extensions/ql-vscode/src/vscode-tests/minimal-workspace/config.test.ts Lines 34 to 36 in e119218
I can't quite work out if the test is doing anything with the values themselves, or just listening for when they change 😕
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ohh you are right. The test is just making sure the listeners handle a change. So |
||||||||
| onDidChangeConfiguration?: Event<void>; | ||||||||
| } | ||||||||
|
|
||||||||
|
|
@@ -264,6 +266,10 @@ export class CliConfigListener extends ConfigListener implements CliConfig { | |||||||
| return NUMBER_OF_THREADS_SETTING.getValue<number>(); | ||||||||
| } | ||||||||
|
|
||||||||
| public get maxPaths(): number { | ||||||||
| return MAX_PATHS.getValue<number>(); | ||||||||
| } | ||||||||
|
|
||||||||
| protected handleDidChangeConfiguration(e: ConfigurationChangeEvent): void { | ||||||||
| this.handleDidChangeConfigurationForRelevantSettings(CLI_SETTINGS, e); | ||||||||
| } | ||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.