kingsword09 opened a new issue, #6279:
URL: https://github.com/apache/opendal/issues/6279
### Describe the bug
Running `./make_test.sh` resulted in the following error:
```shell
opendal/bindings/c/target/debug/libopendal_c.dylib : 21.48% ( 13.2 MiB =>
2.85 MiB,
/Users/xx/xx/opendal_workspace/opendal-go-services/libopendal_c_latest_fs_darwin/libopendal_c.darwin.dylib.zst)
panic: create operator must succeed: 1 Unsupported (permanent) at , context:
{ scheme: fs } => scheme is not enabled or supported
goroutine 1 [running]:
opendal_test_test.TestMain(0x14000242820)
/Users/xx/xx/opendal_workspace/opendal/bindings/go/tests/behavior_tests/opendal_test.go:47
+0x90
main.main()
_testmain.go:63 +0x98
FAIL opendal_test 1.393s
FAIL
```
Is there a step I'm missing? @yuchanns
### Steps to Reproduce
```bash
mkdir opendal_workspace
cd opendal_workspace
git clone --depth 1
[[email protected]:](mailto:[email protected]:)apache/opendal.git
git clone --depth 1
[[email protected]:](mailto:[email protected]:)apache/opendal-go-services.git
go work init
go work use ./opendal/bindings/go
go work use ./opendal/bindings/go/tests/behavior_tests
# use the backend you want to test, e.g., fs or memory
go work use ./opendal-go-services/fs
# go work use ./opendal-go-services/memory
cat <<EOF > ./make_test.sh
#!/bin/bash
# Check if OPENDAL_TEST is set
if [ -z "$OPENDAL_TEST" ]; then
echo "Error: OPENDAL_TEST environment variable is not set"
echo "Please set OPENDAL_TEST to specify which backend to test (e.g., fs
or memory)"
exit 1
fi
# Specify the backend to test
export SERVICE="$OPENDAL_TEST"
# Get architecture
architecture=$(uname -m)
if [ "$architecture" = "x86_64" ]; then
ARCH="amd64"
GOARCH="amd64"
elif [ "$architecture" = "aarch64" ] || [ "$architecture" = "arm64" ]; then
ARCH="arm64"
GOARCH="arm64"
else
ARCH="unknown"
fi
# Build opendal
cd opendal/bindings/c
cargo build
cd -
# Set environment variables
export GITHUB_WORKSPACE="$PWD/opendal-go-services"
export VERSION="latest"
export TARGET="darwin"
export DIR="$GITHUB_WORKSPACE/libopendal_c_${VERSION}_${SERVICE}_${TARGET}"
# Create directory if not exists
mkdir -p "$DIR"
export OUTPUT="$DIR/libopendal_c.$TARGET.dylib.zst"
# Compress with zstd
zstd -19 opendal/bindings/c/target/debug/libopendal_c.dylib -o $OUTPUT
# Set environment variables for test
export MATRIX='{"build": [{"target":"'$TARGET'", "goos":"'$TARGET'",
"goarch": "'$GOARCH'"}], "service": ["'$SERVICE'"]}'
# Generate code
cd opendal-go-services/internal/generate
go run generate.go
cd -
# Delete unnecessary files
rm -rf $DIR
# Run tests
CGO_LDFLAGS="-L/opt/homebrew/opt/libffi/lib
-Wl,-rpath,/opt/homebrew/opt/libffi/lib" \
CGO_CFLAGS="-I/opt/homebrew/opt/libffi/include" \
go test -ldflags="-linkmode external"
./opendal/bindings/go/tests/behavior_tests -v -run TestBehavior
```
<br/>
To build and run tests, run the following commands:
```bash
cd opendal_workspace
# specify the backend to test
export OPENDAL_TEST=fs
export OPENDAL_FS_ROOT=/tmp/opendal
# build the C binding and run the tests
./make_test.sh
cd -
```
### Expected Behavior
test success
### Additional Context
_No response_
### Are you willing to submit a PR to fix this bug?
- [ ] Yes, I would like to submit a PR.
--
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]