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: - test-main:
name: test-core-chrome 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: requires:
- build-core - build-core
filters: filters:
@ -600,7 +600,7 @@ workflows:
- test-main: - test-main:
name: test-core-firefox 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: requires:
- build-core - build-core
filters: filters:
@ -609,7 +609,7 @@ workflows:
- test-main: - test-main:
name: test-core-node 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: requires:
- build-core - build-core
filters: filters:
@ -618,7 +618,7 @@ workflows:
- test-main-macos: - test-main-macos:
name: test-core-safari 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: requires:
- build-core - build-core
filters: filters:
@ -627,7 +627,7 @@ workflows:
- test-main: - test-main:
name: test-core-chrome-webworker 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: requires:
- test-core-chrome - test-core-chrome
filters: filters:
@ -636,7 +636,7 @@ workflows:
- test-main: - test-main:
name: test-core-firefox-webworker 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: requires:
- test-core-firefox - test-core-firefox
filters: filters:
@ -645,7 +645,7 @@ workflows:
- test-main: - test-main:
name: test-packages-chrome-no-numpy-dependents 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 cache-dir: .pytest_cache_chrome
requires: requires:
- build-packages-no-numpy-dependents - build-packages-no-numpy-dependents
@ -660,7 +660,7 @@ workflows:
- test-main: - test-main:
name: test-packages-chrome 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 cache-dir: .pytest_cache_chrome
requires: requires:
- test-packages-chrome-no-numpy-dependents - test-packages-chrome-no-numpy-dependents
@ -671,7 +671,7 @@ workflows:
- test-main: - test-main:
name: test-packages-firefox-no-numpy-dependents 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 cache-dir: .pytest_cache_firefox
requires: requires:
- build-packages-no-numpy-dependents - build-packages-no-numpy-dependents
@ -686,7 +686,7 @@ workflows:
- test-main: - test-main:
name: test-packages-firefox 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 cache-dir: .pytest_cache_firefox
requires: requires:
- test-packages-firefox-no-numpy-dependents - test-packages-firefox-no-numpy-dependents
@ -697,7 +697,7 @@ workflows:
- test-main: - test-main:
name: test-packages-node-no-numpy-dependents 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 cache-dir: .pytest_cache_node
requires: requires:
- build-packages-no-numpy-dependents - build-packages-no-numpy-dependents
@ -712,7 +712,7 @@ workflows:
- test-main: - test-main:
name: test-packages-node 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 cache-dir: .pytest_cache_node
requires: requires:
- test-packages-node-no-numpy-dependents - test-packages-node-no-numpy-dependents

View File

@ -41,9 +41,9 @@ jobs:
PYODIDE_ROOT=. pytest \ PYODIDE_ROOT=. pytest \
--junitxml=test-results/junit.xml \ --junitxml=test-results/junit.xml \
--verbose \ --verbose \
--runtime host \ --runtime=host \
--cov=pyodide_build --cov=pyodide \ --cov=pyodide_build --cov=pyodide \
src pyodide-build packages/micropip/ src pyodide-build packages/micropip/ packages/_tests
- uses: codecov/codecov-action@v3 - uses: codecov/codecov-action@v3
with: with:
fail_ci_if_error: true fail_ci_if_error: true
@ -170,7 +170,7 @@ jobs:
ls -lh dist/ ls -lh dist/
tools/pytest_wrapper.py src packages/micropip/ \ tools/pytest_wrapper.py src packages/micropip/ \
-v \ -v \
--runtime "${BROWSER}" \ --runtime="${BROWSER}-no-host" \
--runner "${RUNNER}" \ --runner "${RUNNER}" \
--durations 50 \ --durations 50 \
--junitxml=test-results/core_test.xml --junitxml=test-results/core_test.xml
@ -186,7 +186,7 @@ jobs:
tools/pytest_wrapper.py packages/*/test* \ tools/pytest_wrapper.py packages/*/test* \
-v \ -v \
-k "numpy and not joblib" \ -k "numpy and not joblib" \
--runtime "${BROWSER}" \ --runtime="${BROWSER}-no-host" \
--runner "${RUNNER}" \ --runner "${RUNNER}" \
--durations 50 \ --durations 50 \
--junitxml=test-results/packages_test.xml --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. # 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"): 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 not pytest.pyodide_runtimes: # type: ignore[truthy-bool]
if match: skip_msg = "Not running browser tests"
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."
else: else:
raise AssertionError( match = re.match(
f"Couldn't parse package name from {item.name}. This should not happen!" 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 # TODO: also use this hook to skip doctests we cannot run (or run them
# inside the selenium wrapper) # inside the selenium wrapper)