Xuanwo commented on code in PR #3129:
URL:
https://github.com/apache/incubator-opendal/pull/3129#discussion_r1332627423
##########
.github/workflows/bindings_java.yml:
##########
@@ -84,8 +84,5 @@ jobs:
#
https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
shell: bash
run: |
- if [[ "${{ runner.os }}" != Linux ]]; then
- export NO_DOCKER=true
- fi
./mvnw clean install -DskipTests
-Dcargo-build.features=services-redis
- ./mvnw verify artifact:compare -Dcargo-build.features=services-redis
+ ./mvnw verify artifact:compare -DOPENDAL_TEST_SCHEMA=redis
-Dcargo-build.features=services-redis
Review Comment:
We don't need to run test in binding_java.
##########
.github/workflows/service_test_redis.yml:
##########
@@ -192,3 +192,26 @@ jobs:
OPENDAL_REDIS_ENDPOINT: tcp://127.0.0.1:6379
OPENDAL_REDIS_ROOT: /
OPENDAL_REDIS_DB: 0
+
+ binding_java_redis:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Setup Rust toolchain
+ uses: ./.github/actions/setup
+
+ - name: Setup Redis Server
+ shell: bash
+ working-directory: fixtures/redis
+ run: docker-compose -f docker-compose-redis.yml up -d
+
+ - name: Test
+ shell: bash
+ working-directory: bindings/java
+ run: ./mvnw test -Dtest=org.apache.opendal.OperatorTest
-DOPENDAL_TEST_SCHEMA=redis -Dcargo-build.features=services-redis
Review Comment:
Maybe we don't need to specify `-DOPENDAL_TEST_SCHEMA=redis`?
##########
bindings/java/src/test/java/org/apache/opendal/OperatorTest.java:
##########
@@ -21,55 +21,175 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import java.nio.file.Path;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.Optional;
+import java.util.UUID;
import java.util.stream.Collectors;
-import lombok.Cleanup;
import org.apache.opendal.condition.OpenDALExceptionCondition;
+import org.apache.opendal.utils.Utils;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.io.TempDir;
public class OperatorTest {
- @TempDir
- private static Path tempDir;
+
+ private static final String SCHEMA_KEY = "OPENDAL_TEST_SCHEMA";
Review Comment:
We need to support running muliple services test at the same time. Please
init all services that `OPENDAL_<SERVICE>_ON` is true.
##########
bindings/java/src/main/java/org/apache/opendal/Operator.java:
##########
@@ -142,6 +142,11 @@ public CompletableFuture<String> read(String path) {
return AsyncRegistry.take(requestId);
}
+ public CompletableFuture<OperatorInfo> info() {
Review Comment:
This API is a blocking call, we don't need to wrap with future.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]