From 993515ea1243b67cd2ccdff1e048a92c649cb724 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 16 Mar 2025 14:59:39 +0000 Subject: [PATCH] Add scritps folder --- .github/workflows/e2e.yml | 6 ++---- README.md | 6 +----- bump-version.sh => scripts/bump-version.sh | 0 clean-up.sh => scripts/clean-up.sh | 2 +- frontend/test-client/run.sh => scripts/e2e.sh | 6 +++++- scripts/update-api-types.sh | 4 ++++ 6 files changed, 13 insertions(+), 11 deletions(-) rename bump-version.sh => scripts/bump-version.sh (100%) rename clean-up.sh => scripts/clean-up.sh (83%) mode change 100644 => 100755 rename frontend/test-client/run.sh => scripts/e2e.sh (95%) create mode 100755 scripts/update-api-types.sh diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index f6561501..4cbcf72c 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -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 diff --git a/README.md b/README.md index 62842bc3..280e65c0 100644 --- a/README.md +++ b/README.md @@ -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 ``` ``` diff --git a/bump-version.sh b/scripts/bump-version.sh similarity index 100% rename from bump-version.sh rename to scripts/bump-version.sh diff --git a/clean-up.sh b/scripts/clean-up.sh old mode 100644 new mode 100755 similarity index 83% rename from clean-up.sh rename to scripts/clean-up.sh index 2e7f7c3e..6602e0c7 --- a/clean-up.sh +++ b/scripts/clean-up.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash rm -rf backend/databases rm -rf frontend/test-client/logs diff --git a/frontend/test-client/run.sh b/scripts/e2e.sh similarity index 95% rename from frontend/test-client/run.sh rename to scripts/e2e.sh index 4a32c002..8b61885d 100755 --- a/frontend/test-client/run.sh +++ b/scripts/e2e.sh @@ -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 + diff --git a/scripts/update-api-types.sh b/scripts/update-api-types.sh new file mode 100755 index 00000000..d0aa2357 --- /dev/null +++ b/scripts/update-api-types.sh @@ -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