-
Notifications
You must be signed in to change notification settings - Fork 189
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
Add progress messages to LGTM download option. #960
Changes from 3 commits
f6ecbe6
518ee5a
5f10e48
d31b0ef
f9e9df6
f2c86fc
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 |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
## [UNRELEASED] | ||
|
||
- Remove line about selecting a language from the dropdown when downloading database from LGTM. This makes the download progress visible when the popup is not expanded. [#894](https://github.com/github/vscode-codeql/issues/894) | ||
- Add progress messages to LGTM download option. This makes the two-step process (selecting a project, then selecting a language) more clear. | ||
|
||
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. And there is an extra newline here. |
||
- Remove line about selecting a language from the dropdown when downloading database from LGTM. This makes the download progress visible when the popup is not expanded. [#894](https://github.com/github/vscode-codeql/issues/894) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,13 @@ import { | |
looksLikeLgtmUrl, | ||
findDirWithFile, | ||
} from '../../databaseFetcher'; | ||
import { ProgressUpdate } from '../../commandRunner'; | ||
chai.use(chaiAsPromised); | ||
const expect = chai.expect; | ||
|
||
describe('databaseFetcher', function() { | ||
describe('databaseFetcher', function () { | ||
// These tests make API calls and may need extra time to complete. | ||
const fakeProgress = (_: ProgressUpdate) => { /*do nothing*/ }; | ||
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. This could be converted into a test spy and you can later verify that this spy is invoked. This would ensure that the progress update is properly called. eg-
|
||
this.timeout(10000); | ||
|
||
describe('convertToDatabaseUrl', () => { | ||
|
@@ -35,7 +37,7 @@ describe('databaseFetcher', function() { | |
it('should convert a project url to a database url', async () => { | ||
quickPickSpy.resolves('javascript'); | ||
const lgtmUrl = 'https://lgtm.com/projects/g/github/codeql'; | ||
const dbUrl = await convertToDatabaseUrl(lgtmUrl); | ||
const dbUrl = await convertToDatabaseUrl(lgtmUrl, fakeProgress); | ||
|
||
expect(dbUrl).to.equal( | ||
'https://lgtm.com/api/v1.0/snapshots/1506465042581/javascript' | ||
|
@@ -48,7 +50,7 @@ describe('databaseFetcher', function() { | |
quickPickSpy.resolves('python'); | ||
const lgtmUrl = | ||
'https://lgtm.com/projects/g/github/codeql/subpage/subpage2?query=xxx'; | ||
const dbUrl = await convertToDatabaseUrl(lgtmUrl); | ||
const dbUrl = await convertToDatabaseUrl(lgtmUrl, fakeProgress); | ||
|
||
expect(dbUrl).to.equal( | ||
'https://lgtm.com/api/v1.0/snapshots/1506465042581/python' | ||
|
@@ -59,7 +61,7 @@ describe('databaseFetcher', function() { | |
quickPickSpy.resolves('python'); | ||
const lgtmUrl = | ||
'g/github/codeql'; | ||
const dbUrl = await convertToDatabaseUrl(lgtmUrl); | ||
const dbUrl = await convertToDatabaseUrl(lgtmUrl, fakeProgress); | ||
|
||
expect(dbUrl).to.equal( | ||
'https://lgtm.com/api/v1.0/snapshots/1506465042581/python' | ||
|
@@ -69,7 +71,7 @@ describe('databaseFetcher', function() { | |
it('should fail on a nonexistent project', async () => { | ||
quickPickSpy.resolves('javascript'); | ||
const lgtmUrl = 'https://lgtm.com/projects/g/github/hucairz'; | ||
await expect(convertToDatabaseUrl(lgtmUrl)).to.rejectedWith(/Invalid LGTM URL/); | ||
await expect(convertToDatabaseUrl(lgtmUrl, fakeProgress)).to.rejectedWith(/Invalid LGTM URL/); | ||
}); | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this duplicated line.