summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 04:06:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 04:06:30 +0000
commitc184d539b46002a85130c44d7c1fac4b3c7b870a (patch)
treec0ca3c082eb08adc185c2bf933cdf4b71ea049c0
parentMerging upstream version 9.5.1+dfsg. (diff)
downloadansible-c184d539b46002a85130c44d7c1fac4b3c7b870a.tar.xz
ansible-c184d539b46002a85130c44d7c1fac4b3c7b870a.zip
Merging debian version 9.5.1+dfsg-1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/changelog15
-rw-r--r--debian/control4
-rw-r--r--debian/gbp.conf5
-rwxr-xr-xdebian/tests/check_flaky.py23
-rw-r--r--debian/tests/control62
-rwxr-xr-xdebian/tests/flaky_tests_list.py27
-rwxr-xr-xdebian/tests/unit-tests-flaky42
-rwxr-xr-xdebian/tests/unit-tests-flaky.py60
-rwxr-xr-xdebian/tests/unit-tests-stable60
-rwxr-xr-xdebian/tests/unit-tests-stable.py63
10 files changed, 243 insertions, 118 deletions
diff --git a/debian/changelog b/debian/changelog
index 5df1e4163..4dad6f667 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+ansible (9.5.1+dfsg-1) unstable; urgency=medium
+
+ * New upstream version 9.5.1+dfsg
+ * autopkgtests: Update dependencies
+ * autopkgtests: Update test dependencies
+ * Add helper script to check the flaky test list and remove non-existant tests
+ * autopkgtests: Update list of flaky tests
+ * Rewrite stable/flaky autopkgtests in python
+ * d/gbp.conf: Switch to DEP-14 branch layout
+ * d/gbp.conf: Sign tags by default
+ * Bump Standards-Version (no changes needed)
+ * d/control: Bump minimum version dependency of ansible-core
+
+ -- Lee Garrett <debian@rocketjump.eu> Thu, 25 Apr 2024 22:34:37 +0200
+
ansible (9.4.0+dfsg-1~progress7.99u1) graograman-backports; urgency=medium
* Uploading to graograman-backports, remaining changes:
diff --git a/debian/control b/debian/control
index dd196428b..956f73312 100644
--- a/debian/control
+++ b/debian/control
@@ -18,7 +18,7 @@ Build-Depends: debhelper-compat (= 13),
python3-straight.plugin,
python3-yaml,
Rules-Requires-Root: no
-Standards-Version: 4.6.2
+Standards-Version: 4.7.0
Vcs-Browser: https://git.progress-linux.org/packages/graograman-backports/ansible
Vcs-Git: https://git.progress-linux.org/packages/graograman-backports/ansible
XSBC-Original-Vcs-Browser: https://salsa.debian.org/debian/ansible
@@ -29,7 +29,7 @@ Package: ansible
Architecture: all
Depends: ${misc:Depends},
${python3:Depends},
- ansible-core (>= 2.11.5-1~),
+ ansible-core (>= 2.16.6-1~),
openssh-client | python3-paramiko (>= 2.6.0),
python3-dnspython,
python3-httplib2,
diff --git a/debian/gbp.conf b/debian/gbp.conf
index 2e3926b48..fbd98f560 100644
--- a/debian/gbp.conf
+++ b/debian/gbp.conf
@@ -1,9 +1,10 @@
# Configuration for git-buildpackage and affiliated tools
[DEFAULT]
-debian-branch = master
-upstream-branch = upstream
+debian-branch = debian/latest
pristine-tar = True
+sign-tags = True
+upstream-branch = upstream/latest
[import-orig]
merge-mode = replace
diff --git a/debian/tests/check_flaky.py b/debian/tests/check_flaky.py
new file mode 100755
index 000000000..b7099d5de
--- /dev/null
+++ b/debian/tests/check_flaky.py
@@ -0,0 +1,23 @@
+#!/usr/bin/python3
+
+# check if the list of flaky tests is actually valid
+# Must be run from base of git dir
+
+import os
+import subprocess
+import sys
+
+sys.dont_write_bytecode = True
+from flaky_tests_list import flaky_test_dirs
+
+rc = 0
+
+for i in flaky_test_dirs:
+
+ testdir = os.path.join(i, 'tests', 'unit')
+
+ if not os.path.isdir(testdir):
+ print(testdir, 'does not exist. Consider removing it from flaky_test_dirs.py')
+ rc=1
+
+exit(rc)
diff --git a/debian/tests/control b/debian/tests/control
index 0aeacb7bd..4b85b722e 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,23 +1,61 @@
-Tests: unit-tests-stable
+Tests: unit-tests-stable.py
Depends: @,
git,
- python3-boto3,
+ python3-azure,
python3-bcrypt,
+ python3-boto3,
+ python3-cryptography,
+ python3-dateutil,
python3-flake8,
+ python3-gitlab,
+ python3-google-auth,
+ python3-httmock,
+ python3-hvac,
+ python3-jsonschema,
+ python3-kubernetes,
+ python3-lxml,
python3-mock,
+ python3-msrestazure,
+ python3-openssl,
+ python3-paramiko,
+ python3-proxmoxer,
python3-pytest-forked,
python3-pytest-mock,
python3-pytest-xdist,
+ python3-pyvmomi,
+ python3-redis,
+ python3-textfsm,
+ python3-xmltodict,
yamllint
# failing tests due to missing packages or other reasons
-#Tests: unit-tests-flaky
-#Depends: @,
-# git,
-# python3-boto3,
-# python3-flake8,
-# python3-mock,
-# python3-pytest-xdist,
-# python3-pyvmomi,
-# yamllint
-#Restrictions: flaky
+Tests: unit-tests-flaky.py
+Depends: @,
+ git,
+ python3-azure,
+ python3-bcrypt,
+ python3-boto3,
+ python3-cryptography,
+ python3-dateutil,
+ python3-flake8,
+ python3-gitlab,
+ python3-google-auth,
+ python3-httmock,
+ python3-hvac,
+ python3-jsonschema,
+ python3-kubernetes,
+ python3-lxml,
+ python3-mock,
+ python3-msrestazure,
+ python3-openssl,
+ python3-paramiko,
+ python3-proxmoxer,
+ python3-pytest-forked,
+ python3-pytest-mock,
+ python3-pytest-xdist,
+ python3-pyvmomi,
+ python3-redis,
+ python3-textfsm,
+ python3-xmltodict,
+ yamllint
+Restrictions: flaky
diff --git a/debian/tests/flaky_tests_list.py b/debian/tests/flaky_tests_list.py
new file mode 100755
index 000000000..3a49c9b2d
--- /dev/null
+++ b/debian/tests/flaky_tests_list.py
@@ -0,0 +1,27 @@
+#!/usr/bin/python3
+
+# This is a list of unit tests that currently fail for various reasons.
+# This list is skipped in unit-tests-stable.py
+# This list is run in unit-tests-flaky.py
+
+flaky_test_dirs = [
+ 'ansible_collections/cisco/aci', # Test likely needs updating; lxml error message on invalid parse changed.
+ 'ansible_collections/cisco/dnac', # TypeError: TestDnacDiscoveryIntent.__init__() takes 1 positional argument but 2 were given
+ 'ansible_collections/community/dns', # [1]
+ 'ansible_collections/community/general', # import broken
+ 'ansible_collections/community/hrobot', # import broken
+ 'ansible_collections/community/library_inventory_filtering_v1', # [1]
+ 'ansible_collections/community/sap', # E ModuleNotFoundError: No module named 'ansible_collections.community.sap.plugins.modules.*'
+ 'ansible_collections/junipernetworks/junos', # test broken
+ 'ansible_collections/netapp_eseries/santricity', # [0]
+ 'ansible_collections/netapp/ontap', # missing netapp_lib
+ 'ansible_collections/ngine_io/cloudstack', # [0]
+ 'ansible_collections/purestorage/fusion', # E ModuleNotFoundError: No module named 'fusion'
+ 'ansible_collections/sensu/sensu_go', # [2]
+ 'ansible_collections/splunk/es', # assert result["changed"] is True
+]
+
+# [0] test/units/compat/mock.py from ansible-core source is not installed
+# in the binary package. Need to check why.
+# [1] E ModuleNotFoundError: No module named 'ansible_collections.community.internal_test_tools'
+# [2] E ansible_collections.sensu.sensu_go.tests.unit.plugins.modules.common.utils.AnsibleFailJson: {'msg': "argument 'pool_size' is of type <class 'NoneType'> and we were unable to convert to int: <class 'NoneType'> cannot be converted to an int", 'failed': True}
diff --git a/debian/tests/unit-tests-flaky b/debian/tests/unit-tests-flaky
deleted file mode 100755
index b4cc64c70..000000000
--- a/debian/tests/unit-tests-flaky
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-# Don't let them fail
-# set -e
-
-BASEPATH=$(pwd)
-
-unit_test_dirs="
-ansible_collections/ngine_io/cloudstack # missing python3-units
-ansible_collections/ansible/netcommon # test broken
-ansible_collections/netapp/ontap # missing netapp_lib
-ansible_collections/netapp_eseries/santricity # missing python3-units
-ansible_collections/community/aws # import broken
-ansible_collections/community/vmware # missing python3-units
-ansible_collections/community/hrobot # import broken
-ansible_collections/community/general # import broken
-ansible_collections/community/skydive # STDERR: WARNING: All targets skipped.
-ansible_collections/junipernetworks/junos # test broken
-ansible_collections/dellemc/os6 # import broken
-ansible_collections/dellemc/os10 # missing python3-units
-ansible_collections/dellemc/os9 # import broken
-"
-
-for i in $unit_test_dirs; do
-
- cd $i 2> /dev/null || continue
-
- echo "\n\n"
- echo "############################################################"
- echo "############################################################"
- echo "#### Running FLAKY tests in $i"
- echo "############################################################"
- echo "############################################################"
-
- /usr/bin/ansible-test units \
- --python-interpreter /usr/bin/python3 \
- --local
-
- cd $BASEPATH
-done
-
-exit 0
diff --git a/debian/tests/unit-tests-flaky.py b/debian/tests/unit-tests-flaky.py
new file mode 100755
index 000000000..db740ee5a
--- /dev/null
+++ b/debian/tests/unit-tests-flaky.py
@@ -0,0 +1,60 @@
+#!/usr/bin/python3
+
+import os
+import subprocess
+import sys
+
+sys.dont_write_bytecode = True
+from flaky_tests_list import flaky_test_dirs
+
+cwd = os.getcwd()
+
+overall_test_rc = 0
+succeeded_tests = []
+failed_tests = []
+
+for i in flaky_test_dirs:
+
+ os.chdir(i)
+
+ print ("\n\n", flush=True)
+ print ("############################################################", flush=True)
+ print ("############################################################", flush=True)
+ print ("#### Running FLAKY tests in", i, flush=True)
+ print ("############################################################", flush=True)
+ print ("############################################################", flush=True)
+
+ rc = subprocess.run([
+ '/usr/bin/ansible-test',
+ 'units',
+ '--python-interpreter',
+ '/usr/bin/python3',
+ '--local'
+ ])
+
+ # don't fail on failed test, continue instead
+ print ("## return code is", rc.returncode)
+
+ if rc.returncode == 0:
+ succeeded_tests.append(i)
+ else:
+ failed_tests.append(i)
+ overall_test_rc = rc.returncode
+
+ os.chdir(cwd)
+
+print ("############################################################", flush=True)
+print ("############################################################", flush=True)
+print ("#### failed tests are:", flush=True)
+for i in failed_tests:
+ print ("####", i, flush=True)
+if len(succeeded_tests) > 0:
+ print ("#### succeeded tests are:", flush=True)
+ for i in succeeded_tests:
+ print ("####", i, flush=True)
+ print ("#### consider removing them from the flaky tests list.", flush=True)
+print ("############################################################", flush=True)
+print ("############################################################", flush=True)
+
+
+exit(overall_test_rc)
diff --git a/debian/tests/unit-tests-stable b/debian/tests/unit-tests-stable
deleted file mode 100755
index d8e4a5b7f..000000000
--- a/debian/tests/unit-tests-stable
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-
-set -e
-
-BASEPATH=$(pwd)
-
-unit_test_dirs="
-ansible_collections/amazon/aws
-ansible_collections/ansible/posix
-ansible_collections/ansible/windows
-ansible_collections/arista/eos
-ansible_collections/cisco/aci
-ansible_collections/cisco/asa
-ansible_collections/cisco/ios
-ansible_collections/cisco/iosxr
-ansible_collections/cisco/nso
-ansible_collections/cisco/nxos
-ansible_collections/community/crypto
-ansible_collections/community/docker
-ansible_collections/community/fortios
-ansible_collections/community/google
-ansible_collections/community/grafana
-ansible_collections/community/kubevirt
-ansible_collections/community/libvirt
-ansible_collections/community/mysql
-ansible_collections/community/network
-ansible_collections/community/postgresql
-ansible_collections/community/rabbitmq
-ansible_collections/community/routeros
-ansible_collections/community/windows
-ansible_collections/f5networks/f5_modules
-ansible_collections/frr/frr
-ansible_collections/google/cloud
-ansible_collections/mellanox/onyx
-ansible_collections/netapp/aws
-ansible_collections/netapp/elementsw
-ansible_collections/netbox/netbox
-ansible_collections/openvswitch/openvswitch
-ansible_collections/vyos/vyos
-"
-
-for i in $unit_test_dirs; do
-
- cd $i 2> /dev/null || continue
-
- echo "\n\n"
- echo "############################################################"
- echo "############################################################"
- echo "#### Running tests in $i"
- echo "############################################################"
- echo "############################################################"
-
- /usr/bin/ansible-test units \
- --python-interpreter /usr/bin/python3 \
- --local
-
- cd $BASEPATH
-done
-
-exit 0
diff --git a/debian/tests/unit-tests-stable.py b/debian/tests/unit-tests-stable.py
new file mode 100755
index 000000000..f44044991
--- /dev/null
+++ b/debian/tests/unit-tests-stable.py
@@ -0,0 +1,63 @@
+#!/usr/bin/python3
+
+import glob
+import os
+import subprocess
+import sys
+
+sys.dont_write_bytecode = True
+from flaky_tests_list import flaky_test_dirs
+
+cwd = os.getcwd()
+
+overall_test_rc = 0
+failed_tests = []
+
+# find all dirs that have unit tests
+for i in glob.glob('ansible_collections/**/tests/unit', recursive=True):
+
+ # base path to run ansible-test is two levels up
+ testdir = os.path.normpath(
+ os.path.join(i, '..', '..')
+ )
+
+ # skip any tests that are flagged as flaky
+ if testdir in flaky_test_dirs:
+ print("Skipping", testdir)
+ continue
+
+ os.chdir(testdir)
+
+ print ("\n\n", flush=True)
+ print ("############################################################", flush=True)
+ print ("############################################################", flush=True)
+ print ("#### Running tests in", testdir, flush=True)
+ print ("############################################################", flush=True)
+ print ("############################################################", flush=True)
+
+ rc = subprocess.run([
+ '/usr/bin/ansible-test',
+ 'units',
+ '--python-interpreter',
+ '/usr/bin/python3',
+ '--local'
+ ])
+
+
+ if rc.returncode != 0:
+ failed_tests.append(i)
+ overall_test_rc = rc.returncode
+
+ os.chdir(cwd)
+
+
+if overall_test_rc != 0:
+ print ("############################################################", flush=True)
+ print ("############################################################", flush=True)
+ print ("#### failed tests are:", flush=True)
+ for i in failed_tests:
+ print ("####", i, flush=True)
+ print ("############################################################", flush=True)
+ print ("############################################################", flush=True)
+
+exit(overall_test_rc)