Fix URI encoding for connection provider calls (#15177)

* Fix URI encoding for connection provider calls

* Update distro
This commit is contained in:
Charles Gagnon
2021-04-20 11:40:32 -07:00
committed by GitHub
parent 556dd9d2b1
commit a82be2f014
6 changed files with 73 additions and 37 deletions

View File

@@ -26,20 +26,17 @@ export function setup() {
it('can open ipynb file, run all, and save notebook with outputs', async function () {
const app = this.app as Application;
await app.workbench.sqlNotebook.openFile('hello.ipynb');
await app.workbench.sqlNotebook.waitForKernel('Python 3');
await openAndRunNotebook(app, 'hello.ipynb');
});
await app.workbench.sqlNotebook.clearResults();
await app.workbench.sqlNotebook.waitForAllResultsGone();
await app.workbench.sqlNotebook.runAllCells();
await app.workbench.sqlNotebook.waitForAllResults();
it('can open ipynb file from path with spaces, run all, and save notebook with outputs', async function () {
const app = this.app as Application;
await openAndRunNotebook(app, 'helloWithSpaces.ipynb');
});
await app.workbench.quickaccess.runCommand('workbench.action.files.save');
await app.workbench.quickaccess.runCommand('workbench.action.closeActiveEditor');
await app.workbench.sqlNotebook.openFile('hello.ipynb');
await app.workbench.sqlNotebook.waitForKernel('Python 3');
await app.workbench.sqlNotebook.waitForAllResults();
it('can open ipynb file from path with escaped spaces, run all, and save notebook with outputs', async function () {
const app = this.app as Application;
await openAndRunNotebook(app, 'helloWithEscapedSpaces.ipynb');
});
it('can open untrusted notebook, trust, save, and reopen trusted notebook', async function () {
@@ -64,3 +61,20 @@ export function setup() {
});
});
}
async function openAndRunNotebook(app: Application, filename: string): Promise<void> {
await app.workbench.sqlNotebook.openFile(filename);
await app.workbench.sqlNotebook.waitForKernel('Python 3');
await app.workbench.sqlNotebook.clearResults();
await app.workbench.sqlNotebook.waitForAllResultsGone();
await app.workbench.sqlNotebook.runAllCells();
await app.workbench.sqlNotebook.waitForAllResults();
await app.workbench.quickaccess.runCommand('workbench.action.files.save');
await app.workbench.quickaccess.runCommand('workbench.action.closeActiveEditor');
await app.workbench.sqlNotebook.openFile(filename);
await app.workbench.sqlNotebook.waitForKernel('Python 3');
await app.workbench.sqlNotebook.waitForAllResults();
}

View File

@@ -21,22 +21,39 @@ export function setup() {
await app.workbench.connectionDialog.connect();
await app.workbench.queryEditor.commandBar.run();
await app.workbench.queryEditor.waitForResults();
await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors');
});
});
}
export function setupWeb() {
it('can open, connect and execute file', async function () {
afterEach(async function (): Promise<void> {
const app = this.app as Application;
await app.workbench.quickaccess.openFile('test.sql');
await app.workbench.queryEditor.commandBar.connect();
await app.workbench.connectionDialog.waitForConnectionDialog();
await app.workbench.connectionDialog.setProvider('Sqlite');
await app.workbench.connectionDialog.setTarget('File', 'chinook.db');
await app.workbench.connectionDialog.connect();
await app.workbench.queryEditor.commandBar.run();
await app.workbench.queryEditor.waitForResults();
await app.workbench.quickaccess.runCommand('workbench.action.closeAllEditors');
});
it('can open, connect and execute file', async function () {
const app = this.app as Application;
await openAndExecuteFile(app, 'test.sql');
});
it('can open, connect and execute file with spaces', async function () {
const app = this.app as Application;
await openAndExecuteFile(app, 'testWithSpaces.sql');
});
it('can open, connect and execute file with escaped spaces', async function () {
const app = this.app as Application;
await openAndExecuteFile(app, 'testWithEscapedSpaces.sql');
});
}
async function openAndExecuteFile(app: Application, filename: string): Promise<void> {
await app.workbench.quickaccess.openFile(filename);
await app.workbench.queryEditor.commandBar.connect();
await app.workbench.connectionDialog.waitForConnectionDialog();
await app.workbench.connectionDialog.setProvider('Sqlite');
await app.workbench.connectionDialog.setTarget('File', 'chinook.db');
await app.workbench.connectionDialog.connect();
await app.workbench.queryEditor.commandBar.run();
await app.workbench.queryEditor.waitForResults();
}

View File

@@ -31,7 +31,7 @@ const PLATFORM = '${PLATFORM}';
const RUNTIME = '${RUNTIME}';
const VERSION = '${VERSION}';
const sqliteUrl = `https://github.com/Microsoft/azuredatastudio-sqlite/releases/download/1.1.1/azuredatastudio-sqlite-${PLATFORM}-${RUNTIME}-${VERSION}.zip`;
const sqliteUrl = `https://github.com/Microsoft/azuredatastudio-sqlite/releases/download/1.1.2/azuredatastudio-sqlite-${PLATFORM}-${RUNTIME}-${VERSION}.zip`;
export async function setup(app: ApplicationOptions): Promise<void> {
console.log('*** Downloading test extensions');