Skip to content

Commit 02e1554

Browse files
tests: pin cloud-init's pytest to <8.0.0 (#7800)
Latest pytest 8.0.0 release had breaking changes which broke the cloud-init tests. Pin to previous versions of pytest. See canonical/cloud-init@7c96c9c Signed-off-by: Chris Co chrco@microsoft.com
1 parent 25bb8ef commit 02e1554

2 files changed

Lines changed: 46 additions & 1 deletion

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 7c96c9cd9318e816ce4564b58a2c98271363c447 Mon Sep 17 00:00:00 2001
2+
From: Brett Holman <brett.holman@canonical.com>
3+
Date: Mon, 29 Jan 2024 12:03:36 -0700
4+
Subject: [PATCH] ci: Pin pytest<8.0.0. (#4816)
5+
6+
The latest pytest release broke some tests in non-obvious ways. Pin
7+
the version for now so that CI passes.
8+
---
9+
integration-requirements.txt | 2 +-
10+
test-requirements.txt | 2 +-
11+
2 files changed, 2 insertions(+), 2 deletions(-)
12+
13+
diff --git a/integration-requirements.txt b/integration-requirements.txt
14+
index dc17759a..208a0c6a 100644
15+
--- a/integration-requirements.txt
16+
+++ b/integration-requirements.txt
17+
@@ -7,7 +7,7 @@ pycloudlib>=5.10.0,<1!6
18+
# test/unittests/conftest.py to be loaded by our integration-tests tox env
19+
# resulting in an unmet dependency issue:
20+
# https://github.com/pytest-dev/pytest/issues/11104
21+
-pytest!=7.3.2
22+
+pytest!=7.3.2,<8.0.0
23+
24+
packaging
25+
passlib
26+
diff --git a/test-requirements.txt b/test-requirements.txt
27+
index 46a98b4c..3d2480fd 100644
28+
--- a/test-requirements.txt
29+
+++ b/test-requirements.txt
30+
@@ -4,7 +4,7 @@
31+
# test/unittests/conftest.py to be loaded by our integration-tests tox env
32+
# resulting in an unmet dependency issue:
33+
# https://github.com/pytest-dev/pytest/issues/11104
34+
-pytest!=7.3.2
35+
+pytest!=7.3.2,<8.0.0
36+
37+
pytest-cov
38+
pytest-mock
39+
--
40+
2.33.8
41+

SPECS/cloud-init/cloud-init.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Cloud instance init scripts
22
Name: cloud-init
33
Version: 23.4.1
4-
Release: 2%{?dist}
4+
Release: 3%{?dist}
55
License: GPLv3
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -10,6 +10,7 @@ URL: https://launchpad.net/cloud-init
1010
Source0: https://launchpad.net/cloud-init/trunk/%{version}/+download/%{name}-%{version}.tar.gz
1111
Source1: 10-azure-kvp.cfg
1212
Patch0: Retain-exit-code-in-cloud-init-status-for-recoverabl.patch
13+
Patch1: ci-Pin-pytest-8.0.0.patch
1314
%define cl_services cloud-config.service cloud-config.target cloud-final.service cloud-init.service cloud-init.target cloud-init-local.service
1415
BuildRequires: automake
1516
BuildRequires: dbus
@@ -145,6 +146,9 @@ make check %{?_smp_mflags}
145146
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/10-azure-kvp.cfg
146147

147148
%changelog
149+
* Fri Feb 09 2024 Chris Co <chrco@microsoft.com> - 23.4.1-3
150+
- Add patch to pin pytest to <8.0.0 so cloud-init tests run correctly
151+
148152
* Fri Jan 19 2024 Chris Co <chrco@microsoft.com> - 23.4.1-2
149153
- Add patch to retain exit code for recoverable errors
150154

0 commit comments

Comments
 (0)