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

Make the integration tests compatible with the dev environments #252

Merged
merged 4 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 20 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
FROM debian:buster

ENV PYTHONUNBUFFERED=1 \
DEBIAN_FRONTEND=noninteractive

RUN \
echo "Install base packages" \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
gcc \
git \
gnupg \
curl \
ca-certificates \
# pyenv dependencies (https://github.com/pyenv/pyenv/wiki#suggested-build-environment)
make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev \
libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev \
libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
&& echo "Clean up" \
&& rm -rf /tmp/*

RUN \
echo "install pyenv" \
&& curl https://pyenv.run | bash
DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y --no-install-recommends \
awscli \
gcc \
git \
gnupg \
curl \
ca-certificates \
jq \
# pyenv dependencies (https://github.com/pyenv/pyenv/wiki#suggested-build-environment)
make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev \
libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev \
libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
&& rm -rf /var/lib/apt/lists/*

RUN curl https://pyenv.run | bash

ENV PYENV_ROOT /root/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
Expand All @@ -32,11 +29,8 @@ WORKDIR /var/project

COPY tox-python-versions .

RUN \
echo "Install python based on .python-version file" \
&& while read line; do pyenv install "$line" < /dev/null; done < tox-python-versions
RUN xargs -a tox-python-versions -n 1 -P $(nproc) pyenv install

# Make all files available so we can run "make bootstrap" and install dependencies.
COPY . .

# Make pyenv activate all installed Python versions for tox (available as pythonX.Y)
Expand All @@ -45,6 +39,4 @@ RUN pyenv global $(tr '\n' ' ' < tox-python-versions)

RUN make bootstrap

RUN \
echo "installing tox" \
&& pip install tox
RUN pip install tox
8 changes: 4 additions & 4 deletions integration_test/integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ def get_pdf_for_letter(python_client, id):
if exc.message[0]["error"] != "PDFNotReadyError":
raise

count += 3
if count > 45:
print(f"pdf {id} not ready at {datetime.utcnow()} after 45 seconds") # noqa: T201
count += 5
if count > 120:
print(f"pdf {id} not ready at {datetime.utcnow()} after 120 seconds") # noqa: T201
raise
else:
time.sleep(3)
time.sleep(5)

assert type(response) == BytesIO
assert len(response.read()) != 0
Expand Down