You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Aman-Mittal (via GitHub)" <gi...@apache.org> on 2026/08/19 17:04:37 UTC
[I] [EPIC] Migrate the unit suite off Karma — 192 specs remaining [fineract-backoffice-ui]
Aman-Mittal opened a new issue, #403:
URL: https://github.com/apache/fineract-backoffice-ui/issues/403
## Summary
Karma is deprecated and `@angular/build:karma` goes with it. The groundwork is done — a Vitest runner, a codemod, and a CI ratchet that stops the Karma set growing — so what remains is moving the specs, batch by batch.
**This is the best-stocked source of good first issues in the repo right now.** Each sub-issue is a self-contained batch: run one command, run the suite, commit. No design decisions, no domain knowledge, and the result is verifiable by anyone.
## How a batch works
```bash
# 1. Convert. The codemod does the dialect swap AND the .spec.ts -> .test.ts rename.
node scripts/codemod-jasmine-to-vitest.mjs src/app/features/<area>/**/*.spec.ts
# 2. Run the migrated suite.
npm run test:unit
# 3. Re-record the ratchet baseline.
node scripts/check-test-runner.mjs --write
# 4. The rest of the usual checks.
npm run lint:prune && npm run format && npm test -- --watch=false
```
`npm run check:test-runner` prints how many are left.
## What the codemod handles, and what it doesn't
It converts dialect — `vi.fn()` for `jasmine.createSpy()`, `.mockReturnValue()` for `.and.returnValue()`, `toBe(true)` for `toBeTrue()`, `SpyObj<T>`/`createSpyObj<T>()` from `src/app/testing/mocks.ts` for the Jasmine equivalents.
It **skips whole files** that use `fakeAsync`, `tick`, `flush`, `done()` callbacks, `jasmine.clock` or the object form of `createSpyObj`, and tells you which. Those carry zone or callback semantics rather than a spelling, and they are collected in a separate issue that is explicitly *not* a first issue.
## Remaining work by area
| Area | Mechanical | Needs a person |
| --- | --- | --- |
| `features/products` | 38 | 1 |
| `features/system` | 32 | 0 |
| `features/accounting` | 15 | 0 |
| `features/clients` | 13 | 0 |
| `features/loans` | 13 | 0 |
| `features/organization` | 10 | 0 |
| `features/working-capital` | 10 | 0 |
| `features/spm` | 5 | 0 |
| 17 smaller areas | 23 | 3 |
| `core` | 1 | 11 |
| `shared` | 2 | 3 |
| **Total** | **173** | **19** |
## Ground rules
- **One area per PR.** A 192-file diff is unreviewable; a 15-file one is not.
- The suite must stay arithmetically whole — Karma total + Vitest total should not drop. State both counts in the PR.
- Do not "improve" a spec while migrating it. A migration diff that also changes assertions cannot be reviewed as either.
Background, and the open question about Vitest browser mode: [`DOCS/adr/0004-vitest-migration.md`](DOCS/adr/0004-vitest-migration.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [EPIC] Migrate the unit suite off Karma — 192 specs remaining [fineract-backoffice-ui]
Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal closed issue #403: [EPIC] Migrate the unit suite off Karma — 192 specs remaining
URL: https://github.com/apache/fineract-backoffice-ui/issues/403
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [EPIC] Migrate the unit suite off Karma — 192 specs remaining [fineract-backoffice-ui]
Posted by "zhangxinyao88 (via GitHub)" <gi...@apache.org>.
zhangxinyao88 commented on issue #403:
URL: https://github.com/apache/fineract-backoffice-ui/issues/403#issuecomment-5554415783
@Aman-Mittal, final verification on current `main`:
- #409 and #410 are complete; their remaining PRs have merged.
- There are 0 legacy `.spec.ts` files under `src/`.
- Karma, its migration tooling, and the temporary CI paths have been removed in #479.
Could you please close #409, #410, and then this epic? Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [EPIC] Migrate the unit suite off Karma — 192 specs remaining [fineract-backoffice-ui]
Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal closed issue #403: [EPIC] Migrate the unit suite off Karma — 192 specs remaining
URL: https://github.com/apache/fineract-backoffice-ui/issues/403
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [EPIC] Migrate the unit suite off Karma — 192 specs remaining [fineract-backoffice-ui]
Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal commented on issue #403:
URL: https://github.com/apache/fineract-backoffice-ui/issues/403#issuecomment-5346314537
Reopened — this was closed in error when #408 merged. The PR body carried a `Closes #403` keyword it should not have had; the groundwork landed, but the migration this epic tracks has barely started.
**Actual state: 30 of 222 specs migrated. 192 still on Karma, 0 of 7 sub-issues done.**
```
$ npm run check:test-runner
✓ No new Karma specs. 192 remaining (14% migrated).
```
### What #408 actually delivered
The tooling, not the migration:
- `@angular/build:unit-test` wired with the Vitest runner (`npm run test:unit`), Karma narrowed to `**/*.spec.ts`
- `scripts/check-test-runner.mjs` + `karma-baseline.json` — the CI ratchet that stops the Karma set growing
- `scripts/codemod-jasmine-to-vitest.mjs` — converts 187 of the 215 remaining specs
- `src/app/testing/mocks.ts`, `src/testing/vitest-setup.ts`, `vitest.config.ts`
- 30 specs migrated as proof the toolchain works end to end, including Ionic component rendering: **Vitest 270 tests, Karma 921, total 1191** — unchanged, so nothing was lost
### What remains
All seven sub-issues, unchanged: #404 (system, 32), #405 (accounting, 15), #406 (clients + loans, 26), #407 (organization + working-capital, 20), #409 (products, 39), #410 (the 19 `fakeAsync`/`flush` specs), #411 (17 smaller areas, 28).
This epic should close when `check:test-runner` reports 0 remaining and the Karma builder is removed from `angular.json` — not before.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [EPIC] Migrate the unit suite off Karma — 192 specs remaining [fineract-backoffice-ui]
Posted by "zhangxinyao88 (via GitHub)" <gi...@apache.org>.
zhangxinyao88 commented on issue #403:
URL: https://github.com/apache/fineract-backoffice-ui/issues/403#issuecomment-5419731357
Current migration tracker. The counts below are from current `main`; the original 192-spec count is now stale because specs have both migrated and been added since this issue was opened.
**Why this migration exists**
Karma and Angular’s Karma builder are being phased out. The repository currently maintains two test runners, two filename conventions, and two mocking dialects. The goal is to move the existing tests without changing their behaviour, reach zero Karma specs, and then remove the Karma builder and related configuration.
The combined Karma + Vitest test count should not decrease during the migration.
**Current progress**
- 153 Vitest files
- 83 Karma files
- 236 total test files
- About 65% migrated
**Sub-issues**
- [x] #404 — system administration, completed by #445
- [x] #405 — accounting, completed by #441
- [ ] #406 — clients and loans
- Clients: 13 files claimed, no PR yet
- Loans: 13 files in #453; commit-signature check is currently failing
- [x] #407 — organization and working capital, completed by #433
- [ ] #409 — products: 31 files remain on `main`; claimed, no migration PR yet
- [ ] #410 — specs requiring manual decisions
- Four files in #456; CI is green
- Three throwing-mock files in #457
- Remaining manual checklist: https://github.com/apache/fineract-backoffice-ui/issues/410#issuecomment-5418797763
- [ ] #411 — smaller feature areas
- Mechanical migrations are complete
- The final four manual files are in #456
**Work currently in PRs**
- #453 — 13 files
- #456 — 4 files
- #457 — 3 files
If all three merge, the project will reach 173 Vitest files and 63 Karma files, or about 73% migrated.
Of those 63 remaining files:
- 44 belong to the already-claimed clients and products batches
- 5 are unclaimed mechanical migrations
- 14 are unclaimed manual migrations
The five unclaimed mechanical files are:
- `projects/fineract-mfe/src/app/app.spec.ts`
- `src/app/app.component.spec.ts`
- `features/groups/group-action-dialog.component.spec.ts`
- `features/groups/group-form.component.spec.ts`
- `features/groups/tabs/group-accounts-tab.component.spec.ts`
#403 is complete when `check:test-runner` reports zero Karma specs and the Karma builder can be removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org