diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9d1b94e..4d281f6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/setup.cfg b/setup.cfg index 992e2cb..e76e8ea 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 @@ -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 diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 7a962ef..cf17afb 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -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(): @@ -41,7 +44,11 @@ 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( @@ -49,4 +56,9 @@ def docker_setup_teardown(): ) 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() diff --git a/tests/testing/docker_wrapper.py b/tests/testing/docker_wrapper.py index 8f1a9fb..ce8ba0c 100644 --- a/tests/testing/docker_wrapper.py +++ b/tests/testing/docker_wrapper.py @@ -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. @@ -72,7 +75,7 @@ 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): @@ -80,6 +83,14 @@ def run_until_log( 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.",