From b59c21f4837fd38187f2ecfc3b6186fda5f3d4f9 Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Sat, 3 Jan 2026 15:44:17 -0600 Subject: [PATCH] feat(Taskfile, workflows): add new benchmarking and integrity testing tasks, and create a Gitea workflow for automated benchmarks --- .gitea/workflows/bench.yml | 43 ++++++++++++++++++++++++++++++++++++++ Taskfile.yml | 35 +++++++++++++++++++++++++++++-- 2 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/bench.yml diff --git a/.gitea/workflows/bench.yml b/.gitea/workflows/bench.yml new file mode 100644 index 0000000..809defb --- /dev/null +++ b/.gitea/workflows/bench.yml @@ -0,0 +1,43 @@ +name: Benchmarks + +on: + push: + branches: + - "*" + pull_request: + workflow_dispatch: + +jobs: + benchmark: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: https://git.quad4.io/actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - name: Setup Node.js + uses: https://git.quad4.io/actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 + with: + node-version: 22 + cache: pnpm + + - name: Setup Python + uses: https://git.quad4.io/actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + with: + python-version: "3.13" + + - name: Setup Task + uses: https://git.quad4.io/actions/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1 + with: + version: "3.46.3" + + - name: Setup Poetry + run: pip install poetry + + - name: Install dependencies + run: task install + + - name: Run Benchmarks + run: task bench + + - name: Run Integrity Tests + run: task test-integrity diff --git a/Taskfile.yml b/Taskfile.yml index dff6ba6..61448b4 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -106,6 +106,11 @@ tasks: cmds: - "{{.NPM}} run test" + gen-locale-template: + desc: Generate a locales.json template with empty values from en.json + cmds: + - "{{.PYTHON}} scripts/generate_locale_template.py" + test: desc: Run all tests deps: [test-python, test-frontend] @@ -114,6 +119,32 @@ tasks: desc: Run all tests with coverage reports deps: [test-python-cov, test-frontend] + bench-backend: + desc: Run comprehensive backend benchmarks + cmds: + - poetry run python tests/backend/run_comprehensive_benchmarks.py + + bench-extreme: + desc: Run extreme backend stress benchmarks (Breaking Space Mode) + cmds: + - poetry run python tests/backend/run_comprehensive_benchmarks.py --extreme + + profile-memory: + desc: Run backend memory profiling tests + cmds: + - poetry run pytest tests/backend/test_memory_profiling.py + + test-integrity: + desc: Run backend and data integrity tests + cmds: + - poetry run pytest tests/backend/test_integrity.py tests/backend/test_backend_integrity.py + + bench: + desc: Run all backend benchmarks and memory profiling + cmds: + - task: bench-backend + - task: profile-memory + compile: desc: Compile Python code to check for syntax errors cmds: @@ -213,7 +244,7 @@ tasks: deps: [build, electron-legacy] cmds: - "{{.NPM}} run electron-postinstall" - - "{{.NPM}} run dist -- --linux AppImage" + - "{{.NPM}} run dist -- --linux AppImage -c.extraMetadata.main=electron/main-legacy.js" - "./scripts/rename_legacy_artifacts.sh" build-exe-legacy: @@ -221,7 +252,7 @@ tasks: deps: [build, electron-legacy] cmds: - "{{.NPM}} run electron-postinstall" - - "{{.NPM}} run dist -- --win portable" + - "{{.NPM}} run dist -- --win portable -c.extraMetadata.main=electron/main-legacy.js" - "./scripts/rename_legacy_artifacts.sh" clean: