Skip to content

Commit b31004a

Browse files
committed
fix(bindings/dotnet): fix behavior tests by updating scripts and Cargo.toml
1 parent f0aa6bb commit b31004a

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

.github/actions/test_behavior_binding_dotnet/action.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ runs:
4343
working-directory: bindings/dotnet
4444
run: |
4545
cargo build
46-
dotnet test --filter "FullyQualifiedName~Behavior" -f net10.0
46+
# Some services export RUST_TEST_THREADS=1 from fixture setup (for lock-sensitive backends).
47+
# Align dotnet test worker count with that signal instead of hard-coding service names.
48+
if [ "${RUST_TEST_THREADS:-}" = "1" ]; then
49+
dotnet test --filter "FullyQualifiedName~Behavior" -f net10.0 -- RunConfiguration.MaxCpuCount=1
50+
else
51+
dotnet test --filter "FullyQualifiedName~Behavior" -f net10.0
52+
fi
4753
env:
4854
OPENDAL_TEST: ${{ inputs.service }}
4955
EOF

.github/scripts/test_behavior/plan.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,14 @@ def generate_language_binding_cases(
275275
"rocksdb",
276276
]]
277277

278+
# Remove invalid cases for dotnet.
279+
if language == "dotnet":
280+
cases = [v for v in cases if v["service"] not in [
281+
"hdfs",
282+
"hdfs_native",
283+
"rocksdb",
284+
]]
285+
278286
if os.getenv("GITHUB_IS_PUSH") == "true":
279287
return cases
280288

bindings/dotnet/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ opendal = { version = ">=0", path = "../../core", features = [
6060
"services-webhdfs",
6161
"services-aliyun-drive",
6262
"services-cacache",
63+
"services-compfs",
6364
"services-dashmap",
6465
"services-dropbox",
6566
"services-etcd",
@@ -100,3 +101,7 @@ opendal = { version = ">=0", path = "../../core", features = [
100101
"services-yandex-disk",
101102
] }
102103
tokio = { version = "1.49.0", features = ["full"] }
104+
105+
[target.'cfg(unix)'.dependencies]
106+
# Some backends are unix-only in current dependency stack, so only enable them on unix targets.
107+
opendal = { version = ">=0", path = "../../core", features = ["services-monoiofs", "services-sftp"] }

0 commit comments

Comments
 (0)