Skip to content

Commit

Permalink
Use public github repo for content samples (#3533)
Browse files Browse the repository at this point in the history
* Use public github repo for content samples

* R latency fixes
  • Loading branch information
testlabauto authored Jun 13, 2024
1 parent 3608517 commit 5d79ea6
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 25 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/positron-full-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Check out positron-content-examples
uses: actions/checkout@v4
with:
repository: posit-dev/positron-content-examples
path: test/smoke/positron-content-examples
token: ${{ secrets.POSITRON_GITHUB_PAT }}

- name: Setup Build Environment
run: |
sudo apt-get update
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ product.overrides.json

# --- Start Positron ---
.Rproj.user
test/smoke/positron-content-examples
# --- End Positron ---

5 changes: 1 addition & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,7 @@
"program": "${workspaceFolder}/test/smoke/test/index.js",
"cwd": "${workspaceFolder}/test/smoke",
"timeout": 240000,
"args": [
"--test-repo",
"positron-content-examples"
],
"args": [],
"outFiles": [
"${cwd}/out/**/*.js"
],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"7z": "7z",
"update-grammars": "node build/npm/update-all-grammars.mjs",
"update-localization-extension": "node build/npm/update-localization-extension.js",
"smoketest": "node build/lib/preLaunch.js && cd test/smoke && yarn compile && node test/index.js --test-repo positron-content-examples",
"smoketest-no-compile": "cd test/smoke && node test/index.js --test-repo positron-content-examples",
"smoketest": "node build/lib/preLaunch.js && cd test/smoke && yarn compile && node test/index.js",
"smoketest-no-compile": "cd test/smoke && node test/index.js",
"download-builtin-extensions": "node build/lib/builtInExtensions.js",
"download-builtin-extensions-cg": "node build/lib/builtInExtensionsCG.js",
"download-pandoc": "node build/lib/pandoc.js",
Expand Down
15 changes: 11 additions & 4 deletions test/smoke/src/areas/positron/connections/dbConnections.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function setup(logger: Logger) {
// TestRail 628636

const app = this.app as Application;
await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'positron-workspaces', 'chinook-db-py', 'sqlite.py'));
await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'chinook-db-py', 'sqlite.py'));
await app.workbench.quickaccess.runCommand('python.execInConsole');

console.log('Opening connections pane');
Expand Down Expand Up @@ -89,16 +89,23 @@ export function setup(logger: Logger) {
// TestRail 628637

const app = this.app as Application;
await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'positron-workspaces', 'chinook-db-r', 'sqlite.r'));
await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'chinook-db-r', 'sqlite.r'));
await app.workbench.quickaccess.runCommand('r.sourceCurrentFile');

console.log('Opening connections pane');
await app.workbench.positronConnections.connectionsTabLink.click();

// help with R latency
await app.code.wait(5000);

await app.workbench.positronConnections.openRTree();
for (let i = 0; i < 3; i++) {
try {
await app.workbench.positronConnections.openRTree();
break;
} catch (e) {
await app.code.wait(5000);
console.log('Retrying to open R tree');
}
}

// click in reverse order to avoid scrolling issues
await app.workbench.positronConnections.openConnectionsNodes(tables);
Expand Down
24 changes: 19 additions & 5 deletions test/smoke/src/areas/positron/dataexplorer/largeDataFrame.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function setup(logger: Logger) {
it('Python - Verifies data explorer functionality with large data frame', async function () {
//TestRail #557555
const app = this.app as Application;
await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'positron-workspaces', 'nyc-flights-data-py', 'flights-data-frame.py'));
await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'nyc-flights-data-py', 'flights-data-frame.py'));
await app.workbench.quickaccess.runCommand('python.execInConsole');

console.log('Opening data grid');
Expand All @@ -53,9 +53,23 @@ export function setup(logger: Logger) {

// Validate full grid by checking bottom right corner data
await app.workbench.positronDataExplorer.clickLowerRightCorner();
const tableData = await app.workbench.positronDataExplorer.getDataExplorerTableData();
const lastRow = tableData.at(-1);
expect(lastRow!['time_hour']).toBe(LAST_CELL_CONTENTS);

// help with R latency
let lastHour = undefined;
for (let i = 0; i < 5; i++) {
const tableData = await app.workbench.positronDataExplorer.getDataExplorerTableData();
const lastRow = tableData.at(-1);
lastHour = lastRow!['time_hour'];

if (lastHour === undefined) {
await app.code.wait(3000);
console.log('Retrying to get last row data');
} else {
break;
}
}

expect(lastHour).toBe(LAST_CELL_CONTENTS);

// Filter data set
await app.workbench.positronDataExplorer.clickUpperLeftCorner();
Expand Down Expand Up @@ -91,7 +105,7 @@ export function setup(logger: Logger) {
it('R - Verifies data explorer functionality with large data frame', async function () {
// TestRail #557554
const app = this.app as Application;
await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'positron-workspaces', 'nyc-flights-data-r', 'flights-data-frame.r'));
await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'nyc-flights-data-r', 'flights-data-frame.r'));
await app.workbench.quickaccess.runCommand('r.sourceCurrentFile');

console.log('Opening data grid');
Expand Down
4 changes: 2 additions & 2 deletions test/smoke/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ process.once('exit', () => {
}
});

const testRepoUrl = 'https://github.com/microsoft/vscode-smoketest-express';
const workspacePath = path.join(testDataPath, 'vscode-smoketest-express');
const testRepoUrl = 'https://github.com/posit-dev/qa-example-content.git';
const workspacePath = path.join(testDataPath, 'qa-example-content');
const extensionsPath = path.join(testDataPath, 'extensions-dir');
mkdirp.sync(extensionsPath);

Expand Down

0 comments on commit 5d79ea6

Please sign in to comment.