12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- """py.test conftest.py file for package integration test."""
- import pytest
- from tests.testing.docker_wrapper import DockerWrapper
- @pytest.fixture(scope="package", autouse=True)
- def docker_setup_teardown():
- """Fixture for whole package tests, Set up and teardown docker env.
- Fixture in file named ``conftest.py`` with ``scope=package`` could be auto import in the
- whole package, and with attribute ``autouse=True`` will be auto-use for each test cases.
- .. seealso::
- For more information about conftest.py see:
- https://docs.pytest.org/en/latest/example/simple.html#package-directory-level-fixtures-setups
- """
- docker_wrapper = DockerWrapper(
- image="apache/dolphinscheduler-standalone-server:ci",
- container_name="ci-dolphinscheduler-standalone-server",
- )
- ports = {"25333/tcp": 25333}
- container = docker_wrapper.run_until_log(
- log="Started StandaloneServer in", tty=True, ports=ports
- )
- assert container is not None
- yield
- docker_wrapper.remove_container()
|