diff --git a/.github/workflows/tox-provider-tutorial.yaml b/.github/workflows/tox-provider-tutorial.yaml new file mode 100644 index 0000000000..5dbc87d25a --- /dev/null +++ b/.github/workflows/tox-provider-tutorial.yaml @@ -0,0 +1,59 @@ +name: Test provider-tutorial with tox + +on: + push: + branches: [ main ] + paths: + - providers/tutorial/** + pull_request: + branches: [ main ] + paths: + - providers/tutorial/** + workflow_dispatch: + +jobs: + tox_test_provider_tutorial: + name: Test provider-tutorial with tox + defaults: + run: + working-directory: providers/tutorial + runs-on: ubuntu-20.04 + strategy: + matrix: + python: ["3.5", "3.6", "3.8", "3.10"] + include: + - python: "3.5" + tox_env_name: "py35" + - python: "3.6" + tox_env_name: "py36" + - python: "3.8" + tox_env_name: "py38" + - python: "3.10" + tox_env_name: "py310" + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + # Python 3.5 setup was failing because of a CERTIFICATE_VERIFY_FAILED + # error. To fix this, we have set up manually PIP_TRUSTED_HOST, checking + # first that we can "curl" the hosts, since they will fail in case of + # expired/invalid/self-signed certificate. + - name: Workaround SSL Certificates manual verification for Python + run: | + curl --fail --silent --show-error https://pypi.python.org + curl --fail --silent --show-error https://pypi.org + curl --fail --silent --show-error https://files.pythonhosted.org + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + env: + PIP_TRUSTED_HOST: pypi.python.org pypi.org files.pythonhosted.org + - name: Install libsystemd-dev + run: | + sudo apt-get update + sudo apt-get install -y libsystemd-dev + - name: Install tox + run: pip install tox + - name: Run tox + run: tox -e${{ matrix.tox_env_name }} diff --git a/docs/tutorial/writing-tests/test-plan.rst b/docs/tutorial/writing-tests/test-plan.rst index 07bbcae63d..fd8ccde326 100644 --- a/docs/tutorial/writing-tests/test-plan.rst +++ b/docs/tutorial/writing-tests/test-plan.rst @@ -285,11 +285,13 @@ compatible alias: _name: (alias) Extended Tutorial Test Plan (Changed id to: `tutorial-extended`) nested_part: tutorial-extended + include: .. note:: Notice how we also changed the ``_name`` so that it points to the "new" id. This makes the migration from the old id (now an alias) to the new one way - easier and frictionless. + easier and frictionless. Also note that include is mandatory, so you have to + place it there empty. Exclusions @@ -312,6 +314,7 @@ expensive to run, we can create a new test plan with it excluded as follows: tutorial-extended exclude: network_speed + include: Now if we ``list-bootstrapped`` the test plan we will see that the test is missing: diff --git a/providers/tutorial/tox.ini b/providers/tutorial/tox.ini new file mode 100644 index 0000000000..60568c30e2 --- /dev/null +++ b/providers/tutorial/tox.ini @@ -0,0 +1,93 @@ +[tox] +envlist = py35,py36,py38,py310 +skip_missing_interpreters = true +skipsdist=True + +[testenv] +allowlist_externals = rm +commands = + {envpython} -m pip -q install ../../checkbox-ng + # Required because this provider depends on checkbox-support parsers & scripts + {envpython} -m pip -q install ../../checkbox-support + rm -f /var/tmp/checkbox-providers-develop/checkbox-provider-resource.provider + # Required because this provider depends on the resource provider + {envpython} ../resource/manage.py develop + {envpython} manage.py validate + {envpython} -m coverage run manage.py test + {envpython} -m coverage report + {envpython} -m coverage xml + +[testenv:py35] +deps = + flake8 + coverage == 5.5 + distro == 1.0.1 + Jinja2 == 2.8 + libsvm == 3.23.0.4 + MarkupSafe == 0.23 + natsort == 4.0.3 + opencv_python == 4.4.0.42 + psutil == 5.9.5 + requests == 2.9.1 + tqdm == 4.19.5 + urwid == 1.3.1 + pyparsing == 2.0.3 + PyYAML == 3.11 + XlsxWriter == 0.7.3 +setenv= +# we do not care about the package version in tox +# but it breaks some old python3.5 builds + SETUPTOOLS_SCM_PRETEND_VERSION=0.0 + +[testenv:py36] +deps = + flake8 + coverage == 5.5 + distro == 1.0.1 + Jinja2 == 2.10 + libsvm == 3.23.0.4 + MarkupSafe == 1.1.0 + natsort == 4.0.3 + opencv_python == 4.4.0.42 + psutil == 5.9.5 + requests == 2.18.4 + tqdm == 4.19.5 + urwid == 2.0.1 + pyparsing == 2.2.0 + PyYAML == 3.12 + XlsxWriter == 0.9.6 + +[testenv:py38] +deps = + flake8 + coverage == 7.3.0 + distro == 1.4.0 + Jinja2 == 2.10.1 + libsvm == 3.23.0.4 + MarkupSafe == 1.1.0 + natsort == 7.0.1 + opencv_python == 4.8.1.78 + requests == 2.22.0 + tqdm == 4.30.0 + urwid == 2.0.1 + pyparsing == 2.4.6 + PyYAML == 5.3.1 + XlsxWriter == 1.1.2 + +[testenv:py310] +deps = + flake8 + coverage == 7.3.0 + distro == 1.7.0 + Jinja2 == 3.0.3 + libsvm == 3.23.0.4 + MarkupSafe == 2.0.1 + natsort == 8.0.2 + opencv_python == 4.8.0.76 + numpy == 1.26.4 + requests == 2.25.1 + tqdm == 4.57.0 + urwid == 2.1.2 + pyparsing == 2.4.7 + PyYAML == 6.0.1 + XlsxWriter == 3.0.2 diff --git a/providers/tutorial/units/test-plan.pxu b/providers/tutorial/units/test-plan.pxu index b735f08d3f..b60d126f90 100644 --- a/providers/tutorial/units/test-plan.pxu +++ b/providers/tutorial/units/test-plan.pxu @@ -42,6 +42,7 @@ id: tutorial-extended-oldid _name: (alias) Extended Tutorial Test Plan (now called just tutorial-extended) nested_part: tutorial-extended +include: unit: test plan id: tutorial-extended-no-speed @@ -51,3 +52,4 @@ nested_part: exclude: network_speed info/systemd-analyze-critical-chain +include: