Commit 79bb01b
test(e2e): add Behave step definitions for context merging (#593)
* test(e2e): add Behave step definitions for context merging
Add the missing E2E step definitions so the contextMerging.feature
scenarios from the OpenFeature spec run against python-sdk.
Fixes #500
Changes:
- Bump spec submodule to 130df3eb so contextMerging.feature is copied in
during the `poe e2e` task.
- Add tests/features/environment.py with a before_scenario hook that
resets provider/hook/API-context/transaction-context state, so
scenarios cannot leak state between features.
- Add tests/features/steps/context_merging_steps.py:
- RetrievableContextProvider captures the merged EvaluationContext
it receives, so assertions can inspect what the SDK merged.
- Step definitions for all scenarios in contextMerging.feature:
single-level insert, multi-level insert, and per-key overwrite
precedence across API / Transaction / Client / Invocation /
Before Hooks.
- Client-level context is set via direct attribute assignment on
OpenFeatureClient.context (no new setter), since merging already
honors client.context (openfeature/client.py:422-429).
Runs clean: 4 features / 50 scenarios / 233 steps.
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* docs: fix inaccuracies in README code examples (#592)
Signed-off-by: Jonathan Norris <jonathan.norris@dynatrace.com>
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* fix: correctly reset api state on shutdown (#589)
correctly reset api state on shutdown
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* chore(main): release 0.9.0 (#555)
Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* chore(deps): update pre-commit hook tox-dev/pyproject-fmt to v2.21.2 (#601)
* chore(deps): update pre-commit hook tox-dev/pyproject-fmt to v2.21.2
* upper bound toml-fmt-common till fixed
Signed-off-by: gruebel <anton.gruebel@gmail.com>
---------
Signed-off-by: gruebel <anton.gruebel@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: gruebel <anton.gruebel@gmail.com>
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* chore(deps): update astral-sh/setup-uv action to v8 (#603)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* chore(deps): update codecov/codecov-action action to v6 (#604)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* chore(deps): update googleapis/release-please-action action to v5 (#605)
* chore(deps): update googleapis/release-please-action action to v5
* fix config
Signed-off-by: gruebel <anton.gruebel@gmail.com>
---------
Signed-off-by: gruebel <anton.gruebel@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: gruebel <anton.gruebel@gmail.com>
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* chore(deps): update pre-commit hook pre-commit/mirrors-mypy to v2 (#606)
* chore(deps): update pre-commit hook pre-commit/mirrors-mypy to v2
* update config
Signed-off-by: gruebel <anton.gruebel@gmail.com>
---------
Signed-off-by: gruebel <anton.gruebel@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: gruebel <anton.gruebel@gmail.com>
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* chore(deps): update dependency prek to >=0.4.3,<0.5.0 (#607)
* chore(deps): update dependency prek to >=0.4.3,<0.5.0
* adjust CI
Signed-off-by: gruebel <anton.gruebel@gmail.com>
---------
Signed-off-by: gruebel <anton.gruebel@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: gruebel <anton.gruebel@gmail.com>
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* feat!: make set_provider non-blocking, add set_provider_and_wait (#595)
* feat!: make set_provider non-blocking, add set_provider_and_wait
Signed-off-by: Jonathan Norris <jonathan.norris@dynatrace.com>
* fix: ruff format signature collapse in api.py
Signed-off-by: Jonathan Norris <jonathan.norris@dynatrace.com>
* fix: use threading.Event in error event test to avoid flaky busy-wait
Signed-off-by: Jonathan Norris <jonathan.norris@dynatrace.com>
* fixup: pr feedback and additional checks
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
* fix: check active registration in stale-init guard, not _provider_status
Signed-off-by: Jonathan Norris <jonathan.norris@dynatrace.com>
* fixup: edge shutdown race
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
---------
Signed-off-by: Jonathan Norris <jonathan.norris@dynatrace.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* fix: isolate provider event handler dispatch (#599)
* Isolate provider event handlers
Signed-off-by: Lucas-FManager <265058144+Lucas-FManager@users.noreply.github.com>
* Address event handler review feedback
Signed-off-by: Lucas-FManager <265058144+Lucas-FManager@users.noreply.github.com>
* test: cover event dispatch noop path
Signed-off-by: Lucas-FManager <265058144+Lucas-FManager@users.noreply.github.com>
* fixup: drain executor at exit and relax non-blocking test timing margin
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
---------
Signed-off-by: Lucas-FManager <265058144+Lucas-FManager@users.noreply.github.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Lucas-FManager <265058144+Lucas-FManager@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* test: fix flaky event handler test (#609)
fix flaky event handler test
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.15.15 (#608)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* chore(main): release 0.10.0 (#602)
* chore(main): release 0.10.0
Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
* docs: clarify non-blocking set_provider behavior in changelog
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
---------
Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* fix CR comments
Signed-off-by: gruebel <anton.gruebel@gmail.com>
* cleanup
Signed-off-by: gruebel <anton.gruebel@gmail.com>
---------
Signed-off-by: gruebel <anton.gruebel@gmail.com>
Signed-off-by: Jonathan Norris <jonathan.norris@dynatrace.com>
Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Signed-off-by: Lucas-FManager <265058144+Lucas-FManager@users.noreply.github.com>
Co-authored-by: Jonathan Norris <jonathan.norris@dynatrace.com>
Co-authored-by: Anton Grübel <anton.gruebel@gmail.com>
Co-authored-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Nguyen Cat Luong <pkiphone.anhluong@gmail.com>
Co-authored-by: Lucas-FManager <265058144+Lucas-FManager@users.noreply.github.com>1 parent da485f3 commit 79bb01b
3 files changed
Lines changed: 202 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
0 commit comments