From 79bd08a8db4487c0ddf72486cb1553ded7528df8 Mon Sep 17 00:00:00 2001 From: Nicolas Ruflin Date: Tue, 19 Apr 2016 09:38:27 +0200 Subject: [PATCH] Upgrade pip to fetch most recent dependencies (#1411) Pip must be upgraded to the most recent version before other packages are installed to make sure to fetch the most recent versions. For this, pip is not installed before all the other requirements. * Requirement for python 2.7.9 was added. Reason see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning * Updated CONTRIBUTING.md with Docker versions --- CONTRIBUTING.md | 10 +++++++++- libbeat/Dockerfile | 3 +++ libbeat/scripts/Makefile | 1 + libbeat/tests/system/requirements.txt | 3 +-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dc0e7654439..66527f9771e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,9 +73,17 @@ Packetbeat: Some of the Beats might have extra development requirements, in which case a CONTRIBUTING.md file is find in the Beat directory. +## Testing + You can run the whole testsuite with the following command: - # make testsuite + $ make testsuite + +Running the testsuite has the following requirements: + +* Python >=2.7.9 +* Docker >=1.10.0 +* Docker-compose >= 1.7.0 ## Dependencies diff --git a/libbeat/Dockerfile b/libbeat/Dockerfile index 3f51a1d983a..e9c6d281178 100644 --- a/libbeat/Dockerfile +++ b/libbeat/Dockerfile @@ -20,6 +20,9 @@ ENV PYTHON_ENV=/tmp/python-env RUN test -d ${PYTHON_ENV} || virtualenv ${PYTHON_ENV} COPY ./tests/system/requirements.txt /tmp/requirements.txt + +# Upgrade pip to make sure to have the most recent version +RUN . ${PYTHON_ENV}/bin/activate && pip install -U pip RUN . ${PYTHON_ENV}/bin/activate && pip install -Ur /tmp/requirements.txt # Libbeat specific diff --git a/libbeat/scripts/Makefile b/libbeat/scripts/Makefile index 9ef45505011..2d7ad5cbdb9 100755 --- a/libbeat/scripts/Makefile +++ b/libbeat/scripts/Makefile @@ -155,6 +155,7 @@ benchmark-tests: .PHONY: python-env python-env: ${ES_BEATS}/libbeat/tests/system/requirements.txt test -d ${PYTHON_ENV} || virtualenv ${PYTHON_ENV} + . ${PYTHON_ENV}/bin/activate && pip install --upgrade pip ; \ if [ -a ./tests/system/requirements.txt ] && [ ! ${ES_BEATS}/libbeat/tests/system/requirements.txt -ef ./tests/system/requirements.txt ] ; then \ . ${PYTHON_ENV}/bin/activate && pip install -Ur ${ES_BEATS}/libbeat/tests/system/requirements.txt -Ur ./tests/system/requirements.txt ; \ else \ diff --git a/libbeat/tests/system/requirements.txt b/libbeat/tests/system/requirements.txt index 9d04b844d3d..b0a7595205f 100644 --- a/libbeat/tests/system/requirements.txt +++ b/libbeat/tests/system/requirements.txt @@ -1,6 +1,5 @@ +pip nose jinja2 PyYAML nose-timer -pip -