diff --git a/.zuul.yaml b/.zuul.yaml index e834dd6a0..09ebe30ba 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -4,6 +4,7 @@ name: nodepool-functional-k8s pre-run: playbooks/nodepool-functional-k8s/pre.yaml run: playbooks/nodepool-functional-k8s/run.yaml + post-run: playbooks/nodepool-functional-k8s/post.yaml required-projects: - zuul/nodepool nodeset: debian-bookworm diff --git a/nodepool/tests/unit/test_driver_aws.py b/nodepool/tests/unit/test_driver_aws.py index 2937befdc..cc94f99c6 100644 --- a/nodepool/tests/unit/test_driver_aws.py +++ b/nodepool/tests/unit/test_driver_aws.py @@ -21,7 +21,7 @@ import urllib.parse import boto3 import botocore.exceptions -from moto import mock_ec2, mock_s3, mock_iam +from moto import mock_aws import testtools from nodepool import config as nodepool_config @@ -122,9 +122,7 @@ def ebs_quotas(quotas): class TestDriverAws(tests.DBTestCase): log = logging.getLogger("nodepool.TestDriverAws") - mock_ec2 = mock_ec2() - mock_s3 = mock_s3() - mock_iam = mock_iam() + mock_aws = mock_aws() def setUp(self): super().setUp() @@ -144,9 +142,7 @@ class TestDriverAws(tests.DBTestCase): fixtures.EnvironmentVariable('AWS_SECRET_ACCESS_KEY', aws_key)) self.fake_aws = FakeAws() - self.mock_ec2.start() - self.mock_s3.start() - self.mock_iam.start() + self.mock_aws.start() self.ec2 = boto3.resource('ec2', region_name='us-west-2') self.ec2_client = boto3.client('ec2', region_name='us-west-2') @@ -197,8 +193,7 @@ class TestDriverAws(tests.DBTestCase): ebs_quotas=getattr(test, '__aws_ebs_quotas__', None)) def tearDown(self): - self.mock_ec2.stop() - self.mock_s3.stop() + self.mock_aws.stop() super().tearDown() def setup_config(self, *args, **kw): diff --git a/playbooks/nodepool-functional-k8s/post.yaml b/playbooks/nodepool-functional-k8s/post.yaml new file mode 100644 index 000000000..829ec8e66 --- /dev/null +++ b/playbooks/nodepool-functional-k8s/post.yaml @@ -0,0 +1,4 @@ +- hosts: all + roles: + - name: Collect k8s logs for debugging purposes + role: collect-kubernetes-logs diff --git a/playbooks/nodepool-functional-k8s/pre.yaml b/playbooks/nodepool-functional-k8s/pre.yaml index 54097f58b..f2d01e513 100644 --- a/playbooks/nodepool-functional-k8s/pre.yaml +++ b/playbooks/nodepool-functional-k8s/pre.yaml @@ -6,3 +6,4 @@ - role: ensure-nox - role: ensure-kubernetes ensure_kubernetes_type: microk8s + ensure_kubernetes_microk8s_channel: '1.28/stable'