Skip to content

Commit da108b5

Browse files
Merge pull request #959 from jverswijver/fix_s3_tests
Update test_s3 to work for undockerized testing
2 parents 61dab59 + 7062da2 commit da108b5

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

LNX-docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ services:
7979
set -e
8080
wget -P /home/dja/.local/bin/ https://dl.min.io/client/mc/release/linux-amd64/mc
8181
chmod +x /home/dja/.local/bin/mc
82-
mc alias set myminio/ http://minio:9000 datajoint datajoint
8382
pip install --user -r test_requirements.txt
8483
pip install -e .
8584
pip freeze | grep datajoint

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ GID=1000
134134
* Launch local terminal
135135
* `export` environment variables in shell
136136
* Add entry in `/etc/hosts` for `127.0.0.1 fakeservices.datajoint.io`
137+
* Install [minio client(mc)](https://min.io/download#/linux) so that you can use it in terminal
138+
137139

138140

139141
### Launch Jupyter Notebook for Interactive Use

local-docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ services:
8484
set -e
8585
wget -P /home/dja/.local/bin/ https://dl.min.io/client/mc/release/linux-amd64/mc
8686
chmod +x /home/dja/.local/bin/mc
87-
mc alias set myminio/ http://minio:9000 datajoint datajoint
8887
pip install --user nose nose-cov coveralls flake8 ptvsd
8988
pip install -e .
9089
pip freeze | grep datajoint

tests/test_s3.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ def test_remove_object_exception():
108108
with open('/tmp/policy.json', 'w') as f:
109109
f.write(json.dumps(testpolicy))
110110

111+
# Add alias myminio
112+
os.system(
113+
'mc alias set myminio/ http://fakeservices.datajoint.io datajoint datajoint')
114+
111115
# Add the policy and apply it to the user
112116
os.system('mc admin policy add myminio test /tmp/policy.json')
113117
os.system('mc admin policy set myminio test user=jeffjeff')
@@ -133,6 +137,7 @@ def test_remove_object_exception():
133137
schema.external['share'].s3.client = old_client
134138
schema.external['share'].delete(delete_external_files=True)
135139
os.remove("/tmp/policy.json")
140+
os.system('mc alias remove myminio/')
136141

137142
# Raise the error we want if the error matches the expected uuid
138143
if str(error_list[0][0]) == str(uuid_from_buffer(pack(test[1]))):

0 commit comments

Comments
 (0)