Skip to content

Commit b8efb1d

Browse files
committed
Deprecate fakeservices.datajoint.io in testing
1 parent e6d034d commit b8efb1d

File tree

3 files changed

+15
-27
lines changed

3 files changed

+15
-27
lines changed

.github/workflows/development.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ jobs:
221221
- name: Publish pip release
222222
run: |
223223
export HOST_UID=$(id -u)
224-
docker compose run \
224+
docker compose run --build \
225225
-e TWINE_USERNAME=${TWINE_USERNAME} -e TWINE_PASSWORD=${TWINE_PASSWORD} app \
226226
sh -c "pip install twine && python -m twine upload dist/*"
227227
- name: Login to DockerHub

docker-compose.yaml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) docker compose up --exit-code-from app --build
1+
# DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) docker compose --profile test up --build --exit-code-from djtest djtest
22
services:
33
db:
44
image: datajoint/mysql:${MYSQL_VER:-8.0}
@@ -34,21 +34,8 @@ services:
3434
timeout: 30s
3535
retries: 5
3636
interval: 15s
37-
fakeservices.datajoint.io:
38-
image: datajoint/nginx:latest
39-
environment:
40-
- ADD_db_TYPE=DATABASE
41-
- ADD_db_ENDPOINT=db:3306
42-
- ADD_minio_TYPE=MINIO
43-
- ADD_minio_ENDPOINT=minio:9000
44-
- ADD_minio_PORT=80 # allow unencrypted connections
45-
- ADD_minio_PREFIX=/datajoint
46-
# ports:
47-
# - "80:80"
48-
# - "443:443"
49-
# - "3306:3306"
5037
app:
51-
image: datajoint/datajoint:py${DJ_VERSION:-latest}
38+
image: datajoint/datajoint:${DJ_VERSION:-latest}
5239
build:
5340
context: .
5441
dockerfile: Dockerfile
@@ -60,13 +47,13 @@ services:
6047
minio:
6148
condition: service_healthy
6249
environment:
63-
- DJ_HOST=fakeservices.datajoint.io
50+
- DJ_HOST=db
6451
- DJ_USER=root
6552
- DJ_PASS=password
66-
- DJ_TEST_HOST=fakeservices.datajoint.io
53+
- DJ_TEST_HOST=db
6754
- DJ_TEST_USER=datajoint
6855
- DJ_TEST_PASSWORD=datajoint
69-
- S3_ENDPOINT=fakeservices.datajoint.io
56+
- S3_ENDPOINT=minio:9000
7057
- S3_ACCESS_KEY=datajoint
7158
- S3_SECRET_KEY=datajoint
7259
- S3_BUCKET=datajoint.test
@@ -75,6 +62,8 @@ services:
7562
working_dir: /src
7663
volumes:
7764
- .:/src
65+
# tty: true
66+
# stdin_open: true
7867
djtest:
7968
extends:
8069
service: app
@@ -84,7 +73,7 @@ services:
8473
- -c
8574
- |
8675
set -e
87-
pip install -e ".[test]"
88-
pip show datajoint
89-
pytest -sv --cov-report term-missing --cov=datajoint tests
76+
pip install -q -e ".[test]"
77+
pip freeze | grep datajoint
78+
pytest --cov-report term-missing --cov=datajoint tests
9079

tests/conftest.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def connection_test(connection_root, prefix, db_creds_test):
195195
@pytest.fixture(scope="session")
196196
def s3_creds() -> Dict:
197197
return dict(
198-
endpoint=os.environ.get("S3_ENDPOINT", "fakeservices.datajoint.io"),
198+
endpoint=os.environ.get("S3_ENDPOINT", "minio:9000"),
199199
access_key=os.environ.get("S3_ACCESS_KEY", "datajoint"),
200200
secret_key=os.environ.get("S3_SECRET_KEY", "datajoint"),
201201
bucket=os.environ.get("S3_BUCKET", "datajoint.test"),
@@ -425,14 +425,13 @@ def http_client():
425425

426426

427427
@pytest.fixture(scope="session")
428-
def minio_client_bare(s3_creds, http_client):
428+
def minio_client_bare(s3_creds):
429429
"""Initialize MinIO with an endpoint and access/secret keys."""
430430
client = minio.Minio(
431-
s3_creds["endpoint"],
431+
endpoint=s3_creds["endpoint"],
432432
access_key=s3_creds["access_key"],
433433
secret_key=s3_creds["secret_key"],
434-
secure=True,
435-
http_client=http_client,
434+
secure=False,
436435
)
437436
return client
438437

0 commit comments

Comments
 (0)