Skip to content

Commit e988cde

Browse files
committed
fix tests
1 parent dfc451e commit e988cde

File tree

2 files changed

+50
-5
lines changed

2 files changed

+50
-5
lines changed

rever/docker.xsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def conda_deps(conda=None, conda_channels=None):
8080
s += ' /opt/conda/bin/conda clean -tipsy && \\\n'
8181
s += ' ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \\\n'
8282
s += ' echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \\\n'
83-
s += ' echo "conda activate base" >> ~/.bashrc \\n'
83+
s += ' echo "conda activate base" >> ~/.bashrc && \\\n'
8484
s += ' conda config --set always_yes yes && \\\n'
8585
if channels:
8686
for channel in channels[::-1]:

tests/test_docker.py

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,37 @@ def test_apt_deps(dockerenv, deps, exp):
5656
([], None, ''),
5757
([], ['conda-forge'], ''),
5858
(['dep1', 'dep0'], [],
59-
"""RUN conda config --set always_yes yes && \\
59+
"""RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \\
60+
/bin/bash ~/miniconda.sh -b -p /opt/conda && \\
61+
rm ~/miniconda.sh && \\
62+
/opt/conda/bin/conda clean -tipsy && \\
63+
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \\
64+
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \\
65+
echo "conda activate base" >> ~/.bashrc && \\
66+
conda config --set always_yes yes && \\
6067
conda update --all && \\
6168
conda install \\
6269
dep0 dep1 && \\
6370
conda clean --all && \\
6471
conda info
6572
73+
ENV TINI_VERSION v0.16.1
74+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
75+
RUN chmod +x /usr/bin/tini
76+
77+
ENTRYPOINT [ "/usr/bin/tini", "--" ]
78+
CMD [ "/bin/bash" ]
79+
6680
"""),
6781
(['dep1', 'dep0'], ['conda-forge', 'my-channel'],
68-
"""RUN conda config --set always_yes yes && \\
82+
"""RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \\
83+
/bin/bash ~/miniconda.sh -b -p /opt/conda && \\
84+
rm ~/miniconda.sh && \\
85+
/opt/conda/bin/conda clean -tipsy && \\
86+
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \\
87+
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \\
88+
echo "conda activate base" >> ~/.bashrc && \\
89+
conda config --set always_yes yes && \\
6990
conda config --add channels my-channel && \\
7091
conda config --add channels conda-forge && \\
7192
conda update --all && \\
@@ -74,6 +95,13 @@ def test_apt_deps(dockerenv, deps, exp):
7495
conda clean --all && \\
7596
conda info
7697
98+
ENV TINI_VERSION v0.16.1
99+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
100+
RUN chmod +x /usr/bin/tini
101+
102+
ENTRYPOINT [ "/usr/bin/tini", "--" ]
103+
CMD [ "/bin/bash" ]
104+
77105
"""),
78106
])
79107
def test_conda_deps(dockerenv, deps, channels, exp):
@@ -122,17 +150,27 @@ def test_git_configure(dockerenv, name, email, exp):
122150
EXP_BASE = """FROM zappa/project
123151
124152
ENV HOME /root
153+
ENV LANG C.UTF-8
154+
ENV LC_ALL C.UTF-8
155+
ENV PATH /opt/conda/bin:$PATH
125156
ENV REVER_VCS git
126157
ENV VERSION x.y.z
127158
128159
WORKDIR /root
129160
130161
RUN apt-get -y update && \\
131162
apt-get install -y --fix-missing \\
132-
dep0 dep1 && \\
163+
bzip2 ca-certificates curl dep0 dep1 git wget && \\
133164
apt-get clean -y
134165
135-
RUN conda config --set always_yes yes && \\
166+
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \\
167+
/bin/bash ~/miniconda.sh -b -p /opt/conda && \\
168+
rm ~/miniconda.sh && \\
169+
/opt/conda/bin/conda clean -tipsy && \\
170+
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \\
171+
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \\
172+
echo "conda activate base" >> ~/.bashrc && \\
173+
conda config --set always_yes yes && \\
136174
conda config --add channels my-channel && \\
137175
conda config --add channels conda-forge && \\
138176
conda update --all && \\
@@ -141,6 +179,13 @@ def test_git_configure(dockerenv, name, email, exp):
141179
conda clean --all && \\
142180
conda info
143181
182+
ENV TINI_VERSION v0.16.1
183+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
184+
RUN chmod +x /usr/bin/tini
185+
186+
ENTRYPOINT [ "/usr/bin/tini", "--" ]
187+
CMD [ "/bin/bash" ]
188+
144189
RUN pip install \\
145190
-r req1 -r req0 dep1 dep0
146191
"""

0 commit comments

Comments
 (0)