Skip to content

feat: Added in-memory storage for testing purposes #1

feat: Added in-memory storage for testing purposes

feat: Added in-memory storage for testing purposes #1

name: In-Memory VSS Server CI
on:
push:
branches: [ main ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-in-memory:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create in-memory config
run: |
cat > rust/vss-in-memory.toml <<EOF
[server_config]
host = "127.0.0.1"
port = 8080
store_type = "in_memory"
EOF
- name: Start VSS server (in-memory)
run: |
cd rust
cargo run -- --config vss-in-memory.toml
echo "Server started (PID: $!)"
- name: Wait for server
run: |
for i in {1..15}; do
if curl -s http://127.0.0.1:8080 > /dev/null 2>&1; then
echo "Server is up!"
exit 0
fi
echo "Waiting... ($i)"
sleep 1
done
echo "Server failed to start. Logs:"
cat vss.log
exit 1
- name: Test HTTP API
run: |
PUT_HEX="0A07737465737469643A150A026B3110FFFFFFFFFFFFFFFFFF011A046B317631"
curl -f --data-binary @<(echo "$PUT_HEX" | xxd -r -p) http://127.0.0.1:8080/vss/putObjects
# GET: storeId, key=k1
GET_HEX="0A07737465737469643A026B31"
curl -f --data-binary @<(echo "$GET_HEX" | xxd -r -p) http://127.0.0.1:8080/vss/getObject
- name: Run tests
run: cargo test --package impls --lib -- in_memory_store::tests --nocapture