mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-10 02:15:07 +00:00
ci: semgrep to prevent test regression
(cherry picked from commit be4496e4ab)
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
19 lines
547 B
YAML
19 lines
547 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
|
|
pattern: |
|
|
def tearDown(...):
|
|
...
|
|
message: ERPNextTestSuite forces rollback on each tearDown, which ensures idempotency. Don't override tearDown.
|
|
languages: [python]
|
|
severity: ERROR
|