snapcraft: fix broken test from mismatched dep

We're using a later version of `craft-cli` than
snapcraft is expecting, and thus one of the
error message strings that is tested for has
changed slightly - this patch corrects that
and can be dropped when snapcraft adopts a later
version of `craft-cli`.
This commit is contained in:
Jon Seager
2025-07-22 16:47:32 +02:00
parent 5e01dd8a97
commit 8efcdcd25d
2 changed files with 20 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
diff --git i/tests/unit/test_application.py w/tests/unit/test_application.py
index d5da2454c..2a9bcd6f9 100644
--- i/tests/unit/test_application.py
+++ w/tests/unit/test_application.py
@@ -391,7 +391,8 @@ def test_esm_error(snapcraft_yaml, base, monkeypatch, capsys):
_, err = capsys.readouterr()
assert re.match(
- rf"^Base {base!r} is not supported by this version of Snapcraft.\n"
+ rf"^Running snapcraft without a command will not be possible in future releases. Use 'snapcraft pack' instead.\n"
+ rf"Base {base!r} is not supported by this version of Snapcraft.\n"
rf"Recommended resolution: Use Snapcraft .* from the '.*' channel of snapcraft where {base!r} was last supported.\n"
r"For more information, check out: .*/reference/bases\n",
err,
+6
View File
@@ -26,6 +26,12 @@ python312Packages.buildPythonApplication rec {
};
patches = [
# We're using a later version of `craft-cli` than expected, which
# adds an extra deprecation warning to the CLI output, meaning that
# an expected error message looks slightly different. This patch corrects
# that by checking for the updated error message and can be dropped in a
# later release of snapcraft.
./esm-test.patch
# Snapcraft is only officially distributed as a snap, as is LXD. The socket
# path for LXD must be adjusted so that it's at the correct location for LXD
# on NixOS. This patch will likely never be accepted upstream.