Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(bindings/java): split behavior tests #3332

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/bindings_java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,15 @@ jobs:
run: |
./mvnw clean install -DskipTests
./mvnw verify artifact:compare
- name: Behavior tests
working-directory: bindings/java
shell: bash
run: |
export OPENDAL_TEST=memory
export OPENDAL_MEMORY_ROOT=/opendal
./mvnw test -Dtest="behavior.*Test"

export OPENDAL_TEST=fs
export OPENDAL_FS_ROOT=/tmp
./mvnw test -Dtest="behavior.*Test"

2 changes: 1 addition & 1 deletion .github/workflows/service_test_redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ jobs:
- name: Test
shell: bash
working-directory: bindings/java
run: ./mvnw test -Dtest=ServiceBehaviorTest -Dcargo-build.features=services-redis
run: ./mvnw test -Dtest="behavior.*Test" -Dcargo-build.features=services-redis
env:
OPENDAL_TEST: redis
OPENDAL_REDIS_ENDPOINT: tcp://127.0.0.1:6379
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/service_test_s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ jobs:
- name: Test
shell: bash
working-directory: bindings/java
run: ./mvnw test -Dtest=ServiceBehaviorTest
run: ./mvnw test -Dtest="behavior.*Test"
env:
OPENDAL_TEST: s3
OPENDAL_S3_BUCKET: test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.apache.opendal.test;

import static org.apache.opendal.test.behavior.BehaviorTestBase.generateBytes;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.nio.file.Path;
Expand All @@ -28,7 +29,6 @@
import org.apache.opendal.BlockingOperator;
import org.apache.opendal.Metadata;
import org.apache.opendal.Operator;
import org.apache.opendal.test.behavior.AbstractBehaviorTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

Expand All @@ -42,13 +42,13 @@ public void testAsyncMetadata() {
conf.put("root", tempDir.toString());

try (final Operator op = Operator.of("fs", conf)) {
final String dir = String.format("%s/", UUID.randomUUID().toString());
final String dir = UUID.randomUUID() + "/";
op.createDir(dir).join();
final Metadata dirMetadata = op.stat(dir).join();
assertTrue(dirMetadata.isDir());

final String path = UUID.randomUUID().toString();
final byte[] content = AbstractBehaviorTest.generateBytes();
final byte[] content = generateBytes();
op.write(path, content).join();

final Metadata metadata = op.stat(path).join();
Expand All @@ -73,13 +73,13 @@ public void testBlockingMetadata() {
conf.put("root", tempDir.toString());

try (final BlockingOperator op = BlockingOperator.of("fs", conf)) {
final String dir = String.format("%s/", UUID.randomUUID().toString());
final String dir = UUID.randomUUID() + "/";
op.createDir(dir);
final Metadata dirMetadata = op.stat(dir);
assertTrue(dirMetadata.isDir());

final String path = UUID.randomUUID().toString();
final byte[] content = AbstractBehaviorTest.generateBytes();
final byte[] content = generateBytes();
op.write(path, content);

final Metadata metadata = op.stat(path);
Expand Down
Loading