Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update test suite #2181

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

Merged
merged 31 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6650809
WiP pyscript.web tests pass with upytest.
ntoll Sep 10, 2024
ec20298
Test refactoring. WiP
ntoll Sep 13, 2024
762ae19
Completed refactor of old integration tests to new Python tests.
ntoll Sep 17, 2024
b35fb8f
Added comprehensive test suite for Python based pyodide module.
ntoll Sep 19, 2024
806e574
Black.
ntoll Sep 19, 2024
177cbb9
Rebuld and check websocket attribute assignment via init and as attri…
ntoll Sep 23, 2024
091da6e
Update when tests to allow for worker round trips.
ntoll Sep 23, 2024
4a6c5fa
Post build
ntoll Sep 23, 2024
790fd26
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 23, 2024
ae66d13
Fixed config issue via polyscript update (#2182)
WebReflection Sep 24, 2024
e3c572d
WiP pyscript.web tests pass with upytest.
ntoll Sep 10, 2024
aa83e6c
Test refactoring. WiP
ntoll Sep 13, 2024
263f1fc
Completed refactor of old integration tests to new Python tests.
ntoll Sep 17, 2024
0eb8c43
Added comprehensive test suite for Python based pyodide module.
ntoll Sep 19, 2024
6c81b5f
Black.
ntoll Sep 19, 2024
43f25fd
Rebuld and check websocket attribute assignment via init and as attri…
ntoll Sep 23, 2024
344e54a
Update when tests to allow for worker round trips.
ntoll Sep 23, 2024
f24a2cf
Post build
ntoll Sep 23, 2024
6e52918
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 23, 2024
06216ac
Merge branch 'update-test-suite' of github.com:pyscript/pyscript into…
ntoll Sep 24, 2024
abc3a3b
Fix a couple of timing issues in display and web tests.
ntoll Sep 24, 2024
0d7ef9d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 24, 2024
57e023e
Black
ntoll Sep 24, 2024
58d905d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 24, 2024
7da2ba6
Add integration tests to Makefile (and CI)
ntoll Sep 24, 2024
f826d0b
Remove un-needed upload action.
ntoll Sep 24, 2024
af6cc2b
Ensure fails are properly logged as an array. Remove the explicit tes…
ntoll Sep 24, 2024
aa70295
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 24, 2024
19bc612
Directory reorg/refactor. Updated docs.
ntoll Sep 25, 2024
60622c9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 25, 2024
c52a695
Bump polyscript.
ntoll Sep 25, 2024
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
Prev Previous commit
Next Next commit
Add integration tests to Makefile (and CI)
  • Loading branch information
ntoll committed Sep 24, 2024
commit 7da2ba6f6964b73c876cc50c7cba52bd8f8baa1b
8 changes: 1 addition & 7 deletions 8 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@ precommit-check:

# Run all integration tests sequentially.
test-integration:
mkdir -p test_results
pytest -vv $(ARGS) pyscript.core/tests/integration/ --log-cli-level=warning --junitxml=test_results/integration.xml

# Run all integration tests in parallel.
test-integration-parallel:
mkdir -p test_results
pytest --numprocesses auto -vv $(ARGS) pyscript.core/tests/integration/ --log-cli-level=warning --junitxml=test_results/integration.xml
cd pyscript.core && npm run test:integration

# Format the code.
fmt: fmt-py
Expand Down
41 changes: 41 additions & 0 deletions 41 pyscript.core/tests/integration.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
import { test, expect } from '@playwright/test';

test('Python unit tests - MicroPython on MAIN thread', async ({ page }) => {
await page.goto('http://localhost:8080/tests/integration/python/index.html');
test.setTimeout(120*1000); // Increase timeout for this test.
const result = page.locator("#result"); // Payload for results will be here.
await result.waitFor(); // wait for the result.
const data = JSON.parse(await result.textContent()); // get the result data.
await expect(data.fails.length).toBe(0); // ensure no test failed.
await result.waitFor()
});

test('Python unit tests - Pyodide on MAIN thread', async ({ page }) => {
await page.goto('http://localhost:8080/tests/integration/python/index.html?type=py');
test.setTimeout(120*1000); // Increase timeout for this test.
const result = page.locator("#result"); // Payload for results will be here.
await result.waitFor(); // wait for the result.
const data = JSON.parse(await result.textContent()); // get the result data.
await expect(data.fails.length).toBe(0); // ensure no test failed.
await result.waitFor()
});

test('Python unit tests - MicroPython on WORKER', async ({ page }) => {
await page.goto('http://localhost:8080/tests/integration/python/index.html?worker=1');
test.setTimeout(120*1000); // Increase timeout for this test.
const result = page.locator("#result"); // Payload for results will be here.
await result.waitFor(); // wait for the result.
const data = JSON.parse(await result.textContent()); // get the result data.
await expect(data.fails.length).toBe(0); // ensure no test failed.
await result.waitFor()
});

test('Python unit tests - Pyodide on WORKER', async ({ page }) => {
await page.goto('http://localhost:8080/tests/integration/python/index.html?type=py&worker=1');
test.setTimeout(120*1000); // Increase timeout for this test.
const result = page.locator("#result"); // Payload for results will be here.
await result.waitFor(); // wait for the result.
const data = JSON.parse(await result.textContent()); // get the result data.
await expect(data.fails.length).toBe(0); // ensure no test failed.
await result.waitFor()
});

test('MicroPython display', async ({ page }) => {
await page.goto('http://localhost:8080/tests/js-integration/mpy.html');
await page.waitForSelector('html.done.worker');
Expand Down Expand Up @@ -94,6 +134,7 @@ test('MicroPython + JS Storage', async ({ page }) => {
});

test('MicroPython + workers', async ({ page }) => {
test.setTimeout(120*1000); // Increase timeout for this test.
await page.goto('http://localhost:8080/tests/js-integration/workers/index.html');
await page.waitForSelector('html.mpy.py');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import upytest
from pyscript import RUNNING_IN_WORKER, document

# In the test suite, runnint in a worker is flagged by the presence of the
# In the test suite, running in a worker is flagged by the presence of the
# "worker" query string. We do this to avoid using RUNNING_IN_WORKER to skip
# tests that check RUNNING_IN_WORKER.
in_worker = "worker" in document.location.search.lower()
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.