CI Fix pytest runtime option syntax (#3084)

This commit is contained in:
Gyeongjae Choi 2022-09-08 22:39:42 +09:00 committed by GitHub
parent f3ba7865b2
commit 0333d1fa36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 25 deletions

View File

@ -591,7 +591,7 @@ workflows:
- test-main:
name: test-core-chrome
test-params: --runtime chrome -k "not webworker" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
test-params: --runtime=chrome-no-host -k "not webworker" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
requires:
- build-core
filters:
@ -600,7 +600,7 @@ workflows:
- test-main:
name: test-core-firefox
test-params: --runtime firefox -k "not webworker" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
test-params: --runtime=firefox-no-host -k "not webworker" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
requires:
- build-core
filters:
@ -609,7 +609,7 @@ workflows:
- test-main:
name: test-core-node
test-params: --runtime node src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
test-params: --runtime=node-no-host src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
requires:
- build-core
filters:
@ -618,7 +618,7 @@ workflows:
- test-main-macos:
name: test-core-safari
test-params: --runtime safari src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
test-params: --runtime=safari-no-host src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
requires:
- build-core
filters:
@ -627,7 +627,7 @@ workflows:
- test-main:
name: test-core-chrome-webworker
test-params: --runtime chrome src/tests/test_webworker.py
test-params: --runtime=chrome-no-host src/tests/test_webworker.py
requires:
- test-core-chrome
filters:
@ -636,7 +636,7 @@ workflows:
- test-main:
name: test-core-firefox-webworker
test-params: --runtime firefox src/tests/test_webworker.py
test-params: --runtime=firefox-no-host src/tests/test_webworker.py
requires:
- test-core-firefox
filters:
@ -645,7 +645,7 @@ workflows:
- test-main:
name: test-packages-chrome-no-numpy-dependents
test-params: --runtime chrome packages/*/test*.py
test-params: --runtime=chrome-no-host packages/*/test*.py
cache-dir: .pytest_cache_chrome
requires:
- build-packages-no-numpy-dependents
@ -660,7 +660,7 @@ workflows:
- test-main:
name: test-packages-chrome
test-params: --runtime chrome packages/*/test*.py --skip-passed
test-params: --runtime=chrome-no-host packages/*/test*.py --skip-passed
cache-dir: .pytest_cache_chrome
requires:
- test-packages-chrome-no-numpy-dependents
@ -671,7 +671,7 @@ workflows:
- test-main:
name: test-packages-firefox-no-numpy-dependents
test-params: --runtime firefox packages/*/test*.py
test-params: --runtime=firefox-no-host packages/*/test*.py
cache-dir: .pytest_cache_firefox
requires:
- build-packages-no-numpy-dependents
@ -686,7 +686,7 @@ workflows:
- test-main:
name: test-packages-firefox
test-params: --runtime firefox packages/*/test*.py --skip-passed
test-params: --runtime=firefox-no-host packages/*/test*.py --skip-passed
cache-dir: .pytest_cache_firefox
requires:
- test-packages-firefox-no-numpy-dependents
@ -697,7 +697,7 @@ workflows:
- test-main:
name: test-packages-node-no-numpy-dependents
test-params: --runtime node packages/*/test*.py
test-params: --runtime=node-no-host packages/*/test*.py
cache-dir: .pytest_cache_node
requires:
- build-packages-no-numpy-dependents
@ -712,7 +712,7 @@ workflows:
- test-main:
name: test-packages-node
test-params: --runtime node packages/*/test*.py --skip-passed
test-params: --runtime=node-no-host packages/*/test*.py --skip-passed
cache-dir: .pytest_cache_node
requires:
- test-packages-node-no-numpy-dependents

View File

@ -41,9 +41,9 @@ jobs:
PYODIDE_ROOT=. pytest \
--junitxml=test-results/junit.xml \
--verbose \
--runtime host \
--runtime=host \
--cov=pyodide_build --cov=pyodide \
src pyodide-build packages/micropip/
src pyodide-build packages/micropip/ packages/_tests
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
@ -170,7 +170,7 @@ jobs:
ls -lh dist/
tools/pytest_wrapper.py src packages/micropip/ \
-v \
--runtime "${BROWSER}" \
--runtime="${BROWSER}-no-host" \
--runner "${RUNNER}" \
--durations 50 \
--junitxml=test-results/core_test.xml
@ -186,7 +186,7 @@ jobs:
tools/pytest_wrapper.py packages/*/test* \
-v \
-k "numpy and not joblib" \
--runtime "${BROWSER}" \
--runtime="${BROWSER}-no-host" \
--runner "${RUNNER}" \
--durations 50 \
--junitxml=test-results/packages_test.xml

View File

@ -73,17 +73,22 @@ def maybe_skip_test(item, delayed=False):
# Common package import test. Skip it if the package is not built.
if skip_msg is None and is_common_test and item.name.startswith("test_import"):
match = re.match(rf"test_import\[({browsers})-(?P<name>[\w\-\.]+)\]", item.name)
if match:
package_name = match.group("name")
if not package_is_built(package_name):
# If the test is going to be skipped remove the
# selenium_standalone as it takes a long time to initialize
skip_msg = f"package '{package_name}' is not built."
if not pytest.pyodide_runtimes: # type: ignore[truthy-bool]
skip_msg = "Not running browser tests"
else:
raise AssertionError(
f"Couldn't parse package name from {item.name}. This should not happen!"
match = re.match(
rf"test_import\[({browsers})-(?P<name>[\w\-\.]+)\]", item.name
)
if match:
package_name = match.group("name")
if not package_is_built(package_name):
# selenium_standalone as it takes a long time to initialize
skip_msg = f"package '{package_name}' is not built."
else:
raise AssertionError(
f"Couldn't parse package name from {item.name}. This should not happen!"
) # If the test is going to be skipped remove the
# TODO: also use this hook to skip doctests we cannot run (or run them
# inside the selenium wrapper)