Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_web: add 'config parse' test #91

Merged
merged 3 commits into from
Dec 5, 2019
Merged

Conversation

joshmoore
Copy link
Member

see: ome/omero-py#130 (review)

config parse requires web settings to be present. Adding a test to this repo. This test will fail if the UTF-8 settings of the docker are removed:

git diff Dockerfile
diff --git a/Dockerfile b/Dockerfile
index 30b1ea494..740db5a77 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,6 @@
 FROM centos:centos7
-RUN localedef -i en_US -f UTF-8 en_US.UTF-8
-ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
+#RUN localedef -i en_US -f UTF-8 en_US.UTF-8
+#ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

or if the environment variables are removed in tox:

git diff tox.ini
diff --git a/tox.ini b/tox.ini
index 1b8e87453..ef20fa3e6 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = py27, py36
+envlist = py27, py36-{utf8,c}
 # https://tox.readthedocs.io/en/latest/config.html#conf-requires
 # Ensure pip is new so we can install manylinux wheel
 requires = pip >= 19.0.0
@@ -24,6 +25,8 @@ setenv =
     OMERO_HOME = {toxinidir}
     DJANGO_SETTINGS_MODULE = omeroweb.settings
     PYTHONPATH = {toxinidir}
+    c: LANG=c
+    c: LC_ALL=c
 passenv =
     ICE_CONFIG
     PIP_CACHE_DIR

@joshmoore
Copy link
Member Author

This depends on ome/omero-py#130

@joshmoore
Copy link
Member Author

py2 is failing at https://travis-ci.org/ome/omero-web/builds/617815427#L4037 with:

>                       properties += "%s\n" % (line)
E                       UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 23: ordinal not in range(128)
.tox/py27/lib/python2.7/site-packages/omero/install/config_parser.py:417: UnicodeDecodeError

I fixed this for ome/omero-documentation#2035 by migrating to Python 3.

@joshmoore
Copy link
Member Author

I opened a PR linking back to the root issue here: ome/omero-py#142 Merging.

@joshmoore joshmoore merged commit 95f5bc3 into ome:master Dec 5, 2019
@joshmoore joshmoore deleted the test-parse branch December 5, 2019 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant