1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix AZP CI (#1508)

* Fix 2.9/2.10 cloud

* Fix splunk callback tests.

* ansible_virtualization_type on AZP can be one of container/containerd instead of docker for dockerized tests.

* Disable nomad tests.

* Work around AZP bugs.
This commit is contained in:
Felix Fontein 2020-12-18 11:48:28 +01:00 committed by GitHub
parent 33126b7267
commit dd55c3c3bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 8 deletions

View file

@ -273,20 +273,20 @@ stages:
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python 3.6 {0}
testFormat: 2.10/cloud/3.6/{0}/1
nameFormat: Python {0}
testFormat: 2.10/cloud/{0}/1
targets:
- test: ''
- test: 3.6
- stage: Cloud_2_9
displayName: Cloud 2.9
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python 3.6 {0}
testFormat: 2.9/cloud/3.6/{0}/1
nameFormat: Python {0}
testFormat: 2.9/cloud/{0}/1
targets:
- test: ''
- test: 3.6
- stage: Summary
condition: succeededOrFailed()
dependsOn:

View file

@ -33,7 +33,7 @@
- 'not (item.0.key == "btrfs" and (ansible_distribution == "Ubuntu" and ansible_distribution_release == "trusty"))'
- 'not (item.0.key == "btrfs" and (ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version is version("8", ">=")))'
- 'not (item.0.key == "lvm" and ansible_system == "FreeBSD")' # LVM not available on FreeBSD
- 'not (item.0.key == "lvm" and ansible_virtualization_type == "docker")' # Tests use losetup which can not be used inside unprivileged container
- 'not (item.0.key == "lvm" and ansible_virtualization_type in ["docker", "container", "containerd"])' # Tests use losetup which can not be used inside unprivileged container
- 'not (item.0.key == "ocfs2" and ansible_os_family != "Debian")' # ocfs2 only available on Debian based distributions
- 'not (item.0.key == "f2fs" and ansible_system == "FreeBSD")'
# f2fs-tools package not available with RHEL/CentOS

View file

@ -4,3 +4,4 @@ destructive
skip/aix
skip/centos6
skip/freebsd
disabled # FIXME

View file

@ -25,7 +25,10 @@ import json
class TestSplunkClient(unittest.TestCase):
def setUp(self):
@patch('ansible_collections.community.general.plugins.callback.splunk.socket')
def setUp(self, mock_socket):
mock_socket.gethostname.return_value = 'my-host'
mock_socket.gethostbyname.return_value = '1.2.3.4'
self.splunk = SplunkHTTPCollectorSource()
self.mock_task = Mock('MockTask')
self.mock_task._role = 'myrole'
@ -46,6 +49,8 @@ class TestSplunkClient(unittest.TestCase):
sent_data = json.loads(args[1])
self.assertEqual(sent_data['event']['timestamp'], '2020-12-01 00:00:00.000000 +0000')
self.assertEqual(sent_data['event']['host'], 'my-host')
self.assertEqual(sent_data['event']['ip_address'], '1.2.3.4')
@patch('ansible_collections.community.general.plugins.callback.splunk.datetime')
@patch('ansible_collections.community.general.plugins.callback.splunk.open_url')
@ -59,3 +64,5 @@ class TestSplunkClient(unittest.TestCase):
sent_data = json.loads(args[1])
self.assertEqual(sent_data['event']['timestamp'], '2020-12-01 00:00:00 +0000')
self.assertEqual(sent_data['event']['host'], 'my-host')
self.assertEqual(sent_data['event']['ip_address'], '1.2.3.4')

View file

@ -14,6 +14,9 @@ function join {
echo "$*";
}
# Ensure we can write other collections to this dir
sudo chown "$(whoami)" "${PWD}/../../"
test="$(join / "${args[@]:1}")"
docker images ansible/ansible