Skip to content

Commit 1f21ca5

Browse files
authored
Update contract tests to latest flask version (#176)
Our contract tests depend on flask v1, which in turn depends on Jinja 2. Both of these are terribly dated and no longer supported. Jinja depends on markupsafe. markupsafe recently updated its code to no longer provide soft_unicode which in turn broke Jinja. Updating to the latest flask keeps all transitive dependencies better aligned and addresses this mismatch.
1 parent 394982f commit 1f21ca5

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

.circleci/config.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ workflows:
1010
name: Python 3.5
1111
docker-image: cimg/python:3.5
1212
skip-sse-contract-tests: true # the test service app has dependencies that aren't available in 3.5, which is EOL anyway
13+
skip-contract-tests: true # the test service app has dependencies that aren't available in 3.5, which is EOL anyway
1314
- test-linux:
1415
name: Python 3.6
1516
docker-image: cimg/python:3.6
@@ -46,6 +47,9 @@ jobs:
4647
skip-sse-contract-tests:
4748
type: boolean
4849
default: false
50+
skip-contract-tests:
51+
type: boolean
52+
default: false
4953
docker:
5054
- image: <<parameters.docker-image>>
5155
- image: redis
@@ -109,13 +113,16 @@ jobs:
109113
name: run SSE contract tests
110114
command: cd sse-contract-tests && make run-contract-tests
111115

112-
- run: make build-contract-tests
113-
- run:
114-
command: make start-contract-test-service
115-
background: true
116-
- run:
117-
name: run contract tests
118-
command: TEST_HARNESS_PARAMS="-junit test-reports/contract-tests-junit.xml" make run-contract-tests
116+
- unless:
117+
condition: <<parameters.skip-contract-tests>>
118+
steps:
119+
- run: make build-contract-tests
120+
- run:
121+
command: make start-contract-test-service
122+
background: true
123+
- run:
124+
name: run contract tests
125+
command: TEST_HARNESS_PARAMS="-junit test-reports/contract-tests-junit.xml" make run-contract-tests
119126

120127
- store_test_results:
121128
path: test-reports

contract-tests/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Flask==1.1.4
1+
Flask==2.0.3
22
urllib3>=1.22.0

ldclient/impl/integrations/redis/redis_big_segment_store.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ def __init__(self, url: str, prefix: Optional[str], max_connections: int):
2626
def get_metadata(self) -> BigSegmentStoreMetadata:
2727
r = redis.Redis(connection_pool=self._pool)
2828
value = r.get(self._prefix + self.KEY_LAST_UP_TO_DATE)
29-
return BigSegmentStoreMetadata(None if value is None else int(value))
29+
if value is None:
30+
return BigSegmentStoreMetadata(None)
31+
32+
return BigSegmentStoreMetadata(int(value))
3033

3134
def get_membership(self, user_hash: str) -> Optional[dict]:
3235
r = redis.Redis(connection_pool=self._pool)

sse-contract-tests/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Flask==2.0.2
1+
Flask==2.0.3
22
urllib3>=1.22.0

0 commit comments

Comments
 (0)