Skip to content

Commit

Permalink
chore: Fix bindings CI (#3722)
Browse files Browse the repository at this point in the history
* chore: Fix bindings CI

Signed-off-by: Xuanwo <[email protected]>

* Fix test

Signed-off-by: Xuanwo <[email protected]>

---------

Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo authored Dec 7, 2023
1 parent 0920ac3 commit a8d5848
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 44 deletions.
8 changes: 0 additions & 8 deletions bindings/cpp/tests/basic_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@ TEST_F(OpendalTest, BasicTest) {
op.create_dir(dir_path);
EXPECT_TRUE(op.is_exist(dir_path));

// copy
op.copy(file_path, file_path_copied);
EXPECT_TRUE(op.is_exist(file_path_copied));

// rename
op.rename(file_path_copied, file_path_renamed);
EXPECT_TRUE(op.is_exist(file_path_renamed));

// stat
auto metadata = op.stat(file_path);
EXPECT_EQ(metadata.type, opendal::EntryMode::FILE);
Expand Down
24 changes: 1 addition & 23 deletions bindings/haskell/test/BasicTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,11 @@ testRawOperation = do
isExistOpRaw op "key2" ?= Right True
createDirOpRaw op "dir1/" ?= Right ()
isExistOpRaw op "dir1/" ?= Right True
copyOpRaw op "key1" "key3" ?= Right ()
isExistOpRaw op "key1" ?= Right True
isExistOpRaw op "key3" ?= Right True
renameOpRaw op "key2" "key4" ?= Right ()
isExistOpRaw op "key2" ?= Right False
isExistOpRaw op "key4" ?= Right True
statOpRaw op "key1" >>= \case
Right meta -> meta @?= except_meta
Left _ -> assertFailure "should not reach here"
deleteOpRaw op "key1" ?= Right ()
isExistOpRaw op "key1" ?= Right False
Right lister <- listOpRaw op "/"
liftIO $ findLister lister "key3" ?= True
renameOpRaw op "key3" "/dir1/key5" ?= Right ()
Right lister2 <- scanOpRaw op "/"
liftIO $ findLister lister2 "dir1/key5" ?= True
where
except_meta =
Metadata
Expand Down Expand Up @@ -89,20 +78,9 @@ testMonad = do
isExistOp "key2" ?= True
createDirOp "dir1/"
isExistOp "dir1/" ?= True
copyOp "key1" "key3"
isExistOp "key1" ?= True
isExistOp "key3" ?= True
renameOp "key2" "key4"
isExistOp "key2" ?= False
isExistOp "key4" ?= True
statOp "key1" ?= except_meta
deleteOp "key1"
isExistOp "key1" ?= False
lister <- listOp "/"
liftIO $ findLister lister "key3" ?= True
renameOp "key3" "/dir1/key5"
lister2 <- scanOp "/"
liftIO $ findLister lister2 "dir1/key5" ?= True
except_meta =
Metadata
{ mMode = File,
Expand Down Expand Up @@ -144,4 +122,4 @@ findLister lister key = do
case res of
Left _ -> return False
Right Nothing -> return False
Right (Just k) -> if k == key then return True else findLister lister key
Right (Just k) -> if k == key then return True else findLister lister key
4 changes: 0 additions & 4 deletions bindings/lua/test/opendal_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ describe("opendal unit test", function()
local res, err = op:read("test.txt")
assert.is_nil(err)
assert.are.equal(res, "hello world")
assert.is_nil(op:rename("test.txt", "test_1.txt"))
assert.equal(op:is_exist("test_1.txt"), true)
assert.equal(op:is_exist("test.txt"), false)
assert.equal(op:is_exist("test_1.txt"), true)
assert.is_nil(op:delete("test_1.txt"))
assert.equal(op:is_exist("test_1.txt"), false)
end)
Expand Down
9 changes: 0 additions & 9 deletions bindings/ocaml/test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ let test_block_write_and_read test_ctxt =
assert_equal "helloworld"
(data |> Array.to_seq |> Bytes.of_seq |> Bytes.to_string)

let test_copy_and_read test_ctxt =
let bo = new_test_block_operator test_ctxt in
let data = "helloworld" in
ignore (test_check_result (Operator.write bo "foo" (Bytes.of_string data)));
ignore (test_check_result (Operator.copy bo "foo" "bar"));
let got_res = test_check_result (Operator.read bo "bar") in
assert_equal data (got_res |> Array.to_seq |> Bytes.of_seq |> Bytes.to_string)

let test_operator_reader test_ctxt =
let bo = new_test_block_operator test_ctxt in
ignore
Expand Down Expand Up @@ -105,7 +97,6 @@ let suite =
"test_new_block_operator" >:: test_new_block_operator;
"test_create_dir_and_remove_all" >:: test_create_dir_and_remove_all;
"test_block_write_and_read" >:: test_block_write_and_read;
"test_copy_and_read" >:: test_copy_and_read;
"test_operator_reader" >:: test_operator_reader;
"test_operator_stat" >:: test_operator_stat;
"test_list" >:: test_list;
Expand Down

0 comments on commit a8d5848

Please sign in to comment.