GongYingLian/semgrep/test-correctness.yml
zhuangxujie 01bc837fd4
Some checks failed
Server (Postgres) / Build & reinstall (setup) (push) Has been cancelled
Server (Postgres) / Python Unit Tests (1) (push) Has been cancelled
Server (Postgres) / Python Unit Tests (2) (push) Has been cancelled
Server (Postgres) / Python Unit Tests (3) (push) Has been cancelled
Server (Postgres) / Python Unit Tests (4) (push) Has been cancelled
Server (Mariadb) / Build & reinstall (setup) (push) Has been cancelled
Server (Mariadb) / Python Unit Tests (1) (push) Has been cancelled
Server (Mariadb) / Python Unit Tests (2) (push) Has been cancelled
Server (Mariadb) / Python Unit Tests (3) (push) Has been cancelled
Server (Mariadb) / Python Unit Tests (4) (push) Has been cancelled
Server (Mariadb) / Coverage Wrap Up (push) Has been cancelled
Lock threads / lock (push) Has been cancelled
Regenerate POT file (translatable strings) / Regenerate POT file (develop) (push) Has been cancelled
Regenerate POT file (translatable strings) / Regenerate POT file (version-16-hotfix) (push) Has been cancelled
Sync translations to hotfix branches / Trigger sync → version-16-hotfix (push) Has been cancelled
Create weekly release pull requests / Release (15) (push) Has been cancelled
Create weekly release pull requests / Release (16) (push) Has been cancelled
first commit
2026-07-23 16:31:28 +08:00

25 lines
660 B
YAML

rules:
- id: Dont-commit
pattern: frappe.db.commit()
message: Commiting inside test breaks idempotency.
languages: [python]
severity: ERROR
- id: Implicit-commit
pattern: frappe.db.truncate()
message: DB truncation does implict commit which breaks test idempotency.
languages: [python]
severity: ERROR
- id: Dont-override-teardown
patterns:
- pattern: |
def tearDown(...):
...
- pattern-not: |
def tearDown(...):
...
super().tearDown()
...
message: ERPNextTestSuite forces rollback on each tearDown, which ensures idempotency. Don't override tearDown.
languages: [python]
severity: ERROR