Skip to content

Commit b4003c4

Browse files
author
Harsh Dev Pathak
committed
feat: Added CI for in_memory_testing
1 parent a609e81 commit b4003c4

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: In-Memory VSS Server CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
test-in-memory:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 5
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Create in-memory config
22+
run: |
23+
cat > rust/vss-in-memory.toml <<EOF
24+
[server_config]
25+
host = "127.0.0.1"
26+
port = 8080
27+
store_type = "in_memory"
28+
EOF
29+
30+
- name: Start VSS server (in-memory)
31+
run: |
32+
cd rust
33+
cargo run -- --config vss-in-memory.toml
34+
echo "Server started (PID: $!)"
35+
36+
- name: Wait for server
37+
run: |
38+
for i in {1..15}; do
39+
if curl -s http://127.0.0.1:8080 > /dev/null 2>&1; then
40+
echo "Server is up!"
41+
exit 0
42+
fi
43+
echo "Waiting... ($i)"
44+
sleep 1
45+
done
46+
echo "Server failed to start. Logs:"
47+
cat vss.log
48+
exit 1
49+
50+
- name: Test HTTP API
51+
run: |
52+
PUT_HEX="0A07737465737469643A150A026B3110FFFFFFFFFFFFFFFFFF011A046B317631"
53+
curl -f --data-binary @<(echo "$PUT_HEX" | xxd -r -p) http://127.0.0.1:8080/vss/putObjects
54+
55+
# GET: storeId, key=k1
56+
GET_HEX="0A07737465737469643A026B31"
57+
curl -f --data-binary @<(echo "$GET_HEX" | xxd -r -p) http://127.0.0.1:8080/vss/getObject
58+
59+
- name: Run tests
60+
run: cargo test --package impls --lib -- in_memory_store::tests --nocapture

0 commit comments

Comments
 (0)