[PR #566] [MERGED] add vitest, add json validation tests, fix broken json files #2597

Open
opened 2025-11-20 05:30:51 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/566
Author: @havardthom
Created: 11/28/2024
Status: Merged
Merged: 11/28/2024
Merged by: @MickLesk

Base: mainHead: add-json-tests


📝 Commits (1)

  • e92eb47 Add vitest, add json validation tests, fix broken json files

📊 Changes

208 files changed (+3373 additions, -989 deletions)

View changed files

📝 ct/aria2.sh (+1 -1)
📝 frontend/package-lock.json (+2438 -67)
📝 frontend/package.json (+12 -5)
frontend/src/__tests__/app/page.test.tsx (+11 -0)
frontend/src/__tests__/public/validate-json.test.ts (+53 -0)
frontend/src/__tests__/setupTests.ts (+4 -0)
📝 frontend/src/app/json-editor/_components/Categories.tsx (+1 -3)
📝 frontend/src/app/json-editor/_components/InstallMethod.tsx (+4 -6)
📝 frontend/src/app/json-editor/_components/Note.tsx (+1 -3)
📝 frontend/src/app/json-editor/_schemas/schemas.ts (+5 -3)
📝 frontend/src/app/json-editor/page.tsx (+88 -61)
📝 frontend/src/lib/types.ts (+1 -1)
frontend/vitest.config.mjs (+11 -0)
📝 json/actualbudget.json (+4 -4)
📝 json/adguard.json (+4 -4)
📝 json/adventurelog.json (+4 -4)
📝 json/agentdvr.json (+4 -4)
📝 json/alpine.json (+3 -3)
📝 json/apache-cassandra.json (+3 -3)
📝 json/apache-couchdb.json (+4 -4)

...and 80 more files

📄 Description

Note

We are meticulous when it comes to merging code into the main branch, so please understand that we may reject pull requests that do not meet the project's standards. It's never personal. Also, game-related scripts have a lower chance of being merged.

Description

  • Add vitest and React Testing Library to frontend
  • Implement json validation tests
    • test valid json syntax
    • test valid schema
    • test that script file exist for each install method in json
  • Fix broken json files
    • Change interface_port, hdd, cpu and ram from string to number
    • Some other small bugs
  • Change OS version in schema from number to string

Will add linting and testing to Github action later which will be used to validate PR's

Type of change

Please check the relevant option(s):

  • Bug fix (non-breaking change that resolves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (a fix or feature that would cause existing functionality to change unexpectedly)
  • New script (a fully functional and thoroughly tested script or set of scripts.)

Prerequisites

The following efforts must be made for the PR to be considered. Please check when completed:

  • Self-review performed (I have reviewed my code, ensuring it follows established patterns and conventions)
  • Testing performed (I have tested my changes, ensuring everything works as expected)
  • Documentation updated (I have updated any relevant documentation)

Additional Information (optional)

Provide any additional context or screenshots about the feature or fix here.

green

example broken json:
invalid-json

example broken schema:
invalid-schema

If there are other pull requests or discussions related to this change, please link them here:

  • Related PR #

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE/pull/566 **Author:** [@havardthom](https://github.com/havardthom) **Created:** 11/28/2024 **Status:** ✅ Merged **Merged:** 11/28/2024 **Merged by:** [@MickLesk](https://github.com/MickLesk) **Base:** `main` ← **Head:** `add-json-tests` --- ### 📝 Commits (1) - [`e92eb47`](https://github.com/community-scripts/ProxmoxVE/commit/e92eb4732a7992e5603ca59b2d41b2b0f1e1634f) Add vitest, add json validation tests, fix broken json files ### 📊 Changes **208 files changed** (+3373 additions, -989 deletions) <details> <summary>View changed files</summary> 📝 `ct/aria2.sh` (+1 -1) 📝 `frontend/package-lock.json` (+2438 -67) 📝 `frontend/package.json` (+12 -5) ➕ `frontend/src/__tests__/app/page.test.tsx` (+11 -0) ➕ `frontend/src/__tests__/public/validate-json.test.ts` (+53 -0) ➕ `frontend/src/__tests__/setupTests.ts` (+4 -0) 📝 `frontend/src/app/json-editor/_components/Categories.tsx` (+1 -3) 📝 `frontend/src/app/json-editor/_components/InstallMethod.tsx` (+4 -6) 📝 `frontend/src/app/json-editor/_components/Note.tsx` (+1 -3) 📝 `frontend/src/app/json-editor/_schemas/schemas.ts` (+5 -3) 📝 `frontend/src/app/json-editor/page.tsx` (+88 -61) 📝 `frontend/src/lib/types.ts` (+1 -1) ➕ `frontend/vitest.config.mjs` (+11 -0) 📝 `json/actualbudget.json` (+4 -4) 📝 `json/adguard.json` (+4 -4) 📝 `json/adventurelog.json` (+4 -4) 📝 `json/agentdvr.json` (+4 -4) 📝 `json/alpine.json` (+3 -3) 📝 `json/apache-cassandra.json` (+3 -3) 📝 `json/apache-couchdb.json` (+4 -4) _...and 80 more files_ </details> ### 📄 Description > [!NOTE] > We are meticulous when it comes to merging code into the main branch, so please understand that we may reject pull requests that do not meet the project's standards. It's never personal. Also, game-related scripts have a lower chance of being merged. ## Description - Add [vitest](https://vitest.dev/) and [React Testing Library](https://testing-library.com/) to frontend - Implement json validation tests - test valid json syntax - test valid schema - test that script file exist for each install method in json - Fix broken json files - Change `interface_port`, `hdd`, `cpu` and `ram` from string to number - Some other small bugs - Change OS version in schema from number to string Will add linting and testing to Github action later which will be used to validate PR's ## Type of change Please check the relevant option(s): - [x] Bug fix (non-breaking change that resolves an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (a fix or feature that would cause existing functionality to change unexpectedly) - [ ] New script (a fully functional and thoroughly tested script or set of scripts.) ## Prerequisites The following efforts must be made for the PR to be considered. Please check when completed: - [x] Self-review performed (I have reviewed my code, ensuring it follows established patterns and conventions) - [x] Testing performed (I have tested my changes, ensuring everything works as expected) - [x] Documentation updated (I have updated any relevant documentation) ## Additional Information (optional) Provide any additional context or screenshots about the feature or fix here. ![green](https://github.com/user-attachments/assets/5036c9cd-6629-4c40-ad8f-cfaac7865888) example broken json: ![invalid-json](https://github.com/user-attachments/assets/5691b4d8-a238-42f4-ac71-161756446cee) example broken schema: ![invalid-schema](https://github.com/user-attachments/assets/184f6681-434e-403b-819a-e8e7ab1bafe9) ## Related Pull Requests / Discussions If there are other pull requests or discussions related to this change, please link them here: - Related PR # --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 05:30:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#2597