Skip to content

Commit 0ec7fe2

Browse files
authoredMar 3, 2025··
Enable timeseries tests, differently (#1184)
1 parent 9a787d5 commit 0ec7fe2

File tree

4 files changed

+11
-33
lines changed

4 files changed

+11
-33
lines changed
 

‎Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ REQUIREMENTS_TAG := requirements-v1-$(shell sha1sum requirements.txt | cut -d '
1111
VERSION := release-${sha}
1212
CODECOV_UPLOAD_TOKEN ?= "notset"
1313
CODECOV_STATIC_TOKEN ?= "notset"
14-
TIMESERIES_ENABLED ?= "true"
1514
CODECOV_URL ?= "https://api.codecov.io"
1615
export DOCKER_BUILDKIT=1
1716
export API_DOCKER_REPO=${AR_REPO}
@@ -191,7 +190,7 @@ shell:
191190

192191
test_env.up:
193192
env | grep GITHUB > .testenv; true
194-
TIMESERIES_ENABLED=${TIMESERIES_ENABLED} docker-compose up -d
193+
docker-compose up -d
195194

196195
test_env.prepare:
197196
docker-compose exec api make test_env.container_prepare

‎docker-compose.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ services:
1414
- ./dev.sh
1515
environment:
1616
- RUN_ENV=DEV
17-
- SETUP__TIMESERIES__ENABLED=${TIMESERIES_ENABLED-true}
1817
# Improves pytest-cov performance in python 3.12
1918
# https://github.com/nedbat/coveragepy/issues/1665#issuecomment-1937075835
2019
- COVERAGE_CORE=sysmon
2120
env_file:
2221
- .testenv
22+
2323
postgres:
24-
image: postgres:14.7-alpine
24+
image: postgres:14-alpine
2525
environment:
2626
- POSTGRES_USER=postgres
2727
- POSTGRES_HOST_AUTH_METHOD=trust
@@ -31,17 +31,14 @@ services:
3131
target: /var/lib/postgresql/data
3232
tmpfs:
3333
size: 2048M
34+
3435
timescale:
3536
image: timescale/timescaledb-ha:pg14-latest
3637
environment:
3738
- POSTGRES_USER=postgres
3839
- POSTGRES_HOST_AUTH_METHOD=trust
3940
- POSTGRES_PASSWORD=password
40-
volumes:
41-
- type: tmpfs
42-
target: /var/lib/postgresql/data
43-
tmpfs:
44-
size: 2048M
41+
4542
redis:
4643
image: redis:6-alpine
4744

‎docker/test.yml

+2-12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ setup:
33
debug: no
44
loglvl: INFO
55
encryption_secret: "zp^P9*i8aR3"
6+
timeseries:
7+
enabled: true
68
okta:
79
iss: "https://example.okta.com"
810
http:
@@ -11,18 +13,6 @@ setup:
1113
timeouts:
1214
connect: 10
1315
receive: 15
14-
tasks:
15-
celery:
16-
soft_timelimit: 200
17-
hard_timelimit: 240
18-
upload:
19-
queue: uploads
20-
cache:
21-
yaml: 600 # 10 minutes
22-
tree: 600 # 10 minutes
23-
diff: 300 # 5 minutes
24-
chunks: 300 # 5 minutes
25-
uploads: 86400 # 1 day
2616

2717
services:
2818
database_url: postgres://postgres:password@postgres:5432/postgres

‎graphql_api/tests/test_config.py

+4-12
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ def test_seats_limit_self_hosted(self, license_seats):
107107
},
108108
}
109109

110-
@override_settings(
111-
TIMESERIES_ENABLED=True,
112-
)
110+
@override_settings(TIMESERIES_ENABLED=True)
113111
def test_timeseries_enabled(self):
114112
data = self.gql_request("query { config { isTimescaleEnabled }}")
115113
assert data == {
@@ -118,9 +116,7 @@ def test_timeseries_enabled(self):
118116
},
119117
}
120118

121-
@override_settings(
122-
TIMESERIES_ENABLED=False,
123-
)
119+
@override_settings(TIMESERIES_ENABLED=False)
124120
def test_timeseries_enabled_is_false(self):
125121
data = self.gql_request("query { config { isTimescaleEnabled }}")
126122
assert data == {
@@ -129,9 +125,7 @@ def test_timeseries_enabled_is_false(self):
129125
},
130126
}
131127

132-
@override_settings(
133-
TIMESERIES_ENABLED="true",
134-
)
128+
@override_settings(TIMESERIES_ENABLED="true")
135129
def test_timeseries_enabled_is_true_string(self):
136130
data = self.gql_request("query { config { isTimescaleEnabled }}")
137131
assert data == {
@@ -140,9 +134,7 @@ def test_timeseries_enabled_is_true_string(self):
140134
},
141135
}
142136

143-
@override_settings(
144-
TIMESERIES_ENABLED="false",
145-
)
137+
@override_settings(TIMESERIES_ENABLED="false")
146138
def test_timeseries_enabled_is_false_string(self):
147139
data = self.gql_request("query { config { isTimescaleEnabled }}")
148140
assert data == {

0 commit comments

Comments
 (0)
Please sign in to comment.