Skip to content

Commit 2243c21

Browse files
authored
Merge pull request #494 from jcreedcmu/jcreed/fix-integration-tests
Remove failing integration test
2 parents 70de59e + 46bddcd commit 2243c21

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

extensions/ql-vscode/src/interface-utils.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ export function fileUriToWebviewUri(
5050
return panel.webview.asWebviewUri(fileUriOnDisk).toString();
5151
}
5252

53-
/** Converts a URI string received from a webview into a local filesystem URI for the same resource. */
54-
export function webviewUriToFileUri(webviewUri: string): Uri {
55-
// Webview URIs used the vscode-resource scheme. The filesystem path of the resource can be obtained from the path component of the webview URI.
56-
const path = Uri.parse(webviewUri).path;
57-
// For this path to be interpreted on the filesystem, we need to parse it as a filesystem URI for the current platform.
58-
return Uri.file(path);
59-
}
60-
6153
/**
6254
* Resolves the specified CodeQL location to a URI into the source archive.
6355
* @param loc CodeQL location to resolve. Must have a non-empty value for `loc.file`.

extensions/ql-vscode/src/vscode-tests/no-workspace/interface-utils.test.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import * as tmp from 'tmp';
66
import { window, ViewColumn, Uri } from 'vscode';
77
import {
88
fileUriToWebviewUri,
9-
webviewUriToFileUri,
109
tryResolveLocation,
1110
} from '../../interface-utils';
1211
import { getDefaultResultSetName } from '../../interface-types';
@@ -47,15 +46,6 @@ describe('interface-utils', () => {
4746
};
4847
}
4948

50-
it('should correctly round trip from filesystem to webview and back', function() {
51-
const { fileUriOnDisk, panel } = setupWebview('');
52-
const webviewUri = fileUriToWebviewUri(panel, fileUriOnDisk);
53-
const reconstructedFileUri = webviewUriToFileUri(webviewUri);
54-
expect(reconstructedFileUri.toString(true)).to.equal(
55-
fileUriOnDisk.toString(true)
56-
);
57-
});
58-
5949
it('does not double-encode # in URIs', function() {
6050
const { fileUriOnDisk, panel } = setupWebview('#');
6151
const webviewUri = fileUriToWebviewUri(panel, fileUriOnDisk);

extensions/ql-vscode/src/vscode-tests/run-integration-tests.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,19 @@ type Suite = {
99
extensionDevelopmentPath: string;
1010
extensionTestsPath: string;
1111
launchArgs: string[];
12+
version?: string;
1213
};
1314

15+
// Which version of vscode to test against. Can set to 'stable' or
16+
// 'insiders' or an explicit version number. See runTest.d.ts in
17+
// vscode-test for more details.
18+
19+
// For CI purposes we want to leave this at 'stable' to catch any bugs
20+
// that might show up with new vscode versions released, even though
21+
// this makes testing not-quite-pure, but it can be changed for local
22+
// testing against old versions if necessary.
23+
const VSCODE_VERSION = 'stable';
24+
1425
/**
1526
* Run an integration test suite `suite`, retrying if it segfaults, at
1627
* most `tries` times.
@@ -53,15 +64,17 @@ async function main() {
5364

5465
// List of integration test suites.
5566
// The path to the extension test runner script is passed to --extensionTestsPath.
56-
const integrationTestSuites = [
67+
const integrationTestSuites: Suite[] = [
5768
// Tests with no workspace selected upon launch.
5869
{
70+
version: VSCODE_VERSION,
5971
extensionDevelopmentPath: extensionDevelopmentPath,
6072
extensionTestsPath: path.resolve(__dirname, 'no-workspace', 'index'),
6173
launchArgs: ['--disable-extensions'],
6274
},
6375
// Tests with a simple workspace selected upon launch.
6476
{
77+
version: VSCODE_VERSION,
6578
extensionDevelopmentPath: extensionDevelopmentPath,
6679
extensionTestsPath: path.resolve(__dirname, 'minimal-workspace', 'index'),
6780
launchArgs: [

0 commit comments

Comments
 (0)