Debian Codegraph @

testsuite/skiplist/README.md

raw symbols SCIP
1 # Expected-skip lists
2
3 `runtests.py` checks, on a full run, that the set of tests which skipped is
4 *exactly* the set that was expected. That oracle is what stops a test from
5 quietly turning into a permanent no-op: if a test starts skipping (a probe
6 regresses, a helper goes missing) the run fails instead of reporting green.
7
8 The expected set is passed in `RSYNC_EXPECT_SKIPPED`. It used to be one huge
9 comma-separated line per CI job, duplicated across seven workflow steps, which
10 meant every branch that added a skipping test edited the same line in the same
11 files and conflicted with every other such branch. The lists now live here, one
12 test name per line, and a workflow step references them:
13
14 ```yaml
15 run: RSYNC_EXPECT_SKIPPED=@testsuite/skiplist/common.txt,@testsuite/skiplist/linux.txt make check
16 ```
17
18 Adding a test therefore touches one line of one file, and two branches adding
19 different tests merge cleanly.
20
21 ## Files
22
23 | file | contents |
24 | --- | --- |
25 | `common.txt` | skipped on every platform that runs the oracle — mostly `require_tcp` / `require_asan` tests, which the default stdio-pipe `make check` cannot satisfy |
26 | `linux.txt` | Linux-only additions |
27 | `macos.txt` | macOS-only additions |
28 | `cygwin.txt` | Cygwin-only additions |
29 | `proto29.txt` | additions for a `--protocol=29` run, on any platform |
30
31 Compose them with commas; the result is the union, so listing a test twice is
32 harmless. Plain test names may be mixed in with `@FILE` entries.
33
34 ## Format rules
35
36 One test name per line. `#` starts a comment; a trailing `# reason` is
37 encouraged — it is the only place the reason for the expectation is recorded.
38 Each file must be **sorted and duplicate-free**, and every name must be a plain
39 test name matching a real `testsuite/<name>_test.py`. Sorting is not cosmetic:
40 it is what makes two independent additions land on different lines.
41
42 `runtests.py` exits 2 on anything malformed — an unreadable file, an empty or
43 comment-only one, an empty entry (`a,,b`, which is what an unset variable
44 expands to), an unsorted or duplicated name, a stale name. The set comparison
45 is exact, so a truncated list would not pass unnoticed; it would surface as a
46 page of "unexpected skips" naming every test the list lost, which reads like a
47 suite-wide regression rather than a bad list. Failing at the source says what
48 actually happened. A wholly empty `RSYNC_EXPECT_SKIPPED` is still the
49 legitimate "expect no skips at all".
50
51 Relative `@FILE` paths resolve against `srcdir`, so out-of-tree builds and
52 `make installcheck` work.
53
54 ## Changing a list
55
56 If a test newly skips on a platform, prefer fixing the test so it does not skip.
57 When the skip is legitimate, add the name to the narrowest file that fits, with
58 a reason. Do not paper over a mismatch by adding a name you cannot explain — an
59 unexpected skip is usually a real regression in that test's setup.
60
61 `testsuite/fleettest.py` reads these same lists (through each target's
62 workflow), and merges per-box `expect_skip_extra` from `fleettest.json` on top
63 for facts that are true of one machine rather than one platform.
64
65 Fleet takes each pass's spec from the workflow step of the same name, so a
66 target with `"protocols": [29]` is only pinned if its workflow actually has a
67 `make check29` step composing `proto29.txt`. Today only the Ubuntu workflows
68 do; a macOS or Cygwin target set to run protocol 29 gets no expected-skip
69 oracle for that pass rather than a wrong one.
70
71 ## `backport.txt` — a different thing in the same directory
72
73 A backport branch (`v3.4.1-sec-patches3`, `v3.2.7-sec-patches3`) is tested with
74 a NEWER suite than it shipped with, via
75 `fleettest.py --repo <backport> --testsuite-repo <3.5.0>`. Such a tree cannot
76 pass tests for fixes it does not carry, and cannot build unit-test helpers its
77 Makefile has never heard of.
78
79 Those branches each carry their own `testsuite/skiplist/backport.txt`. It is
80 **not** an expected-skip list:
81
82 * the other files here are `RSYNC_EXPECT_SKIPPED` oracles — "these should skip,
83 tell me if that changes";
84 * `backport.txt` is an `RSYNC_EXCLUDE` list — "do not run these at all".
85
86 It has to be an exclusion because some of the tests *fail* rather than skip on
87 an older tree, and an expected-skip list cannot describe a failure.
88
89 `fleettest.py` reads it from the tree being BUILT (`--repo`), not from the tree
90 providing the suite, because only the built tree knows what it lacks. The
91 overlay that puts a newer `testsuite/` onto an older tree is a merge with no
92 delete, so a file that exists only on the backport survives it.
93
94 `skiplist-spec` exempts this name from the rule that every committed list must
95 be referenced by a workflow: nothing references it, by design.
96
97 ### Accepted breakage vs absent features
98
99 `backport.txt` holds two different kinds of entry, and they must stay
100 distinguishable:
101
102 * **absent** — a fix, feature or helper the branch does not have. The test
103 could never pass and is not telling you anything.
104 * **accepted breakage** — a real defect on that branch that we have chosen to
105 ship. The test *was* telling you something, and excluding it is a decision
106 rather than bookkeeping.
107
108 Keep the second kind in its own commented section naming the defect and where
109 it is written up. `v3.2.7-sec-patches3` has one today
110 (`fake-super-acl-xattr`, the `--remote-option` local-transfer bug). A list that
111 does not distinguish them turns "we know about this and accepted it" into "this
112 test never applied here" within about one release.
113
114 **CI for the backport branches**, when it is set up to run this suite against
115 them, has to honour these lists the same way `fleettest.py` does — read
116 `backport.txt` from the branch being built and pass it as `RSYNC_EXCLUDE`.
117 A CI job that does not will fail on every one of these and be turned off.