Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit a70ffc0

Browse files
committed
Enable timeseries tests, differently
Rather than messing with ENV in docker, this uses the test-global `config.yml` to enable timeseries tests, and switches to a lighter-weight timescale docker image.
1 parent 9a787d5 commit a70ffc0

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
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

Lines changed: 5 additions & 3 deletions
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,8 +31,9 @@ services:
3131
target: /var/lib/postgresql/data
3232
tmpfs:
3333
size: 2048M
34+
3435
timescale:
35-
image: timescale/timescaledb-ha:pg14-latest
36+
image: timescale/timescaledb:latest-pg14
3637
environment:
3738
- POSTGRES_USER=postgres
3839
- POSTGRES_HOST_AUTH_METHOD=trust
@@ -42,6 +43,7 @@ services:
4243
target: /var/lib/postgresql/data
4344
tmpfs:
4445
size: 2048M
46+
4547
redis:
4648
image: redis:6-alpine
4749

graphql_api/tests/test_config.py

Lines changed: 4 additions & 12 deletions
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)