Skip to content

Commit ed27e1d

Browse files
authored
Add unit tests for NativeParquetWriter [Rust] (#20135)
* Add tests for NativeParquetWriter * Run Rust UTs in E2E tests
1 parent 481409d commit ed27e1d

File tree

3 files changed

+488
-10
lines changed

3 files changed

+488
-10
lines changed

.github/workflows/datafusion-e2e-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ jobs:
7272
working-directory: OpenSearch
7373
run: ./gradlew :server:test --tests "org.opensearch.index.engine.exec.coord.IndexFileDeleterTests"
7474

75+
- name: Run Native(Rust) UTs for ParquetDataFormat plugin
76+
working-directory: OpenSearch
77+
run: ./gradlew runNativeUnitTests
78+
7579
- name: Run OpenSearch with DataFusion Plugin
7680
working-directory: OpenSearch
7781
run: |

modules/parquet-data-format/build.gradle

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,27 @@ run {
154154
useCluster testClusters.integTest
155155
}
156156

157+
tasks.register('runNativeUnitTests', Exec) {
158+
workingDir = file("${projectDir}/src/main/rust")
159+
// Find cargo executable - try common locations
160+
def cargoExecutable = 'cargo'
161+
def possibleCargoPaths = [
162+
System.getenv('HOME') + '/.cargo/bin/cargo',
163+
'/usr/local/bin/cargo',
164+
'cargo'
165+
]
166+
167+
for (String path : possibleCargoPaths) {
168+
if (new File(path).exists()) {
169+
cargoExecutable = path
170+
break
171+
}
172+
}
173+
174+
def cargoArgs = [cargoExecutable, 'test']
175+
commandLine cargoArgs
176+
}
177+
157178
// updateVersion: Task to auto update version to the next development iteration
158179
tasks.register('buildRust', Exec) {
159180
// workingDir = file("${projectDir}/src/main/rust")

0 commit comments

Comments
 (0)