@@ -36,14 +36,43 @@ To run a manual hook like `shellcheck` manually, run:
36
36
pre-commit run --all-files --hook-stage manual shellcheck
37
37
```
38
38
39
- ## Prose test numbering
39
+ ## Prose Test Numbering
40
40
41
41
When numbering prose tests, always use relative numbered bullets (` 1. ` ). New tests must be appended at the end of the
42
42
test list, since drivers may refer to existing tests by number.
43
43
44
44
Outdated tests must not be removed completely, but may be marked as such (e.g. by striking through or replacing the
45
45
entire test with a note (e.g. * Removed* ).
46
46
47
+ ## Automated Test Best Practices
48
+
49
+ ### Immutability of Existing Tests
50
+
51
+ ** Do not modify existing tests** , unless they are testing incorrect behavior. Default to creating new tests or test
52
+ files instead of altering existing ones.
53
+
54
+ Test files can only be deleted once no driver runs them anymore. In the meantime, for cases where a spec change removes
55
+ functionality:
56
+
57
+ - ** Unified Tests:** Use ` runOnRequirements ` to ensure tests are only executed by drivers supporting the required
58
+ functionality.
59
+ - ** Non-Unified Tests (e.g., SDAM):** Drivers should skip tests that no longer apply to them.
60
+
61
+ ### Test Isolation
62
+
63
+ When creating a new test, only test functionality directly related to the new spec requirements. Omit irrelevant fields
64
+ in command expectations.
65
+
66
+ This makes tests more resilient against spec updates and avoids needing to change tests down the line.
67
+
68
+ ### Schema Version Usage
69
+
70
+ Use the ** lowest possible schema version** for each test.
71
+
72
+ Do NOT default to using the latest unified test format schema version, as the drivers may not all implement it. Use the
73
+ oldest schema version that supports all functionality used in the test, even if it requires creating a new test file
74
+ with a lower schema version.
75
+
47
76
## Building Documents
48
77
49
78
We use [ mkdocs] ( https://www.mkdocs.org/ ) to render the documentation. To see a live view of the documentation, in a
0 commit comments