Skip to content
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

E2E test: remove ipykernel from primary interpreters #6367

Merged
merged 9 commits into from
Feb 19, 2025
3 changes: 1 addition & 2 deletions .github/actions/install-python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ runs:
curl https://raw.githubusercontent.com/posit-dev/qa-example-content/main/requirements.txt --output requirements.txt
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
python3 -m pip install ipykernel

- name: Verify Python Version
shell: bash
Expand Down Expand Up @@ -51,7 +50,7 @@ runs:
PYTHON_ALTERNATE_VERSION="${{ inputs.alternate_version }}"
echo "Installing Python version $PYTHON_ALTERNATE_VERSION using pyenv..."
pyenv install -s "$PYTHON_ALTERNATE_VERSION"

pyenv versions

pyenv global "$PYTHON_ALTERNATE_VERSION"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-e2e-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
curl https://raw.githubusercontent.com/posit-dev/qa-example-content/main/requirements.txt --output requirements.txt
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install ipykernel trcli
python -m pip install trcli

# Alternate python version
- name: Install Python 3.13.0
Expand Down
21 changes: 15 additions & 6 deletions test/e2e/pages/newProjectWizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,21 @@ export class NewProjectWizard {
}

// Open the dropdown and select the interpreter by path
await this.interpreterDropdown.click();
await this.dropDropdownOptions
.locator('div.dropdown-entry-subtitle')
.getByText(interpreterPath)
.first()
.click();
await expect(async () => {

try {
await this.interpreterDropdown.click();
await this.dropDropdownOptions
.locator('div.dropdown-entry-subtitle')
.getByText(interpreterPath)
.first()
.click({ timeout: 5000 });
} catch (error) {
await this.code.driver.page.keyboard.press('Escape');
throw error;
}

}).toPass({ intervals: [1_000, 5_000, 10_000], timeout: 15000 });
}
}

Expand Down
29 changes: 2 additions & 27 deletions test/e2e/tests/new-project-wizard/new-project-python.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,20 @@ test.use({
// Not running conda test on windows because conda reeks havoc on selecting the correct python interpreter
test.describe('Python - New Project Wizard', { tag: [tags.MODAL, tags.NEW_PROJECT_WIZARD] }, () => {

test('Existing env: ipykernel already installed', { tag: [tags.WIN], }, async function ({ app, python, packages }) {
test('Existing env: ipykernel already installed', { tag: [tags.WIN], }, async function ({ app, python }) {
const projectTitle = addRandomNumSuffix('ipykernel-installed');

await packages.manage('ipykernel', 'install');
await createNewProject(app, {
type: ProjectType.PYTHON_PROJECT,
title: projectTitle,
status: 'existing',
ipykernelFeedback: 'hide',
ipykernelFeedback: 'show', // change to 'hide' when https://github.com/posit-dev/positron/issues/6386 is fixed
interpreterPath: await getInterpreterPath(app),
});

await verifyProjectCreation(app, projectTitle);
});

test('Existing env: ipykernel not already installed', { tag: [tags.WIN] }, async function ({ app, python, packages }) {
const projectTitle = addRandomNumSuffix('no-ipykernel');

await packages.manage('ipykernel', 'uninstall');
await createNewProject(app, {
type: ProjectType.PYTHON_PROJECT,
title: projectTitle,
status: 'existing',
interpreterPath: await getInterpreterPath(app),
ipykernelFeedback: 'show'
});

await verifyProjectCreation(app, projectTitle);
await verifyIpykernelInstalled(app);
});

test('New env: Git initialized', { tag: [tags.CRITICAL, tags.WIN] }, async function ({ app }) {
const projectTitle = addRandomNumSuffix('git-init');

Expand Down Expand Up @@ -145,14 +128,6 @@ async function verifyGitStatus(app: Application) {
});
}


async function verifyIpykernelInstalled(app: Application) {
await test.step('Verify ipykernel is installed', async () => {
await app.workbench.console.typeToConsole('pip show ipykernel', 10, true);
await app.workbench.console.waitForConsoleContents('Name: ipykernel');
});
}

async function getInterpreterPath(app: Application): Promise<string> {
let interpreterPath: string | undefined;

Expand Down
5 changes: 3 additions & 2 deletions test/e2e/tests/reticulate/reticulate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ test.use({
// RETICULATE_PYTHON
// to the installed python path

// Re-add WEB tag when https://github.com/posit-dev/positron/issues/6397 is fixed
test.describe('Reticulate', {
tag: [tags.WEB, tags.RETICULATE],
annotation: [{ type: 'issue', description: 'https://github.com/posit-dev/positron/issues/5226' }]
tag: [tags.RETICULATE],
annotation: [{ type: 'issue', description: 'https://github.com/posit-dev/positron/issues/6397' }]
}, () => {
test.beforeAll(async function ({ app, userSettings }) {
try {
Expand Down