Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ui-tests/environment.yml → ui-tests/env1.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: jupyterlite-xeus-tests
name: env1
channels:
- https://repo.mamba.pm/emscripten-forge
- https://repo.prefix.dev/emscripten-forge-dev
- conda-forge
dependencies:
- xeus-python
Expand Down
6 changes: 6 additions & 0 deletions ui-tests/env2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: env2
channels:
- https://repo.prefix.dev/emscripten-forge-dev
- conda-forge
dependencies:
- xeus-python
3 changes: 3 additions & 0 deletions ui-tests/jupyter_lite_config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"LiteBuildConfig": {
"output_dir": "dist"
},
"XeusAddon": {
"environment_file": ["env1.yml", "env2.yml"]
}
}
35 changes: 33 additions & 2 deletions ui-tests/tests/jupyterlite_xeus.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ test.describe('General Tests', () => {
test('xeus-python should execute some code', async ({ page }) => {
await page.goto('lab/index.html');

const xpython = page.locator('[title="Python 3.11 (XPython)"]').first();
const xpython = page
.locator('[title="Python 3.13 (XPython) [env1]"]')
.first();
await xpython.click();

// Wait for kernel to be idle
Expand All @@ -44,11 +46,40 @@ test.describe('General Tests', () => {
);
});

test('should support the same kernel from a second environment', async ({
page
}) => {
await page.goto('lab/index.html');

const xpython = page
.locator('[title="Python 3.13 (XPython) [env2]"]')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.locator('[title="Python 3.13 (XPython) [env2]"]')
.locator('[title="Python 3.13 (XPython) [env1]"]')

Since bqplot is installed in env1 and that test imports bqplot, maybe that should be the one to start

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous test uses env1 and confirms that bqplot can be imported, so this is the same test but with env2 to confirm that it cannot be imported. I should probably add a note explaining this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah got it! Makes sense, thanks :D

.first();
await xpython.click();

// Wait for kernel to be idle
await page.locator('#jp-main-statusbar').getByText('Idle').waitFor();

// xeus-python from env2 does not have bqplot installed.
await page.notebook.addCell('code', 'import bqplot');
await page.notebook.runCell(1);

// Wait for kernel to be idle
await page.locator('#jp-main-statusbar').getByText('Idle').waitFor();

const cell = await page.notebook.getCellOutput(1);

expect(await cell?.screenshot()).toMatchSnapshot(
'jupyter-xeus-execute-env2.png'
);
});

test('the kernel should have access to the file system', async ({ page }) => {
await page.goto('lab/index.html');

// Create a Python notebook
const xpython = page.locator('[title="Python 3.11 (XPython)"]').first();
const xpython = page
.locator('[title="Python 3.13 (XPython) [env1]"]')
.first();
await xpython.click();

await page.notebook.save();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.