deja-dup-team team mailing list archive
-
deja-dup-team team
-
Mailing list archive
-
Message #00734
[Merge] lp:~laney/deja-dup/glib-2.51-fancy-quotes-test into lp:deja-dup
Iain Lane has proposed merging lp:~laney/deja-dup/glib-2.51-fancy-quotes-test into lp:deja-dup.
Requested reviews:
Déjà Dup Developers (deja-dup-hackers)
For more details, see:
https://code.launchpad.net/~laney/deja-dup/glib-2.51-fancy-quotes-test/+merge/311257
libdeja/tests: Allow the expected error to be a regex and adjust a test to match
The "instance-error" test is now failing with the following
** (./test-runner:14654): WARNING **: runner.vala:294: Error string didn't match; expected Failed to execute child process
because glib ≥ 2.51.0 now output some error strings with “fancy quotes”.
Adjust the test runner to accept a regex and then let the failing test in
question accept " or “”.
--
I'm going to upload this to unblock the autopkgetsts - just drop the patch in your next upload with this merge or whatever other solution you like (e.g. just requiring the new glib format).
--
Your team Déjà Dup Developers is requested to review the proposed merge of lp:~laney/deja-dup/glib-2.51-fancy-quotes-test into lp:deja-dup.
=== modified file 'libdeja/tests/runner.vala'
--- libdeja/tests/runner.vala 2015-11-24 18:35:04 +0000
+++ libdeja/tests/runner.vala 2016-11-18 11:05:57 +0000
@@ -251,6 +251,7 @@
public bool cancelled = false;
public string? detail = null;
public string? error_str = null;
+ public string? error_regex = null;
public string? error_detail = null;
public string? restore_date = null;
public List<File> restore_files = null;
@@ -290,11 +291,14 @@
op.raise_error.connect((str, det) => {
Test.message("Error: %s, %s", str, det);
- if (error_str != str)
+ if (error_str != null && error_str != str)
warning("Error string didn't match; expected %s, got %s", error_str, str);
+ if (error_regex != null && !GLib.Regex.match_simple (error_regex, str))
+ warning("Error string didn't match regex; expected %s, got %s", error_regex, str);
if (error_detail != det)
warning("Error detail didn't match; expected %s, got %s", error_detail, det);
error_str = null;
+ error_regex = null;
error_detail = null;
});
@@ -436,6 +440,8 @@
br.init_error = keyfile.get_string(group, "InitError");
if (keyfile.has_key(group, "Error"))
br.error_str = keyfile.get_string(group, "Error");
+ if (keyfile.has_key(group, "ErrorRegex"))
+ br.error_regex = keyfile.get_string(group, "ErrorRegex");
if (keyfile.has_key(group, "ErrorDetail"))
br.error_detail = keyfile.get_string(group, "ErrorDetail");
if (keyfile.has_key(group, "Passphrases"))
=== modified file 'libdeja/tests/scripts/instance-error.test'
--- libdeja/tests/scripts/instance-error.test 2013-01-24 14:31:08 +0000
+++ libdeja/tests/scripts/instance-error.test 2016-11-18 11:05:57 +0000
@@ -9,7 +9,7 @@
Script=mkdir -p @TEST_HOME@/mockcopy && cp -r @MOCK_DIR@/* @TEST_HOME@/mockcopy && ln -s `which python3` @TEST_HOME@/mockcopy/python3
Path=@TEST_HOME@/mockcopy
Success=false
-Error=Failed to execute child process "duplicity" (No such file or directory)
+ErrorRegex=Failed to execute child process [“"]duplicity["”] \\(No such file or directory\\)
[Duplicity]
Runs=status;dry;
Follow ups