This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
The following commit(s) were added to refs/heads/main by this push:
new f1035eae6 test(binding/java): grouping tests with tag (#3271)
f1035eae6 is described below
commit f1035eae65d5d087085900c2806c191d4cd5dbd3
Author: G-XD <[email protected]>
AuthorDate: Fri Oct 13 16:52:02 2023 +0800
test(binding/java): grouping tests with tag (#3271)
* test(binding/java): grouping tests with tag
* test(binding/java): rename test tag
---
.github/workflows/service_test_redis.yml | 2 +-
.github/workflows/service_test_s3.yml | 2 +-
bindings/java/README.md | 12 ++++++++++++
.../apache/opendal/test/behavior/ServiceBehaviorTests.java | 5 +++++
4 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/service_test_redis.yml
b/.github/workflows/service_test_redis.yml
index 0d06763d1..70daf3cbb 100644
--- a/.github/workflows/service_test_redis.yml
+++ b/.github/workflows/service_test_redis.yml
@@ -210,7 +210,7 @@ jobs:
- name: Test
shell: bash
working-directory: bindings/java
- run: ./mvnw test -Dtest=org.apache.opendal.test.behavior.RedisTest
-Dcargo-build.features=services-redis
+ run: ./mvnw test -Dgroups="services_redis"
-Dcargo-build.features=services-redis
env:
OPENDAL_REDIS_TEST: on
OPENDAL_REDIS_ENDPOINT: tcp://127.0.0.1:6379
diff --git a/.github/workflows/service_test_s3.yml
b/.github/workflows/service_test_s3.yml
index 95f703ab7..423efab0a 100644
--- a/.github/workflows/service_test_s3.yml
+++ b/.github/workflows/service_test_s3.yml
@@ -241,7 +241,7 @@ jobs:
- name: Test
shell: bash
working-directory: bindings/java
- run: ./mvnw test -Dtest=org.apache.opendal.test.behavior.S3Test
+ run: ./mvnw test -Dgroups="services_s3"
env:
OPENDAL_S3_TEST: on
OPENDAL_S3_BUCKET: test
diff --git a/bindings/java/README.md b/bindings/java/README.md
index 48caad9dc..5a7596e03 100644
--- a/bindings/java/README.md
+++ b/bindings/java/README.md
@@ -126,8 +126,20 @@ You can run service tests of enabled with the following
command:
./mvnw test -Dtest=org.apache.opendal.behavior.FsTest # replace with the
certain service tests
```
+Or:
+
+```shell
+./mvnw test -Dgroups="services_fs" # replace with the certain service tests
+```
+
Remember to enable the necessary features via
`-Dcargo-build.features=services-xxx` when running specific service test:
```shell
./mvnw test -Dtest=org.apache.opendal.behavior.RedisTest
-Dcargo-build.features=services-redis
```
+
+Or:
+
+```shell
+./mvnw test -Dgroups="services_redis" -Dcargo-build.features=services-redis
+```
diff --git
a/bindings/java/src/test/java/org/apache/opendal/test/behavior/ServiceBehaviorTests.java
b/bindings/java/src/test/java/org/apache/opendal/test/behavior/ServiceBehaviorTests.java
index da47fdfea..c8154419a 100644
---
a/bindings/java/src/test/java/org/apache/opendal/test/behavior/ServiceBehaviorTests.java
+++
b/bindings/java/src/test/java/org/apache/opendal/test/behavior/ServiceBehaviorTests.java
@@ -23,8 +23,10 @@ import java.io.File;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.assertj.core.util.Files;
+import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.condition.EnabledIf;
+@Tag("services_memory")
@Slf4j
class MemoryTest extends AbstractBehaviorTest {
public MemoryTest() {
@@ -43,6 +45,7 @@ class MemoryTest extends AbstractBehaviorTest {
}
}
+@Tag("services_fs")
@Slf4j
class FsTest extends AbstractBehaviorTest {
public FsTest() {
@@ -64,6 +67,7 @@ class FsTest extends AbstractBehaviorTest {
}
}
+@Tag("services_redis")
@EnabledIf("enabled")
class RedisTest extends AbstractBehaviorTest {
public RedisTest() {
@@ -75,6 +79,7 @@ class RedisTest extends AbstractBehaviorTest {
}
}
+@Tag("services_s3")
@EnabledIf("enabled")
class S3Test extends AbstractBehaviorTest {
public S3Test() {