Add scritps folder

This commit is contained in:
Andras Schmelczer 2025-03-16 14:59:39 +00:00
parent c49ee759ac
commit 993515ea12
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
6 changed files with 13 additions and 11 deletions

View file

@ -32,7 +32,5 @@ jobs:
- name: E2E tests
run: |
UST_BACKTRACE=1 cargo run -p sync_server &
cd ../frontend
npm run build
test-client/run.sh 32
cd ..
scripts/e2e.sh 32

View file

@ -16,9 +16,6 @@
## Set up Rust
- Install [`rustup`](https://rustup.rs): `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`
- `sudo apt install llvm -y`
- `rustup component add llvm-tools-preview`
- `cargo install cargo-generate cargo-fuzz cargo-insta rustfilt cargo-binutils`
- Install [`wasm-pack`](https://rustwasm.github.io/wasm-pack/installer): `curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh`
- `cargo install cargo-insta sqlx-cli cargo-edit`
@ -33,8 +30,7 @@
## Update HTTP API TS bindings
```sh
npm install -g openapi-typescript
openapi-typescript http://localhost:3030/api.json --output frontend/sync-client/src/services/types.ts
./update-api-types.sh
```
```

2
clean-up.sh → scripts/clean-up.sh Normal file → Executable file
View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
rm -rf backend/databases
rm -rf frontend/test-client/logs

View file

@ -12,16 +12,19 @@ fi
# Get the number of processes from the first argument
process_count=$1
cd frontend
npm run build
mkdir -p logs
pids=()
for i in $(seq 1 $process_count); do
node dist/cli.js > "logs/log_${i}.log" 2>&1 &
node test-client/dist/cli.js > "logs/log_${i}.log" 2>&1 &
pids+=($!)
done
cd -
print_failed_log() {
for i in $(seq 1 $process_count); do
if [ -n "${pids[$i-1]}" ] && ! kill -0 ${pids[$i-1]} 2>/dev/null; then
@ -73,3 +76,4 @@ while true; do
sleep 0.2
done

4
scripts/update-api-types.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
npm install -g openapi-typescript
openapi-typescript http://localhost:3030/api.json --output frontend/sync-client/src/services/types.ts