Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 5 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,21 @@ jobs:
# YAML parse `3.10` to `3.1`, so we have to add quotes for `'3.10'`, see also:
# https://github.com/actions/setup-python/issues/160#issuecomment-724485470
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
# FIXME: temp change os to ubuntu-20.04 to fix python can not found error https://github.com/actions/setup-python/issues/162#issuecomment-1325307787
os: [ubuntu-20.04, macOS-latest, windows-latest]
os: [ubuntu-latest, macOS-latest, windows-latest]
exclude:
# Skip because dependence [py4j](https://pypi.org/project/py4j/) not work on those environments
- os: windows-latest
python-version: '3.10'
- os: windows-latest
python-version: 3.11
python-version: '3.11'
- os: windows-latest
python-version: 3.12
python-version: '3.12'
# Python 3.9 is on macos-13 but not macos-latest (macos-14-arm64)
# https://github.com/actions/setup-python/issues/696#issuecomment-1637587760
- os: macos-latest
python-version: 3.9
python-version: '3.9'
include:
- python-version: 3.9
- python-version: '3.9'
os: macos-13
steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 2 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ long_description = file: README.md
long_description_content_type = text/markdown
author = Apache Software Foundation
author_email = dev@dolphinscheduler.apache.org
license = Apache License 2.0
license = Apache-2.0
license_files =
file: LICENSE
LICEN[CS]E*
keywords =
dolphinscheduler
workflow
Expand All @@ -37,7 +37,6 @@ classifiers =
Development Status :: 4 - Beta
Environment :: Console
Intended Audience :: Developers
License :: OSI Approved :: Apache Software License
Operating System :: Unix
Operating System :: POSIX
Operating System :: Microsoft :: Windows
Expand Down
14 changes: 13 additions & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@

"""py.test conftest.py file for package integration test."""

import logging
import os

import pytest

from tests.testing.docker_wrapper import DockerWrapper

logger = logging.getLogger(__name__)


@pytest.fixture(scope="package", autouse=True)
def docker_setup_teardown():
Expand All @@ -41,12 +44,21 @@ def docker_setup_teardown():
docker_wrapper = DockerWrapper(
image="apache/dolphinscheduler-standalone-server:ci",
container_name="ci-dolphinscheduler-standalone-server",
environment={"API_PYTHON_GATEWAY_ENABLED": "true"},
environment={
"API_PYTHON_GATEWAY_ENABLED": "true",
"MASTER_SERVER_LOAD_PROTECTION_ENABLED": "false",
"WORKER_SERVER_LOAD_PROTECTION_ENABLED": "false",
},
)
ports = {"25333/tcp": 25333, "12345/tcp": 12345}
container = docker_wrapper.run_until_log(
log="Started StandaloneServer in", tty=True, ports=ports
)
assert container is not None
yield
container_logs = container.logs()
logger.info(
"Finished integration tests run, Container logs: %s",
container_logs.decode("utf-8"),
)
docker_wrapper.remove_container()
13 changes: 12 additions & 1 deletion tests/testing/docker_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@
"""Wrap docker commands for easier create docker container."""
from __future__ import annotations

import logging
import time

import docker
from docker.errors import ImageNotFound
from docker.models.containers import Container

logger = logging.getLogger(__name__)


class DockerWrapper:
"""Wrap docker commands for easier create docker container.
Expand Down Expand Up @@ -72,14 +75,22 @@ def run_until_log(
log_byte = str.encode(log)
container = self.run(*args, **kwargs)

timeout_threshold = 10 * 60
timeout_threshold = 5 * 60
start_time = time.time()
while time.time() <= start_time + timeout_threshold:
if log_byte in container.logs(tail=1000):
break
time.sleep(2)
# Stop container and raise error when reach timeout threshold but do not appear specific log output
else:
container_log = container.logs()
logger.error(
"Cannot find specific log `%s` in %d seconds, the whole log as below",
log,
timeout_threshold,
)
logger.error(container_log.decode("utf-8"))

container.remove(force=True)
raise RuntimeError(
"Can not capture specific log `%s` in %d seconds, remove container.",
Expand Down
Loading