itsulu-blog-publisher/Dockerfile
Nicholas Riegel 421f65cda6 fix: auto-install addon via conftest for pytest-odoo
Creates conftest.py that installs the addon before tests run via the
pytest_configure hook. Also fixes Dockerfile symlink path for Odoo 17
(no version subdirectory).
2026-05-29 22:45:54 -04:00

23 lines
835 B
Docker

FROM odoo:17.0
# Install Python testing dependencies using the system Python
RUN python3 -m pip install --no-cache-dir \
pytest \
pytest-odoo \
pytest-bdd \
pytest-cov \
pytest-html \
requests
# Copy addon to Odoo addons path
RUN mkdir -p /mnt/extra-addons && chmod 777 /mnt/extra-addons
COPY --chown=odoo:odoo addons/itsulu_blog_publisher /mnt/extra-addons/itsulu_blog_publisher
# Symlink addon into Odoo's default addons directory so Odoo can find it
RUN mkdir -p /var/lib/odoo/addons && ln -s /mnt/extra-addons/itsulu_blog_publisher /var/lib/odoo/addons/itsulu_blog_publisher
# Set working directory to a temp location for test running
WORKDIR /tmp/test
# Default command runs tests (can be overridden)
CMD ["python3", "-m", "pytest", "tests/", "-v", "--html=/tmp/report.html", "--self-contained-html"]