Skip to content

Commit e084bf3

Browse files
ruokun-niulukemurraynzamansinghoriginaldanielgerlagsnyk-bot
committed
Fixed Rust Source SDK tests and updated the workflow & makefiles for testing Source SDKs (drasi-project#180)
* test fix Signed-off-by: ruokun-niu <[email protected]> * typespec Signed-off-by: ruokun-niu <[email protected]> * updated makefile to run test before publish Signed-off-by: ruokun-niu <[email protected]> * added test run for source sdk Signed-off-by: ruokun-niu <[email protected]> * java jdk setup Signed-off-by: ruokun-niu <[email protected]> * protobuf Signed-off-by: ruokun-niu <[email protected]> * updated makefile and sln file for dotnet, updated typespec Signed-off-by: ruokun-niu <[email protected]> * restore SourceChange type Signed-off-by: ruokun-niu <[email protected]> * Query Bootstrap Tracing (drasi-project#179) * modified span * working * clean up * nit * deleted unused imports * cargo fmt Signed-off-by: ruokun-niu <[email protected]> * Fixed spelling of 'Installing'. (drasi-project#195) Signed-off-by: ruokun-niu <[email protected]> * Add k3d-load target to all Makefiles (drasi-project#203) Signed-off-by: ruokun-niu <[email protected]> * updated storage queue name in the GH workflows (drasi-project#188) Signed-off-by: ruokun-niu <[email protected]> * readme (drasi-project#183) Signed-off-by: ruokun-niu <[email protected]> * keep debug view sorted on changes (drasi-project#184) Signed-off-by: ruokun-niu <[email protected]> * Environment Management & k3s encapsulated Drasi (drasi-project#200) * wip * wip * wip * wip * wip * cli wip * wip * wip * wip * wip * fix tests * wip * load local images * engines * Update deploy-resources.js * Update k8s.test.js Signed-off-by: ruokun-niu <[email protected]> * [Snyk] Fix for 8 vulnerabilities (drasi-project#204) * fix: sources/sdk/java/pom.xml to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JAVA-ORGYAML-3152153 - https://snyk.io/vuln/SNYK-JAVA-COMGOOGLEPROTOBUF-8055227 - https://snyk.io/vuln/SNYK-JAVA-COMGOOGLEPROTOBUF-2331703 - https://snyk.io/vuln/SNYK-JAVA-COMGOOGLEPROTOBUF-3167772 - https://snyk.io/vuln/SNYK-JAVA-COMSQUAREUPOKHTTP3-2958044 - https://snyk.io/vuln/SNYK-JAVA-COMMONSIO-8161190 - https://snyk.io/vuln/SNYK-JAVA-COMGOOGLEPROTOBUF-3040284 - https://snyk.io/vuln/SNYK-JAVA-ORGJETBRAINSKOTLIN-2628385 * update samples * fix for breaking dapr sdk change * update sdk version --------- Co-authored-by: snyk-bot <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * Bump vite from 5.4.14 to 5.4.19 in /reactions/signalr/signalr-reaction/clients/vue (drasi-project#216) * Bump vite in /reactions/signalr/signalr-reaction/clients/vue Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.14 to 5.4.19. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v5.4.19/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.4.19/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 5.4.19 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <[email protected]> * Update deploy-resources.js * Revert "Update deploy-resources.js" This reverts commit 1d1d75a. * wip * wip * wip * wip * wip --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Gerlag <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * Update readme.md to add CNCF Sandbox link (drasi-project#199) Co-authored-by: Daniel Gerlag <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * Bump tokio from 1.40.0 to 1.43.1 in /control-planes/kubernetes_provider (drasi-project#187) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.40.0 to 1.43.1. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](tokio-rs/tokio@tokio-1.40.0...tokio-1.43.1) --- updated-dependencies: - dependency-name: tokio dependency-version: 1.43.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Gerlag <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * Bump openssl from 0.10.66 to 0.10.72 in /sources/shared/query-api (drasi-project#182) Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.66 to 0.10.72. - [Release notes](https://github.com/sfackler/rust-openssl/releases) - [Commits](sfackler/rust-openssl@openssl-v0.10.66...openssl-v0.10.72) --- updated-dependencies: - dependency-name: openssl dependency-version: 0.10.72 dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Gerlag <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * Bump ring from 0.17.8 to 0.17.13 in /control-planes/kubernetes_provider (drasi-project#163) Bumps [ring](https://github.com/briansmith/ring) from 0.17.8 to 0.17.13. - [Changelog](https://github.com/briansmith/ring/blob/main/RELEASES.md) - [Commits](https://github.com/briansmith/ring/commits) --- updated-dependencies: - dependency-name: ring dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Gerlag <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * Bump crossbeam-channel from 0.5.13 to 0.5.15 in /query-container (drasi-project#191) Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.13 to 0.5.15. - [Release notes](https://github.com/crossbeam-rs/crossbeam/releases) - [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md) - [Commits](crossbeam-rs/crossbeam@crossbeam-channel-0.5.13...crossbeam-channel-0.5.15) --- updated-dependencies: - dependency-name: crossbeam-channel dependency-version: 0.5.15 dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Gerlag <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * Bump tokio from 1.39.2 to 1.43.1 in /control-planes/mgmt_api (drasi-project#185) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.39.2 to 1.43.1. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](tokio-rs/tokio@tokio-1.39.2...tokio-1.43.1) --- updated-dependencies: - dependency-name: tokio dependency-version: 1.43.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Gerlag <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * Eventgrid Reaction bug fix (drasi-project#198) * cloudevent done * tested eventgrid * updated sdk Signed-off-by: ruokun-niu <[email protected]> * queue item encoding (drasi-project#224) Signed-off-by: ruokun-niu <[email protected]> * Update index.html (drasi-project#227) Makes the tab title in browser identifiable Signed-off-by: ruokun-niu <[email protected]> * Update readme.md to add OpenSSF badge (drasi-project#230) Signed-off-by: ruokun-niu <[email protected]> * Add Sync-Dapr-StateStore Reaction (drasi-project#218) Signed-off-by: ruokun-niu <[email protected]> * update libraries (drasi-project#233) Signed-off-by: ruokun-niu <[email protected]> * Updated the DevSkim workflow to use ubuntu-latest (drasi-project#228) Signed-off-by: ruokun-niu <[email protected]> * Reduce number of pull requests from dependabot (drasi-project#232) Signed-off-by: ruokun-niu <[email protected]> * Observability stack for drasi-platform (drasi-project#189) * metrics observability * metrics and tracing * removed zipkin; updated tracing and metrics * update otel setting; tracing working * validate flag * test trace working * updated pvc for the observability tools * storage configuration Signed-off-by: ruokun-niu <[email protected]> * Use Renovate Github App instead of Dependabot (drasi-project#240) * Use Renovate Github App instead of Dependabot Signed-off-by: ruokun-niu <[email protected]> * Bump tokio from 1.42.0 to 1.43.1 in /sources/sdk/rust/example/proxy (drasi-project#186) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.42.0 to 1.43.1. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](tokio-rs/tokio@tokio-1.42.0...tokio-1.43.1) --- updated-dependencies: - dependency-name: tokio dependency-version: 1.43.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Gerlag <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * Update drasi core (drasi-project#243) Signed-off-by: Daniel Gerlag <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * Add end to end tests for SyncDaprStateStore reaction (drasi-project#241) Note: Snyk parsing failed for package-lock.json file. Signed-off-by: ruokun-niu <[email protected]> * Add Post-Dapr-PubSub Reaction (drasi-project#226) Signed-off-by: Aman Singh <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * Register the middlewares with query host (drasi-project#250) Signed-off-by: Aman Singh <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * Fix enum conversion bug in Post-PubSub-Reaction (drasi-project#252) Signed-off-by: Aman Singh <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * check exists (drasi-project#255) Signed-off-by: Daniel Gerlag <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * check for 0.0.0.0 ip from k3d bug (drasi-project#257) Signed-off-by: ruokun-niu <[email protected]> * Bump @babel/runtime from 7.26.0 to 7.26.10 in /typespec (drasi-project#170) Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.26.0 to 7.26.10. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-runtime) --- updated-dependencies: - dependency-name: "@babel/runtime" dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Gerlag <[email protected]> Signed-off-by: ruokun-niu <[email protected]> * Update renovate config (drasi-project#261) * Update renovate config Signed-off-by: Aman Singh <[email protected]> * increase wait time before auto merge Signed-off-by: Aman Singh <[email protected]> --------- Signed-off-by: Aman Singh <[email protected]> Signed-off-by: ruokun-niu <[email protected]> --------- Signed-off-by: ruokun-niu <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Daniel Gerlag <[email protected]> Signed-off-by: Aman Singh <[email protected]> Co-authored-by: Luke Murray <[email protected]> Co-authored-by: Aman Singh <[email protected]> Co-authored-by: Daniel Gerlag <[email protected]> Co-authored-by: snyk-bot <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nandita Valsan <[email protected]> Co-authored-by: ms-nateb <[email protected]> Signed-off-by: ruokun-niu <[email protected]>
1 parent 1f2e663 commit e084bf3

File tree

6 files changed

+59
-21
lines changed

6 files changed

+59
-21
lines changed

.github/workflows/build-test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,36 @@ jobs:
378378
name: cli
379379
path: cli/bin
380380

381+
test-source-sdks:
382+
runs-on: ubuntu-latest
383+
384+
steps:
385+
- name: Checkout repository
386+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
387+
388+
- name: Set up JDK 21
389+
uses: actions/setup-java@v4
390+
with:
391+
java-version: '21'
392+
distribution: 'temurin'
393+
394+
- name: Test Java SDK
395+
run: |
396+
cd sources/sdk/java
397+
make test
398+
- name: Test .NET SDK
399+
run: |
400+
cd sources/sdk/dotnet
401+
make test
402+
403+
- name: Install protoc
404+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
405+
406+
- name: Test Rust SDK
407+
run: |
408+
cd sources/sdk/rust
409+
make test
410+
381411
e2e-tests:
382412
permissions:
383413
packages: write

sources/sdk/dotnet/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ install-dependencies:
77
test:
88
dotnet test
99

10-
package:
10+
package: test
1111
dotnet pack Drasi.Source.SDK/Drasi.Source.SDK.csproj -c Release

sources/sdk/dotnet/drasi-source-sdk.sln

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ Global
2020
{ECEF31C2-0FE5-EE76-9C39-EA672C8693C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
2121
{ECEF31C2-0FE5-EE76-9C39-EA672C8693C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
2222
{ECEF31C2-0FE5-EE76-9C39-EA672C8693C0}.Release|Any CPU.Build.0 = Release|Any CPU
23-
{883AB71B-27D6-4861-B322-B597F9F54161}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24-
{883AB71B-27D6-4861-B322-B597F9F54161}.Debug|Any CPU.Build.0 = Debug|Any CPU
25-
{883AB71B-27D6-4861-B322-B597F9F54161}.Release|Any CPU.ActiveCfg = Release|Any CPU
26-
{883AB71B-27D6-4861-B322-B597F9F54161}.Release|Any CPU.Build.0 = Release|Any CPU
2723
{0BDC924B-B6AC-4A08-9308-66675C00B909}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2824
{0BDC924B-B6AC-4A08-9308-66675C00B909}.Debug|Any CPU.Build.0 = Debug|Any CPU
2925
{0BDC924B-B6AC-4A08-9308-66675C00B909}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -40,8 +36,7 @@ Global
4036
SolutionGuid = {43089EE9-220C-4F97-8123-1B5EB75C042F}
4137
EndGlobalSection
4238
GlobalSection(NestedProjects) = preSolution
43-
{883AB71B-27D6-4861-B322-B597F9F54161} = {E636B6C4-7DAE-4421-A30A-3CD5F575E9B9}
4439
{0BDC924B-B6AC-4A08-9308-66675C00B909} = {A5128062-B629-4505-B45D-4DC6721AA9DD}
4540
{3858EBFB-B957-4DA6-97F5-89BB922E337D} = {A5128062-B629-4505-B45D-4DC6721AA9DD}
4641
EndGlobalSection
47-
EndGlobal
42+
EndGlobal

sources/sdk/java/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ test:
99
package:
1010
mvn package
1111

12-
deploy:
12+
deploy: test
1313
mvn deploy

sources/sdk/rust/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
test:
44
cargo test
55

6-
publish:
6+
publish: test
77
cargo publish

sources/sdk/rust/src/models.rs

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ mod tests {
179179
.into_iter()
180180
.collect(),
181181
};
182-
let change = SourceChange::new(ChangeOp::Create, node, 1234567890, 1, None);
182+
let mut change = SourceChange::new(ChangeOp::Create, node, 1234567890000000000, 1234500000123456789 ,1, None);
183+
let current_time = 1234567890001234567;
184+
change.set_reactivator_end_ns(current_time);
183185
let serialized = serde_json::to_string(&change).unwrap();
184186
let expected = json!({
185187
"op": "i",
@@ -197,11 +199,13 @@ mod tests {
197199
"db": "drasi",
198200
"lsn": 1,
199201
"table": "node",
200-
"ts_ms": 1234567890,
202+
"ts_ns": 1234500000123456789u128,
201203
},
202204
},
203-
"ts_ms": 1234567890,
205+
"reactivatorStart_ns": 1234567890000000000u128,
206+
"reactivatorEnd_ns": current_time,
204207
});
208+
println!("Serialized: {}", serialized);
205209
assert_eq!(
206210
serde_json::from_str::<Value>(&serialized).unwrap(),
207211
expected
@@ -223,7 +227,9 @@ mod tests {
223227
start_id: "2".to_string(),
224228
end_id: "3".to_string(),
225229
};
226-
let change = SourceChange::new(ChangeOp::Create, relation, 1234567890, 1, None);
230+
let mut change = SourceChange::new(ChangeOp::Create, relation, 1234567890000000000, 1234500000123456789, 1, None);
231+
let current_time = 1234567890001234567;
232+
change.set_reactivator_end_ns(current_time);
227233
let serialized = serde_json::to_string(&change).unwrap();
228234
let expected = json!({
229235
"op": "i",
@@ -243,10 +249,11 @@ mod tests {
243249
"db": "drasi",
244250
"lsn": 1,
245251
"table": "rel",
246-
"ts_ms": 1234567890,
252+
"ts_ns": 1234500000123456789u128,
247253
},
248254
},
249-
"ts_ms": 1234567890,
255+
"reactivatorStart_ns": 1234567890000000000u128,
256+
"reactivatorEnd_ns": current_time,
250257
});
251258
assert_eq!(
252259
serde_json::from_str::<Value>(&serialized).unwrap(),
@@ -267,7 +274,9 @@ mod tests {
267274
.into_iter()
268275
.collect(),
269276
};
270-
let change = SourceChange::new(ChangeOp::Update, node, 1234567890, 1, None);
277+
let mut change = SourceChange::new(ChangeOp::Update, node, 1234567890000000000, 1234500000123456789, 1, None);
278+
let current_time = 1234567890001234567;
279+
change.set_reactivator_end_ns(current_time);
271280
let serialized = serde_json::to_string(&change).unwrap();
272281
let expected = json!({
273282
"op": "u",
@@ -285,10 +294,11 @@ mod tests {
285294
"db": "drasi",
286295
"lsn": 1,
287296
"table": "node",
288-
"ts_ms": 1234567890,
297+
"ts_ns": 1234500000123456789u128,
289298
},
290299
},
291-
"ts_ms": 1234567890,
300+
"reactivatorEnd_ns": current_time,
301+
"reactivatorStart_ns": 1234567890000000000u128,
292302
});
293303
assert_eq!(
294304
serde_json::from_str::<Value>(&serialized).unwrap(),
@@ -309,7 +319,9 @@ mod tests {
309319
.into_iter()
310320
.collect(),
311321
};
312-
let change = SourceChange::new(ChangeOp::Delete, node, 1234567890, 1, None);
322+
let mut change = SourceChange::new(ChangeOp::Delete, node,1234567890000000000, 1234500000123456789 , 1, None);
323+
let current_time = 1234567890001234567;
324+
change.set_reactivator_end_ns(current_time);
313325
let serialized = serde_json::to_string(&change).unwrap();
314326
let expected = json!({
315327
"op": "d",
@@ -327,10 +339,11 @@ mod tests {
327339
"db": "drasi",
328340
"lsn": 1,
329341
"table": "node",
330-
"ts_ms": 1234567890,
342+
"ts_ns": 1234500000123456789u128,
331343
},
332344
},
333-
"ts_ms": 1234567890,
345+
"reactivatorEnd_ns": current_time,
346+
"reactivatorStart_ns": 1234567890000000000u128,
334347
});
335348
assert_eq!(
336349
serde_json::from_str::<Value>(&serialized).unwrap(),

0 commit comments

Comments
 (0)