mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-14 10:06:04 +08:00
- Introduce test targets. - Adding additional tests. Related to: https://github.com/harvester/harvester/issues/11892 Signed-off-by: Volker Theile <vtheile@suse.com>
2.4 KiB
2.4 KiB
Tools
Prerequisites
- Node.js:
>= 24.0.0(see.nvmrcfor the pinned version:24) - Package manager:
yarn(v1 classic)
Common Commands
| Command | Description |
|---|---|
yarn install --frozen-lockfile |
Install dependencies (CI-safe, no lockfile changes) |
RANCHER_ENV=harvester API=https://<harvester-ip> yarn dev |
Start development server at https://127.0.0.1:8005 |
yarn build-pkg harvester |
Build the Harvester extension package |
yarn serve-pkgs |
Serve the locally built extension for testing |
yarn lint |
Run ESLint (zero warnings allowed) |
yarn lint:fix |
Run ESLint with auto-fix |
yarn test |
Run the unit tests (Jest) in watch mode |
yarn test:ci |
Run the unit tests once, as CI does (silent) |
yarn clean |
Clean build artifacts |
yarn agents:generate |
Regenerate AGENTS.md from docs/agents.md/ sources |
Development
- Start dev server:
RANCHER_ENV=harvester API=https://your-harvester-ip yarn devAPIshould point to a running Harvester cluster (e.g.,https://x.x.x.x).- The dashboard will be available at
https://127.0.0.1:8005.
Building
- Build extension package:
yarn build-pkg harvester - Serve locally built extension (for integration testing with a Rancher instance):
yarn serve-pkgs
Linting
- Check (must pass with zero warnings):
yarn lint - Auto-fix:
yarn lint:fix - ESLint covers
.js,.ts, and.vuefiles. - Always run
yarn lint:fixbefore committing.
Unit Tests
- Run:
yarn testyarn teststarts Jest in watch mode (like in the Rancher dashboard) and only runs the tests related to changed files. It does not exit, so useyarn test:cifor a single run of all tests, e.g. in scripts.
- CI runs
yarn test:cion every pull request. - See the Unit Tests section of the Contributors Guide for how the tests are set up.
Commit Conventions
- Commits are validated by commitlint via a Husky
commit-msghook. - Follow Conventional Commits format (configured in
commitlint.config.js).
Agent Documentation
- Source files live in
docs/agents.md/(agents, contributors, personas subdirectories). - After editing any source file, regenerate the root
AGENTS.md:yarn agents:generate