Skip to content

Commit 81ca808

Browse files
committed
feat: Added CI for in_memory_testing
1 parent 2c504bd commit 81ca808

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
working-directory: rust
33+
run: cargo build --release --bin server
34+
35+
- name: Start VSS server
36+
working-directory: rust
37+
run: |
38+
./target/release/server server/vss-server-config.toml --in-memory > server.log 2>&1 &
39+
echo "Server PID: $!"
40+
41+
- name: Wait for server
42+
run: |
43+
for i in {1..15}; do
44+
if curl -s http://127.0.0.1:8080 > /dev/null; then
45+
echo "Server is up!"
46+
exit 0
47+
fi
48+
sleep 1
49+
done
50+
echo "Server failed:"
51+
cat rust/server.log
52+
exit 1
53+
54+
- name: HTTP Smoke Test
55+
run: |
56+
# PUT: store="test", key="k1", value="kv1"
57+
curl -f \
58+
-H "Authorization: Bearer test_user" \
59+
--data-binary @<(echo "0A04746573741A150A026B3110FFFFFFFFFFFFFFFFFF011A046B317631" | xxd -r -p) \
60+
http://127.0.0.1:8080/vss/putObjects
61+
62+
# GET: store="test", key="k1"
63+
RESPONSE=$(curl -f \
64+
-H "Authorization: Bearer test_user" \
65+
--data-binary @<(echo "0A047465737412026B31" | xxd -r -p) \
66+
http://127.0.0.1:8080/vss/getObject)
67+
68+
- name: Run unit tests
69+
working-directory: rust
70+
run: cargo test --package impls --lib -- in_memory_store::tests --nocapture

0 commit comments

Comments
 (0)