Skip to content

Commit 70b4f50

Browse files
committed
test(ofrep): point at Appendix F for the policy, and keep the suite importing
The README and the pyproject comment both carried the reasoning for excluding a conformance suite from the default build, in this package's own words, and the two did not quite agree -- the README made Docker a reason, which it is not. That reasoning is now Appendix F's "Running the suite in CI", so both point at it instead. What stays is what is local: where the exclusion lives, the command a maintainer runs, the current tally with what each failure and the one xfail is, and that Docker does not decide it -- the flagd package's tests/e2e needs Docker too and does run in the default build. Appendix F also asks that an excluded suite keep building even when it does not run. `--ignore` does not import the suite at all, and mypy here is configured over `src`, so nothing checked that. `poe test` and `poe test-cov` now end in a collect-only pass over tests/tck, which imports every test module and resolves the feature files without starting a container -- under a second, 56 tests collected. The two default tasks become sequences, so their commands move to `test-default` and `test-cov-default`. `poe cov`, which is what build.yml runs, is unchanged in name and now covers the collect as well. Signed-off-by: Simon Schrottner <simon.schrottner@flagsmith.com>
1 parent 34aa7f3 commit 70b4f50

2 files changed

Lines changed: 37 additions & 18 deletions

File tree

‎providers/openfeature-provider-ofrep/README.md‎

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,30 @@ poe test-tck # needs Docker
3737
poe test # everything else, which is what CI runs
3838
```
3939

40-
The exclusion is a decision rather than an oversight. It needs Docker, and — the part that actually
41-
decides it — a conformance suite reports what is true of the *stack* under test. A full run today is
42-
**2 failed, 37 passed, 16 skipped, 1 xfailed**: both failures are canonical flags that flagd-testbed
43-
v3.8.0 does not seed yet, and the `xfail` is the one genuine provider gap, recorded as a
44-
`KnownDeviation` rather than hidden. A gate that has to be green cannot hold a suite whose honest
45-
output is red, and turning the two backend gaps into `xfail`s would say the provider is at fault
46-
where the backend is.
47-
48-
`tests/tck/conftest.py` and `tests/tck/test_ofrep_conformance.py` account for each one, so a
49-
reviewer running the suite can tell a new failure from a known one.
40+
The exclusion lives in `pyproject.toml`: `--ignore=tests/tck` on the two tasks `build.yml` reaches,
41+
with the reason in a comment above them. Why a conformance suite is not a required gate is
42+
[Appendix F, "Running the suite in CI"][appendix-f], and is not restated here.
43+
44+
Two things that are this provider's rather than the policy's:
45+
46+
- **Docker is not what decides it.** The flagd package's `tests/e2e` needs Docker too and does run in
47+
the default build. What decides it is the run: **2 failed, 37 passed, 16 skipped, 1 xfailed** —
48+
both failures are canonical flags that flagd-testbed v3.8.0 does not seed yet, and the `xfail` is
49+
the one genuine provider gap, recorded as a `KnownDeviation` rather than hidden.
50+
`tests/tck/conftest.py` and `tests/tck/test_ofrep_conformance.py` account for each one, so a
51+
reviewer running the suite can tell a new failure from a known one.
52+
- **The default build still collects the suite** — `poe test` and `poe test-cov` end in
53+
`pytest tests/tck --collect-only`, which imports every module and starts no container. An excluded
54+
suite that has quietly stopped importing against the harness is worse than one that runs and
55+
fails, and `mypy` here is configured over `src` alone, so nothing else would notice.
5056

5157
`tests/tck/settled_control.py` is worth reading before you touch the suite: it is a named workaround
5258
for one backend defect — flagd-testbed's `/start` returns about 40 ms before it serves the flag set,
5359
which the control API forbids — and the specification prescribes that such a wait live in the
5460
adoption, citing the defect, rather than in the shared harness.
5561

5662
[tck]: ../../tools/openfeature-tck/README.md
63+
[appendix-f]: https://github.com/open-feature/spec/blob/main/specification/appendix-f-provider-conformance.md
5764

5865
## License
5966

‎providers/openfeature-provider-ofrep/pyproject.toml‎

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,27 @@ strict = true
8080

8181
[tool.poe.tasks]
8282
# `tests/tck` is excluded from the default build on purpose, and a maintainer
83-
# runs `poe test-tck` by hand before merging a change to it. It needs Docker,
84-
# and more to the point a conformance suite reports what is true of the *stack*
85-
# under test: two of its failures today are canonical flags flagd-testbed does
86-
# not seed yet, which are the report rather than something to hide. A gate that
87-
# has to be green cannot hold a suite whose honest output is red. See
88-
# tests/tck/conftest.py for the tally, and the TCK's README for the policy.
89-
test = "pytest tests --ignore=tests/tck"
90-
test-cov = "coverage run -m pytest tests --ignore=tests/tck"
83+
# runs `poe test-tck` by hand before merging a change to it. Why a conformance
84+
# suite is not a required gate is Appendix F, "Running the suite in CI" --
85+
# linked from tools/openfeature-tck/README.md -- and is deliberately not
86+
# restated here.
87+
#
88+
# What is local to this package: a full run is 2 failed, 37 passed, 16 skipped,
89+
# 1 xfailed. Both failures are canonical flags flagd-testbed does not seed yet,
90+
# and the xfail is the one genuine provider gap; tests/tck/conftest.py accounts
91+
# for them. Docker is not what decides the exclusion -- the flagd package's
92+
# `tests/e2e` needs Docker too and does run.
93+
#
94+
# The suite is still *collected* on every default build, so it cannot quietly
95+
# stop importing against the harness while nobody runs it. `--ignore` would
96+
# otherwise leave nothing checking that, since mypy here is configured over
97+
# `src` alone.
98+
test = ["test-default", "test-tck-collect"]
99+
test-cov = ["test-cov-default", "test-tck-collect"]
100+
test-default = "pytest tests --ignore=tests/tck"
101+
test-cov-default = "coverage run -m pytest tests --ignore=tests/tck"
91102
test-tck = "pytest tests/tck"
103+
test-tck-collect = "pytest tests/tck --collect-only -q"
92104
cov-report = "coverage xml"
93105
cov = [
94106
"test-cov",

0 commit comments

Comments
 (0)