You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2023/03/17 06:14:22 UTC

[GitHub] [incubator-opendal] Xuanwo opened a new pull request, #1654: feat(tests): Introducing BDD tests for all bindings

Xuanwo opened a new pull request, #1654:
URL: https://github.com/apache/incubator-opendal/pull/1654

   This pull request aims to introduce Behavior-Driven Development (BDD) tests for all of our bindings. It serves as a proof-of-concept and uses the Python binding as an example.
   
   Moving forward, we will maintain the same `feature` file for all bindings. Only when a binding passes all feature tests will it be marked as ready.
   
   Here is an example using Python:
   
   ```shell
   :) behave tests
   Feature: OpenDAL Binding # tests/binding.feature:18
   
     Scenario: OpenDAL Blocking Operations                             # tests/binding.feature:20
       Given A new OpenDAL Blocking Operator                           # tests/steps/binding.py:23 0.000s
       When Blocking write path "test" with content "Hello, World!"    # tests/steps/binding.py:27 0.000s
       Then The blocking file "test" should exist                      # tests/steps/binding.py:31 0.000s
       Then The blocking file "test" entry mode must be file           # tests/steps/binding.py:35 0.000s
       Then The blocking file "test" content length must be "13"       # tests/steps/binding.py:39 0.000s
       Then The blocking file "test" must have content "Hello, World!" # tests/steps/binding.py:43 0.000s
   
     Scenario: OpenDAL Async Operations                             # tests/binding.feature:28
       Given A new OpenDAL Async Operator                           # tests/steps/binding.py:48 0.000s
       When Async write path "test" with content "Hello, World!"    # tests/steps/binding.py:53 0.001s
       Then The async file "test" should exist                      # tests/steps/binding.py:58 0.000s
       Then The async file "test" entry mode must be file           # tests/steps/binding.py:63 0.000s
       Then The async file "test" content length must be "13"       # tests/steps/binding.py:69 0.000s
       Then The async file "test" must have content "Hello, World!" # tests/steps/binding.py:75 0.000s
   
   1 feature passed, 0 failed, 0 skipped
   2 scenarios passed, 0 failed, 0 skipped
   12 steps passed, 0 failed, 0 skipped, 0 undefined
   Took 0m0.002s
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] suyanhanx commented on pull request #1654: feat(tests): Introducing BDD tests for all bindings

Posted by "suyanhanx (via GitHub)" <gi...@apache.org>.
suyanhanx commented on PR #1654:
URL: https://github.com/apache/incubator-opendal/pull/1654#issuecomment-1473303596

   This form of testing is quite good for us. It helps to ensure consistency between various bindings, and reasonably splitting test files provides some guidance for synchronizing the functionality of new bindings.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] Xuanwo commented on pull request #1654: feat(tests): Introducing BDD tests for all bindings

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #1654:
URL: https://github.com/apache/incubator-opendal/pull/1654#issuecomment-1473239606

   For nodejs: https://github.com/cucumber/cucumber-js
   For C: https://github.com/cucumber/cucumber-cpp
   
   In the future, go/lua/java will use their own BDD tests framework.s


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] Xuanwo commented on pull request #1654: feat(tests): Introducing BDD tests for all bindings

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #1654:
URL: https://github.com/apache/incubator-opendal/pull/1654#issuecomment-1473208164

   I would also like to thank the maintainers of cc bindings, @suyanhanx and @messense, for their review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] PsiACE commented on a diff in pull request #1654: feat(tests): Introducing BDD tests for all bindings

Posted by "PsiACE (via GitHub)" <gi...@apache.org>.
PsiACE commented on code in PR #1654:
URL: https://github.com/apache/incubator-opendal/pull/1654#discussion_r1139859638


##########
bindings/python/tests/steps/binding.py:
##########
@@ -0,0 +1,79 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from behave import given, when, then
+from behave.api.async_step import async_run_until_complete
+import asyncio

Review Comment:
   It looks like it is not needed



##########
bindings/python/pyproject.toml:
##########
@@ -32,7 +32,7 @@ readme = "README.md"
 requires-python = ">=3.7"
 
 [project.optional-dependencies]
-test = ["pytest", "pytest-asyncio"]
+test = ["pytest", "pytest-asyncio", "behave"]

Review Comment:
   remove pytest and pytest-asyncio



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] Xuanwo merged pull request #1654: feat(tests): Introducing BDD tests for all bindings

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #1654:
URL: https://github.com/apache/incubator-opendal/pull/1654


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org