Skip to content

Commit a999364

Browse files
authored
CI: update os version and fix integrate test error (#165)
1 parent 4f80133 commit a999364

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,21 @@ jobs:
7777
# YAML parse `3.10` to `3.1`, so we have to add quotes for `'3.10'`, see also:
7878
# https://github.com/actions/setup-python/issues/160#issuecomment-724485470
7979
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
80-
# 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
81-
os: [ubuntu-20.04, macOS-latest, windows-latest]
80+
os: [ubuntu-latest, macOS-latest, windows-latest]
8281
exclude:
8382
# Skip because dependence [py4j](https://pypi.org/project/py4j/) not work on those environments
8483
- os: windows-latest
8584
python-version: '3.10'
8685
- os: windows-latest
87-
python-version: 3.11
86+
python-version: '3.11'
8887
- os: windows-latest
89-
python-version: 3.12
88+
python-version: '3.12'
9089
# Python 3.9 is on macos-13 but not macos-latest (macos-14-arm64)
9190
# https://github.com/actions/setup-python/issues/696#issuecomment-1637587760
9291
- os: macos-latest
93-
python-version: 3.9
92+
python-version: '3.9'
9493
include:
95-
- python-version: 3.9
94+
- python-version: '3.9'
9695
os: macos-13
9796
steps:
9897
- uses: actions/checkout@v3

setup.cfg

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ long_description = file: README.md
2424
long_description_content_type = text/markdown
2525
author = Apache Software Foundation
2626
author_email = [email protected]
27-
license = Apache License 2.0
27+
license = Apache-2.0
2828
license_files =
29-
file: LICENSE
29+
LICEN[CS]E*
3030
keywords =
3131
dolphinscheduler
3232
workflow
@@ -37,7 +37,6 @@ classifiers =
3737
Development Status :: 4 - Beta
3838
Environment :: Console
3939
Intended Audience :: Developers
40-
License :: OSI Approved :: Apache Software License
4140
Operating System :: Unix
4241
Operating System :: POSIX
4342
Operating System :: Microsoft :: Windows

tests/integration/conftest.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@
1717

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

20+
import logging
2021
import os
2122

2223
import pytest
2324

2425
from tests.testing.docker_wrapper import DockerWrapper
2526

27+
logger = logging.getLogger(__name__)
28+
2629

2730
@pytest.fixture(scope="package", autouse=True)
2831
def docker_setup_teardown():
@@ -41,12 +44,21 @@ def docker_setup_teardown():
4144
docker_wrapper = DockerWrapper(
4245
image="apache/dolphinscheduler-standalone-server:ci",
4346
container_name="ci-dolphinscheduler-standalone-server",
44-
environment={"API_PYTHON_GATEWAY_ENABLED": "true"},
47+
environment={
48+
"API_PYTHON_GATEWAY_ENABLED": "true",
49+
"MASTER_SERVER_LOAD_PROTECTION_ENABLED": "false",
50+
"WORKER_SERVER_LOAD_PROTECTION_ENABLED": "false",
51+
},
4552
)
4653
ports = {"25333/tcp": 25333, "12345/tcp": 12345}
4754
container = docker_wrapper.run_until_log(
4855
log="Started StandaloneServer in", tty=True, ports=ports
4956
)
5057
assert container is not None
5158
yield
59+
container_logs = container.logs()
60+
logger.info(
61+
"Finished integration tests run, Container logs: %s",
62+
container_logs.decode("utf-8"),
63+
)
5264
docker_wrapper.remove_container()

tests/testing/docker_wrapper.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
"""Wrap docker commands for easier create docker container."""
1919
from __future__ import annotations
2020

21+
import logging
2122
import time
2223

2324
import docker
2425
from docker.errors import ImageNotFound
2526
from docker.models.containers import Container
2627

28+
logger = logging.getLogger(__name__)
29+
2730

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

75-
timeout_threshold = 10 * 60
78+
timeout_threshold = 5 * 60
7679
start_time = time.time()
7780
while time.time() <= start_time + timeout_threshold:
7881
if log_byte in container.logs(tail=1000):
7982
break
8083
time.sleep(2)
8184
# Stop container and raise error when reach timeout threshold but do not appear specific log output
8285
else:
86+
container_log = container.logs()
87+
logger.error(
88+
"Cannot find specific log `%s` in %d seconds, the whole log as below",
89+
log,
90+
timeout_threshold,
91+
)
92+
logger.error(container_log.decode("utf-8"))
93+
8394
container.remove(force=True)
8495
raise RuntimeError(
8596
"Can not capture specific log `%s` in %d seconds, remove container.",

0 commit comments

Comments
 (0)