Skip to content

Commit 84d5ebb

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

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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+
mkdir -p rust/server
24+
cat > rust/server/vss-server-config.toml <<EOF
25+
[server_config]
26+
host = "127.0.0.1"
27+
port = 8080
28+
store_type = "in_memory"
29+
EOF
30+
31+
- name: Build server
32+
run: |
33+
cd rust
34+
cargo build --bin server --release
35+
36+
- name: Start VSS server (in-memory)
37+
run: |
38+
cd rust
39+
./target/release/server server/vss-server-config.toml > vss.log 2>&1 &
40+
echo "Server started (PID: $!)"
41+
42+
- name: Wait for server
43+
run: |
44+
sleep 2
45+
for i in {1..15}; do
46+
if curl -s http://127.0.0.1:8080 > /dev/null 2>&1; then
47+
echo "Server is up!"
48+
exit 0
49+
fi
50+
echo "Waiting... ($i)"
51+
sleep 1
52+
done
53+
echo "Server failed to start. Logs:"
54+
cat rust/vss.log
55+
exit 1
56+
57+
- name: Test HTTP API
58+
run: |
59+
PUT_HEX="0A07737465737469643A150A026B3110FFFFFFFFFFFFFFFFFF011A046B317631"
60+
curl -f --data-binary @<(echo "$PUT_HEX" | xxd -r -p) http://127.0.0.1:8080/vss/putObjects
61+
62+
GET_HEX="0A07737465737469643A026B31"
63+
curl -f --data-binary @<(echo "$GET_HEX" | xxd -r -p) http://127.0.0.1:8080/vss/getObject
64+
65+
- name: Run tests
66+
run: cargo test --package impls --lib -- in_memory_store::tests --nocapture
67+
68+
- name: Stop VSS server
69+
if: always()
70+
run: |
71+
pkill -f "server/vss-server-config.toml" || true
72+

0 commit comments

Comments
 (0)