Skip to content

test: refactor webui test flow

Yaroslav Dynnikov requested to merge rosik/debug-error-injection into master

Summary

  • chore: align usage of config.getoption in pytest
  • chore: more error injection logs
  • test: refactor webui test flow

Having two different fixtures binary_path and path_to_binary_with_webui results in weird failures in CI:

FAILED test/int/test_couple.py::test_exit_after_apply - conftest.TarantoolError:
    ('ER_NO_SUCH_PROC', "Procedure 'pico._inject_error' is not defined")

The root cause is that one cargo build overrides another with different features enabled. To resolve the issue this patch significantly refactors the test flow:

  1. Web UI tests are skipped by default. One can enable it explicitly with pytest --with-webui

  2. New fixture cargo_build behavior depends on environment:

    • In local dev environment it rebuilds the project with required features
    • In CI it skips rebuilding and runs tests against the existing build
  3. The path_to_binary_with_webui fixture is removed.

See also:

Close #435 (closed)

How it looks like

$ pytest -k http_server

test/int/test_http_server.py::test_http_routes PASSED
test/int/test_http_server.py::test_webui SKIPPED (run: pytest --with-webui)
$ pytest -k http_server --with-webui

test/int/test_http_server.py::test_http_routes PASSED
test/int/test_http_server.py::test_webui PASSED
$ cargo b
$ CI=true pytest -k http_server --with-webui

test/int/test_http_server.py::test_http_routes PASSED
test/int/test_http_server.py::test_webui FAILED

Ensure that

  • New code is covered by tests
  • API is documented
  • Changelog is up to date
  • (if Lua API changed) Lua API version is bumped in luamod.rs
  • (if necessary) A follow-up doc issue is created in picodata/docs and linked here
Edited by Yaroslav Dynnikov

Merge request reports