This is an automated email from the ASF dual-hosted git repository.

zhongjiajie pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/dolphinscheduler-sdk-python.git


The following commit(s) were added to refs/heads/main by this push:
     new 3366a42  Fix ci lint error (#148)
3366a42 is described below

commit 3366a4285cc3728dd59a0d92b74d1860f390a28b
Author: Jay Chung <[email protected]>
AuthorDate: Thu Jul 4 22:11:34 2024 +0800

    Fix ci lint error (#148)
---
 .github/workflows/ci.yaml           |  1 +
 README.md                           |  2 +-
 docs/source/start.rst               |  9 ++++++---
 tests/integration/conftest.py       |  1 +
 tests/integration/test_project.py   |  2 +-
 tests/integration/test_resources.py |  2 ++
 tests/integration/test_tenant.py    |  2 +-
 tests/integration/test_user.py      |  2 +-
 tests/testing/docker_wrapper.py     | 12 ++++++++++--
 9 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 6a0d58a..f1ac901 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -199,6 +199,7 @@ jobs:
       # Switch to project root directory to run mvnw command
       - name: Build Image
         working-directory: dolphinscheduler
+
         run: |
           ./mvnw -B clean install \
           -Dmaven.test.skip \
diff --git a/README.md b/README.md
index 45fd5e9..34929c3 100644
--- a/README.md
+++ b/README.md
@@ -64,7 +64,7 @@ There are many ways to start DolphinScheduler, here we use 
docker to start and r
 ```shell
 # Change the version of dolphinscheduler to the version you want to use, here 
we use 3.1.1 as example
 DOLPHINSCHEDULER_VERSION=3.1.1
-docker run --name dolphinscheduler-standalone-server -p 12345:12345 -p 
25333:25333 -d 
apache/dolphinscheduler-standalone-server:"${DOLPHINSCHEDULER_VERSION}"
+docker run --name dolphinscheduler-standalone-server -p 12345:12345 -p 
25333:25333 -e API_PYTHON_GATEWAY_ENABLED="true" -d 
apache/dolphinscheduler-standalone-server:"${DOLPHINSCHEDULER_VERSION}"
 ```
 
 After the container is started, you can access the DolphinScheduler UI via 
http://localhost:12345/dolphinscheduler.
diff --git a/docs/source/start.rst b/docs/source/start.rst
index 3c41471..7fcf425 100644
--- a/docs/source/start.rst
+++ b/docs/source/start.rst
@@ -105,6 +105,8 @@ go `install Apache DolphinScheduler`_ for more details
 
 .. code-block:: bash
 
+   # Export the environment variable to enabled python-gateway service
+   export API_PYTHON_GATEWAY_ENABLED="true"
    # Start DolphinScheduler api-server which including python gateway service
    ./bin/dolphinscheduler-daemon.sh start api-server
 
@@ -120,9 +122,10 @@ the server is healthy if keyword `ApiApplicationServer` is 
in the console.
 
 .. note::
 
-   Please make sure you already started Python gateway service along with 
`api-server`. The configuration is in
-   yaml config path `python-gateway.enabled : true` in api-server's 
configuration path in `api-server/conf/application.yaml`.
-   The default value is true and Python gateway service starts when api server 
is started.
+   Please make sure you already started Python gateway service along with 
`api-server`. You can enabled it via
+
+   * Environment: `export API_PYTHON_GATEWAY_ENABLED="true"`
+   * Configuration File: Set `python-gateway.enabled : true` in 
`api-server/conf/application.yaml`
 
 Run an Example
 --------------
diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py
index c15b897..7a962ef 100644
--- a/tests/integration/conftest.py
+++ b/tests/integration/conftest.py
@@ -41,6 +41,7 @@ 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"},
         )
         ports = {"25333/tcp": 25333, "12345/tcp": 12345}
         container = docker_wrapper.run_until_log(
diff --git a/tests/integration/test_project.py 
b/tests/integration/test_project.py
index 167ce2d..7b8d875 100644
--- a/tests/integration/test_project.py
+++ b/tests/integration/test_project.py
@@ -75,4 +75,4 @@ def test_delete_project():
     with pytest.raises(AttributeError) as excinfo:
         _ = project.name
 
-    assert excinfo.type == AttributeError
+    assert excinfo.type is AttributeError
diff --git a/tests/integration/test_resources.py 
b/tests/integration/test_resources.py
index ee1d99d..7d53d8c 100644
--- a/tests/integration/test_resources.py
+++ b/tests/integration/test_resources.py
@@ -45,6 +45,7 @@ def tmp_user():
     user.delete()
 
 
[email protected](reason="Not work for latest code, at Jul 4, 2024")
 def test_create_or_update(tmp_user):
     """Test create or update resource to java gateway."""
     resource = Resource(name=name, content=content, 
user_name=UNIT_TEST_USER_NAME)
@@ -53,6 +54,7 @@ def test_create_or_update(tmp_user):
     assert result.getAlias() == name
 
 
[email protected](reason="Not work for latest code, at Jul 4, 2024")
 def test_get_resource_info(tmp_user):
     """Test get resource info from java gateway."""
     resource = Resource(name=name, user_name=UNIT_TEST_USER_NAME)
diff --git a/tests/integration/test_tenant.py b/tests/integration/test_tenant.py
index c1ec33c..844f8d7 100644
--- a/tests/integration/test_tenant.py
+++ b/tests/integration/test_tenant.py
@@ -83,4 +83,4 @@ def test_delete_tenant():
     with pytest.raises(AttributeError) as excinfo:
         _ = tenant.tenant_id
 
-    assert excinfo.type == AttributeError
+    assert excinfo.type is AttributeError
diff --git a/tests/integration/test_user.py b/tests/integration/test_user.py
index 01e450d..3d649e7 100644
--- a/tests/integration/test_user.py
+++ b/tests/integration/test_user.py
@@ -105,4 +105,4 @@ def test_delete_user():
     with pytest.raises(AttributeError) as excinfo:
         _ = user.user_id
 
-    assert excinfo.type == AttributeError
+    assert excinfo.type is AttributeError
diff --git a/tests/testing/docker_wrapper.py b/tests/testing/docker_wrapper.py
index 70ca98d..8f1a9fb 100644
--- a/tests/testing/docker_wrapper.py
+++ b/tests/testing/docker_wrapper.py
@@ -31,10 +31,13 @@ class DockerWrapper:
     :param image: The image to create docker container.
     """
 
-    def __init__(self, image: str, container_name: str):
+    def __init__(
+        self, image: str, container_name: str, environment: dict | None = None
+    ):
         self._client = docker.from_env()
         self.image = image
         self.container_name = container_name
+        self.environment = environment
 
     def run(self, *args, **kwargs) -> Container:
         """Create and run a new container.
@@ -46,7 +49,12 @@ class DockerWrapper:
         if not self.images_exists:
             raise ValueError("Docker image named %s do not exists.", 
self.image)
         return self._client.containers.run(
-            image=self.image, name=self.container_name, detach=True, *args, 
**kwargs
+            image=self.image,
+            name=self.container_name,
+            detach=True,
+            environment=self.environment,
+            *args,
+            **kwargs,
         )
 
     def run_until_log(

Reply via email to