From 97eb9a7bc50120bef473cd183f9511ff8f600344 Mon Sep 17 00:00:00 2001 From: Morten Brekkevold Date: Thu, 12 Sep 2024 10:46:57 +0200 Subject: [PATCH 1/2] Move snmpsim to test requirements list snmpsim belongs inside the tox test environments, and is required for several tests. Not sure why it was being installed explicitly in the Dockerfiles and workflows, when the correct approach is to name it in the test requirements (I'm guessing because it is used as a command and not as a library by the test suite). This way, it doesn't need to be referenced multiple times. --- .github/workflows/build-and-test.yml | 2 +- tests/docker/Dockerfile | 2 +- tests/requirements.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b8173330d5..e82c2b0881 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -53,7 +53,7 @@ jobs: - name: "Install test runner dependencies" run: | set -xe - python3 -m pip install --upgrade 'pip==23.1.0' setuptools wheel 'tox<4' tox-gh-actions coverage virtualenv 'snmpsim>=1.0' + python3 -m pip install --upgrade 'pip==23.1.0' setuptools wheel 'tox<4' tox-gh-actions coverage virtualenv sudo apt-get install -y nbtscan # virtualenv seems to currently be embedding a broken version of diff --git a/tests/docker/Dockerfile b/tests/docker/Dockerfile index e4a1086ab0..73dcdb5681 100644 --- a/tests/docker/Dockerfile +++ b/tests/docker/Dockerfile @@ -67,7 +67,7 @@ RUN cd /tmp && \ mv chromedriver /usr/local/bin/ # Install our primary test runner -RUN python3.9 -m pip install 'tox<4' 'snmpsim>=1.0' virtualenv +RUN python3.9 -m pip install 'tox<4' virtualenv # Add a build user ENV USER build diff --git a/tests/requirements.txt b/tests/requirements.txt index 98964ea0de..583b53fea0 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -12,6 +12,7 @@ pytest-timeout pytest-twisted~=1.13.0 pytidylib==0.3.2 selenium==3.141.0 +snmpsim>=1.0 toml whisper>=0.9.9 whitenoise==4.1.4 From bc56ce476f7b3cc9e5f1e610b158d99fae06065d Mon Sep 17 00:00:00 2001 From: Morten Brekkevold Date: Thu, 12 Sep 2024 11:20:17 +0200 Subject: [PATCH 2/2] Constrain pyasn1 version It seems as the latest versions of snmpsim are (again) not compatible with the latest versions of pyasn1. Since we're only using these tools in our test environments, this constrains the pyasn1 version by adding it as a test requirement. --- tests/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/requirements.txt b/tests/requirements.txt index 583b53fea0..d7ad4f06a8 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -13,6 +13,7 @@ pytest-twisted~=1.13.0 pytidylib==0.3.2 selenium==3.141.0 snmpsim>=1.0 +pyasn1<0.6.0 # Really just a constraint because of incompatibility with snmpsim toml whisper>=0.9.9 whitenoise==4.1.4