Skip to content
Snippets Groups Projects
Unverified Commit 5dfa00cb authored by Christophe Monniez's avatar Christophe Monniez
Browse files

[FIX] packages: fix docker images builds tests

The automated tests of rpm,deb and src packages are using docker
images and containers. Those tests were not working as expected due
to various small glitches:
* some debian python- packages were missing in the Debian image
* pip was called instead of pip3 for the src test
* a wrong addons path was given for the tests
* the containers id's were wrong due to a bytes implicitly converted
  to str
parent 855a56ba
No related branches found
No related tags found
No related merge requests found
...@@ -4,8 +4,8 @@ FROM debian:stretch ...@@ -4,8 +4,8 @@ FROM debian:stretch
MAINTAINER Odoo S.A. <info@odoo.com> MAINTAINER Odoo S.A. <info@odoo.com>
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y locales && \ apt-get install -y locales && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# Reconfigure locales such that postgresql uses UTF-8 encoding # Reconfigure locales such that postgresql uses UTF-8 encoding
RUN dpkg-reconfigure locales && \ RUN dpkg-reconfigure locales && \
...@@ -14,24 +14,26 @@ RUN dpkg-reconfigure locales && \ ...@@ -14,24 +14,26 @@ RUN dpkg-reconfigure locales && \
ENV LC_ALL C.UTF-8 ENV LC_ALL C.UTF-8
RUN apt-get update -qq && \ RUN apt-get update -qq && \
apt-get upgrade -qq -y && \ apt-get upgrade -qq -y && \
apt-get install \ apt-get install \
adduser \ adduser \
node-less \ node-less \
postgresql \ postgresql \
postgresql-client \ postgresql-client \
python3 \ python3 \
python3-babel \ python3-babel \
python3-dateutil \ python3-dateutil \
python3-decorator \ python3-decorator \
python3-docutils \ python3-docutils \
python3-feedparser \ python3-feedparser \
python3-gevent \
python3-html2text \ python3-html2text \
python3-pil \ python3-pil \
python3-jinja2 \ python3-jinja2 \
python3-lxml \ python3-lxml \
python3-mako \ python3-mako \
python3-mock \ python3-mock \
python3-ofxparse \
python3-passlib \ python3-passlib \
python3-psutil \ python3-psutil \
python3-psycopg2 \ python3-psycopg2 \
...@@ -40,13 +42,15 @@ RUN apt-get update -qq && \ ...@@ -40,13 +42,15 @@ RUN apt-get update -qq && \
python3-pypdf2 \ python3-pypdf2 \
python3-reportlab \ python3-reportlab \
python3-requests \ python3-requests \
python3-serial \
python3-suds \ python3-suds \
python3-tz \ python3-tz \
python3-usb \
python3-vatnumber \ python3-vatnumber \
python3-vobject \ python3-vobject \
python3-werkzeug \ python3-werkzeug \
python3-xlsxwriter \ python3-xlsxwriter \
python3-yaml -y && \ python3-yaml -y && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
RUN echo "PS1=\"[\u@nightly-tests] # \"" > ~/.bashrc RUN echo "PS1=\"[\u@nightly-tests] # \"" > ~/.bashrc
...@@ -144,7 +144,7 @@ class OdooDocker(object): ...@@ -144,7 +144,7 @@ class OdooDocker(object):
) )
time.sleep(2) # let the bash start time.sleep(2) # let the bash start
self.docker.logfile_read = self.log_file self.docker.logfile_read = self.log_file
self.id = subprocess.check_output('docker ps -l -q', shell=True) self.id = subprocess.check_output('docker ps -l -q', shell=True).strip().decode('ascii')
def end(self): def end(self):
try: try:
...@@ -339,14 +339,14 @@ def test_tgz(o): ...@@ -339,14 +339,14 @@ def test_tgz(o):
with docker('odoo-%s-src-nightly-tests' % docker_version, o.build_dir, o.pub) as wheezy: with docker('odoo-%s-src-nightly-tests' % docker_version, o.build_dir, o.pub) as wheezy:
wheezy.release = '*.tar.gz' wheezy.release = '*.tar.gz'
wheezy.system("service postgresql start") wheezy.system("service postgresql start")
wheezy.system('pip install /opt/release/%s' % wheezy.release) wheezy.system('pip3 install /opt/release/%s' % wheezy.release)
wheezy.system("useradd --system --no-create-home odoo") wheezy.system("useradd --system --no-create-home odoo")
wheezy.system('su postgres -s /bin/bash -c "createuser -s odoo"') wheezy.system('su postgres -s /bin/bash -c "createuser -s odoo"')
wheezy.system('su postgres -s /bin/bash -c "createdb mycompany"') wheezy.system('su postgres -s /bin/bash -c "createdb mycompany"')
wheezy.system('mkdir /var/lib/odoo') wheezy.system('mkdir /var/lib/odoo')
wheezy.system('chown odoo:odoo /var/lib/odoo') wheezy.system('chown odoo:odoo /var/lib/odoo')
wheezy.system('su odoo -s /bin/bash -c "odoo --addons-path=/usr/local/lib/python2.7/dist-packages/odoo/addons -d mycompany -i base --stop-after-init"') wheezy.system('su odoo -s /bin/bash -c "odoo -d mycompany -i base --stop-after-init"')
wheezy.system('su odoo -s /bin/bash -c "odoo --addons-path=/usr/local/lib/python2.7/dist-packages/odoo/addons -d mycompany &"') wheezy.system('su odoo -s /bin/bash -c "odoo -d mycompany &"')
def test_deb(o): def test_deb(o):
logging.info('Testing deb package in docker') logging.info('Testing deb package in docker')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment