<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Joona, hi Germán,</p>
    <p>Thank you so much for the answers.</p>
    <p>I think I didn't code my tests as they should be and that's why
      I'm having so much trouble. I've tried to workaround it but I
      haven't had any luck.</p>
    <p>I'll try to re-write them using pytest-qgis, with fixtures and
      everything (right now I don't use any, and can't seem to use them
      with how I have set up the tests).</p>
    <p>Thanks again for the responses, hopefully I get it working.</p>
    <p>Kind regards,</p>
    <div class="moz-signature">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <title></title>
      <div class="moz-signature"><b>Sergi Maspons "Maspi"</b></div>
      <div class="moz-signature"> 
        <meta name="Generator" content="Microsoft Word 15">
        <meta name="Originator" content="Microsoft Word 15">
        <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;
        mso-font-charset:0;
        mso-generic-font-family:roman;
        mso-font-pitch:variable;
        mso-font-signature:-536869121 1107305727 33554432 0 415 0;}@font-face
        {font-family:Aptos;
        mso-font-charset:0;
        mso-generic-font-family:swiss;
        mso-font-pitch:variable;
        mso-font-signature:536871559 3 0 0 415 0;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-unhide:no;
        mso-style-qformat:yes;
        mso-style-parent:"";
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:8.0pt;
        margin-left:0cm;
        line-height:107%;
        mso-pagination:widow-orphan;
        font-size:11.0pt;
        font-family:"Aptos",sans-serif;
        mso-ascii-font-family:Aptos;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:Aptos;
        mso-fareast-theme-font:minor-latin;
        mso-hansi-font-family:Aptos;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;
        mso-font-kerning:1.0pt;
        mso-ligatures:standardcontextual;
        mso-fareast-language:EN-US;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#467886;
        mso-themecolor:hyperlink;
        text-decoration:underline;
        text-underline:single;}a:visited, span.MsoHyperlinkFollowed
        {mso-style-noshow:yes;
        mso-style-priority:99;
        color:#96607D;
        mso-themecolor:followedhyperlink;
        text-decoration:underline;
        text-underline:single;}.MsoChpDefault
        {mso-style-type:export-only;
        mso-default-props:yes;
        font-size:11.0pt;
        mso-ansi-font-size:11.0pt;
        mso-bidi-font-size:11.0pt;
        mso-ascii-font-family:Aptos;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:Aptos;
        mso-fareast-theme-font:minor-latin;
        mso-hansi-font-family:Aptos;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;
        mso-fareast-language:EN-US;}.MsoPapDefault
        {mso-style-type:export-only;
        margin-bottom:8.0pt;
        line-height:107%;}div.WordSection1
        {page:WordSection1;}</style></div>
    </div>
    <div class="moz-cite-prefix">El 11/11/2025 a las 15:18, Germán
      Carrillo escribió:<br>
    </div>
    <blockquote type="cite"
cite="mid:CANaz7myDeqWyy_c4qGwEBaA1ofb-WCaV48enRjv2n86UurzP6g@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">Hi Sergi,
          <div><br>
          </div>
          <div>I think I faced the same issue earlier this year.</div>
          <div><br>
          </div>
          <div>Have a look at our test.yaml file [1], we needed to pass
            PYTHONPATH to the docker run command.</div>
          <div><br>
          </div>
          <div>Hope that helps.</div>
          <div><br>
          </div>
          <div>Regards,</div>
          <div><br>
          </div>
          <div>Germán</div>
          <div>-----------</div>
          <div>[1] <a
href="https://github.com/opengisch/pzp/blob/f951fa3fa4ae3662d01d733ea6a32a4d41acedc6/.github/workflows/test.yml#L33"
              moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/opengisch/pzp/blob/f951fa3fa4ae3662d01d733ea6a32a4d41acedc6/.github/workflows/test.yml#L33</a></div>
          <div><br>
          </div>
        </div>
        <br>
        <div class="gmail_quote gmail_quote_container">
          <div dir="ltr" class="gmail_attr">El mar, 11 nov 2025 a las
            5:06, Joona Laine via QGIS-Developer (<<a
              href="mailto:qgis-developer@lists.osgeo.org"
              moz-do-not-send="true" class="moz-txt-link-freetext">qgis-developer@lists.osgeo.org</a>>)
            escribió:<br>
          </div>
          <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div dir="ltr">Hi,
              <div><br>
              </div>
              <div>Are you using pytest-qgis already in your tests? If
                you are, just use the fixture qgis_processing in your
                tests and testing processing algorithms should work just
                fine. Check here for more details on how to easily test
                algorithms: <a
href="https://github.com/GispoCoding/pytest-qgis/issues/27"
                  target="_blank" moz-do-not-send="true"
                  class="moz-txt-link-freetext">https://github.com/GispoCoding/pytest-qgis/issues/27</a></div>
              <div><br>
              </div>
              <div>Cheers,</div>
              <div>Joona</div>
            </div>
            <br>
            <div class="gmail_quote">
              <div dir="ltr" class="gmail_attr">ti 11.11.2025 klo 11.09
                Sergi Maspons - BGEO via QGIS-Developer (<a
                  href="mailto:qgis-developer@lists.osgeo.org"
                  target="_blank" moz-do-not-send="true"
                  class="moz-txt-link-freetext">qgis-developer@lists.osgeo.org</a>)
                kirjoitti:<br>
              </div>
              <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                <div>
                  <p>Hi all,</p>
                  <p>I'm trying to build some CI tests on GitHub (with
                    pytest) using the official qgis/qgis Docker image.
                    Everything works fine except for the parts of my
                    plugin that use Processing algorithms. I'd like to
                    run full workflow tests, but the processing plugin
                    doesn't seem to be available in the container.</p>
                  <p>When I try to load it with
                    qgis.utils.loadPlugin('processing') I get this
                    error:<br>
                  </p>
                  <pre><font size="1">Python error(2): Traceback (most recent call last):</font>
<font size="1">  File "/usr/share/qgis/python/qgis/utils.py", line 447, in loadPlugin</font>
<font size="1">    __import__(packageName)</font>
<font size="1">  File "/usr/share/qgis/python/qgis/utils.py", line 1100, in _import</font>
<font size="1">    mod = _builtin_import(name, globals, locals, fromlist, level)</font>
<font size="1">          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</font>
<font size="1">ModuleNotFoundError: No module named 'processing'</font>

<font size="1">Couldn't load plugin 'processing'(1): Couldn't load plugin 'processing'</font></pre>
                  <p>I can't find much documentation on how to build CI
                    tests for a QGIS plugin, so I've been trying to make
                    it work, but I don't know if I'm doing it rightly...</p>
                  <p>I've tried installing extra packages
                    (qgis-plugin-grass, grass, saga) in the Dockerfile,
                    but it didn't help.</p>
                  <p>Here's my <b>Dockerfile</b>:<br>
                  </p>
                  <pre><font size="2">ARG QGIS_TEST_VERSION=latest
FROM  qgis/qgis:${QGIS_TEST_VERSION}

RUN apt-get update \
    && apt-get install -y python3-pip qgis-plugin-grass grass saga \
    && rm -rf /var/lib/apt/lists/*

COPY ./test/requirements.txt /tmp/
RUN pip3 install --upgrade pip || true
RUN pip3 install -r /tmp/requirements.txt || pip3 install -r /tmp/requirements.txt --break-system-packages
ENV LANG=C.UTF-8
WORKDIR /</font></pre>
                  <p>This is my <b>run-docker-tests.sh</b>:<br>
                  </p>
                  <pre><font size="2">#!/usr/bin/env bash
set -e
pushd /usr/src/ibergis_qgis_plugin
xvfb-run pytest
popd</font></pre>
                  <p>And the relevant part of <b>GitHub Actions
                      (test.yml)</b>:<br>
                  </p>
                  <pre><font size="2">  # Run unit tests
  tests-qgis:
    runs-on: ubuntu-24.04
    strategy:
      fail-fast: false
      matrix:
        qgis_version: [latest, ltr, stable]
    env:
      QGIS_TEST_VERSION: ${{ matrix.qgis_version }}
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          submodules: recursive

      - name: Test
        run: |
          chmod +x .docker/run-docker-tests.sh
          docker compose -f .docker/docker-compose.yml run qgis /usr/src/ibergis_qgis_plugin/.docker/run-docker-tests.sh</font></pre>
                  <p>I haven't found much documentation on running QGIS
                    plugin tests in CI environments, so I might be
                    missing something obvious.<br>
                    If anyone has experience running tests that use
                    Processing algorithms inside Docker, I'd really
                    appreciate some guidance.</p>
                  <p>Thanks in advance!</p>
                  <div>-- <br>
                    <div><b>Sergi Maspons "Maspi"</b><br>
                    </div>
                  </div>
                </div>
                _______________________________________________<br>
                QGIS-Developer mailing list<br>
                <a href="mailto:QGIS-Developer@lists.osgeo.org"
                  target="_blank" moz-do-not-send="true"
                  class="moz-txt-link-freetext">QGIS-Developer@lists.osgeo.org</a><br>
                List info: <a
href="https://lists.osgeo.org/mailman/listinfo/qgis-developer"
                  rel="noreferrer" target="_blank"
                  moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
                Unsubscribe: <a
href="https://lists.osgeo.org/mailman/listinfo/qgis-developer"
                  rel="noreferrer" target="_blank"
                  moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
              </blockquote>
            </div>
            _______________________________________________<br>
            QGIS-Developer mailing list<br>
            <a href="mailto:QGIS-Developer@lists.osgeo.org"
              target="_blank" moz-do-not-send="true"
              class="moz-txt-link-freetext">QGIS-Developer@lists.osgeo.org</a><br>
            List info: <a
href="https://lists.osgeo.org/mailman/listinfo/qgis-developer"
              rel="noreferrer" target="_blank" moz-do-not-send="true"
              class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
            Unsubscribe: <a
href="https://lists.osgeo.org/mailman/listinfo/qgis-developer"
              rel="noreferrer" target="_blank" moz-do-not-send="true"
              class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
          </blockquote>
        </div>
        <div><br clear="all">
        </div>
        <div><br>
        </div>
      </div>
    </blockquote>
  </body>
</html>