Skip to content

Commit

Permalink
New alpine:latest requiere virtual env for python
Browse files Browse the repository at this point in the history
Component test image is failing on docker build stage.
This is because recent alpine (latest) docker image does not
allow to use pip3 install on non-virtual environment.

So we need to adapt the CT dockerfile as well as the way
to run the component tests.
  • Loading branch information
testillano authored and Eduardo Ramos Testillano (eramedu) committed Dec 17, 2023
1 parent aea1b4b commit 17c41b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ct/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ RUN apk update && apk add \
COPY src /pytest
WORKDIR /pytest

RUN pip3 install -r requirements.txt
RUN python3 -m venv /venv && source /venv/bin/activate && pip3 install -r requirements.txt

CMD [ "sleep", "infinity" ]
2 changes: 1 addition & 1 deletion ct/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ do_test() {
local test_pod=$1
shift
# shellcheck disable=SC2068
kubectl exec -it "${test_pod}" -c test -n "${NAMESPACE}" -- pytest $@
kubectl exec -it "${test_pod}" -c test -n "${NAMESPACE}" -- sh -c "source /venv/bin/activate && pytest $@"
}

#############
Expand Down

0 comments on commit 17c41b9

Please sign in to comment.