feat(adapters-kv): add rename and copy support to kv adapters#2513
Merged
Xuanwo merged 2 commits intoapache:mainfrom Jun 23, 2023
Merged
feat(adapters-kv): add rename and copy support to kv adapters#2513Xuanwo merged 2 commits intoapache:mainfrom
Xuanwo merged 2 commits intoapache:mainfrom
Conversation
Member
Author
|
@tisonkun @kassane It seems the zig fmt error is unexpected, Can you help me take a look? And in main branch, zig test is still failed |
Contributor
|
Zig changed API -@enumToInt(Code.OK))
+@intFromEnum(Code.OK)) |
Member
Author
|
@kassane Maybe we need to pin zig toolchain version in CI 😆, The lack of a stable ABI can be troublesome at times. |
Contributor
Await 0.11.0 release. |
Member
Author
|
@kassane Would you mind helping us to fix this error by opening another PR? or I can fix it in the current PR. |
Contributor
|
try: diff --git a/bindings/zig/test/bdd.zig b/bindings/zig/test/bdd.zig
index c998454c..79748fa3 100644
--- a/bindings/zig/test/bdd.zig
+++ b/bindings/zig/test/bdd.zig
@@ -62,16 +62,16 @@ test "Opendal BDD test" {
.len = std.mem.len(testkit.content),
};
const code = opendal.c.opendal_operator_blocking_write(testkit.p, testkit.path, data);
- try testing.expectEqual(code, @enumToInt(Code.OK));
+ try testing.expectEqual(code, @intFromEnum(Code.OK));
// The blocking file "test" should exist
var e: opendal.c.opendal_result_is_exist = opendal.c.opendal_operator_is_exist(testkit.p, testkit.path);
- try testing.expectEqual(e.code, @enumToInt(Code.OK));
+ try testing.expectEqual(e.code, @intFromEnum(Code.OK));
try testing.expect(e.is_exist);
// The blocking file "test" entry mode must be file
var s: opendal.c.opendal_result_stat = opendal.c.opendal_operator_stat(testkit.p, testkit.path);
- try testing.expectEqual(s.code, @enumToInt(Code.OK));
+ try testing.expectEqual(s.code, @intFromEnum(Code.OK));
var meta: [*c]opendal.c.opendal_metadata = s.meta;
try testing.expect(opendal.c.opendal_metadata_is_file(meta));
@@ -82,7 +82,7 @@ test "Opendal BDD test" {
// The blocking file "test" must have content "Hello, World!"
var r: opendal.c.opendal_result_read = opendal.c.opendal_operator_blocking_read(testkit.p, testkit.path);
defer opendal.c.opendal_bytes_free(r.data);
- try testing.expect(r.code == @enumToInt(Code.OK));
+ try testing.expect(r.code == @intFromEnum(Code.OK));
try testing.expectEqual(std.mem.len(testkit.content), r.data.*.len);
var count: usize = 0;Testing➜ zig build test --summary all
make: Entrando no diretório '/home/kassane/Documentos/incubator-opendal/bindings/c'
mkdir -p ./build
cargo build
Finished dev [unoptimized + debuginfo] target(s) in 0.10s
make: Saindo do diretório '/home/kassane/Documentos/incubator-opendal/bindings/c'
Build Summary: 4/4 steps succeeded; 2/2 tests passed
test success
├─ run make success 143ms MaxRSS:55M
└─ run test 2 passed 1ms MaxRSS:10M
└─ zig test Debug native success 1s MaxRSS:816M
➜ zig git:(main) ✗ zig version
0.11.0-dev.3771+128fd7dd0 |
Signed-off-by: owl <ouyangjun1999@gmail.com>
Signed-off-by: owl <ouyangjun1999@gmail.com>
2a7a0ce to
8b231a0
Compare
Member
Author
|
I have squashed my commit, So maybe we merge it no need to squash it. And thanks @kassane |
This was referenced Jun 23, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add rename and copy support to kv adapters, it will bring kv base services to rename and copy capability