[PATCH 02/13] test: unset NAME environment variable

2021-05-01 Thread Felipe Contreras
Otherwise the output from the tests would be different. Signed-off-by: Felipe Contreras --- test/test-lib.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test-lib.sh b/test/test-lib.sh index e13797a7..ae653363 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -112,6 +112,7 @@ u

[PATCH 01/13] test: fix passwd_sanitize()

2021-05-01 Thread Felipe Contreras
If any of the variables is empty the output is completely messed up, because replace("", "FOO") puts "FOO" before every single character. I don't have my full name configured, and this is what I get: USER_FULL_NAME=USER_FULL_NAME=USER_FULL_NAME USER_FULL_NAMEsUSER_FULL_NAMEtUSER_FULL_NAMEdUSER

[PATCH 03/13] test: remove USER_FULL_NAME when not present

2021-05-01 Thread Felipe Contreras
If a full name is not configured, the output is empty. This is possibly not portable, but it's a start. Signed-off-by: Felipe Contreras --- test/T590-libconfig.sh | 10 ++ 1 file changed, 10 insertions(+) diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh index 51dd29c8..36d9

[PATCH 00/13] test: several fixes and improvements

2021-05-01 Thread Felipe Contreras
The current tests fail on my machine due to my configuration, mainly because I didn't have dtach installed, but also other stuff. The following patches fix all the issues I found, and also do plenty of cleanups. Felipe Contreras (13): test: fix passwd_sanitize() test: unset NAME environment

[PATCH 04/13] test: use correct fqdn in passwd_sanitize()

2021-05-01 Thread Felipe Contreras
My fqdn is 'natae.localdomain', however, socket.getfqdn() returns 'localhost'. To fetch the true fqdn we need socket.getaddrinfo(). For more information see: https://stackoverflow.com/a/11580042/10474 Signed-off-by: Felipe Contreras --- test/test-lib.sh | 2 +- 1 file changed, 1 insertion(+),

[PATCH 05/13] test: fix wrong SKIP messages

2021-05-01 Thread Felipe Contreras
When the external prereqs are updated inside the body of the command (e.g. test_emacs) the message in test_report_skip_ is wrong: it outputs the body of the command instead of the subtest name. We need to pass the same argument we pass to test_skip. Signed-off-by: Felipe Contreras --- test/test

[PATCH 06/13] test: add prereqs check in test_emacs_expect_t

2021-05-01 Thread Felipe Contreras
test_emacs may update the external prereqs, in which case we want to skip the test rather than fail. Signed-off-by: Felipe Contreras --- test/test-lib.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/test-lib.sh b/test/test-lib.sh index 1067316d..72ac2e89 100644 --- a/test/test-lib

[PATCH 07/13] test: add external prereqs to many emacs tests

2021-05-01 Thread Felipe Contreras
The tests fail otherwise. Signed-off-by: Felipe Contreras --- test/T310-emacs.sh| 1 + test/T350-crypto.sh | 1 + test/T355-smime.sh| 1 + test/T357-index-decryption.sh | 1 + test/T450-emacs-show.sh | 1 + test/T460-emacs-tree.sh | 1 + test/T730-em

[PATCH 08/13] test: split emacs functionality to its own file

2021-05-01 Thread Felipe Contreras
This way it's easier to identify the tests that do require emacs stuff. Signed-off-by: Felipe Contreras --- test/T160-json.sh | 1 + test/T170-sexp.sh | 1 + test/T310-emacs.sh | 1 + test/T320-emacs-large-search-buffer.sh | 3

[PATCH 09/13] test: emacs: simplify missing dependencies check

2021-05-01 Thread Felipe Contreras
No functional changes. Signed-off-by: Felipe Contreras --- test/test-lib-emacs.sh | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/test-lib-emacs.sh b/test/test-lib-emacs.sh index ecad501a..83f5b10b 100644 --- a/test/test-lib-emacs.sh +++ b/test/test-lib-em

[PATCH 10/13] test: emacs: check for configured emacs

2021-05-01 Thread Felipe Contreras
Commit d59d9c81 (test: Make the emacsclient binary user-configurable, 2012-11-27) modified the prereq check for the configured emacsclient, but we probably want to do the same for emacs itself. Signed-off-by: Felipe Contreras --- test/test-lib-emacs.sh | 2 +- 1 file changed, 1 insertion(+), 1 d

[PATCH 11/13] test: emacs: fix a couple of shellcheck complaints

2021-05-01 Thread Felipe Contreras
In test-lib-emacs.sh line 20: test_require_external_prereq ${TEST_EMACS} || ret=1 ^---^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: test_require_external_prereq "${TEST_EMACS}" || ret=1 In test-lib-emacs.sh line 21:

[PATCH 12/13] test: trivial style cleanups

2021-05-01 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- test/T000-basic.sh | 2 +- test/T070-insert.sh | 2 +- test/T590-thread-breakage.sh | 10 +- test/export-dirs.sh | 2 +- test/test-lib.sh | 8 5 files changed, 12 insertions(+), 12 deletions(-) diff

[PATCH 13/13] test: more style fixes

2021-05-01 Thread Felipe Contreras
In order to fit the git coding style. Signed-off-by: Felipe Contreras --- test/T140-excludes.sh | 3 +- test/T190-multipart.sh | 3 +- test/T490-parse-time-string.sh | 6 +-- test/export-dirs.sh| 3 +- test/test-lib-common.sh| 6 +-- test/test-lib-emacs.

[PATCH 1/9] test: move test_ruby() inside the only client

2021-05-01 Thread Felipe Contreras
Not much point in polluting the main library, and also will be useful to modify it in tandem with the tests. Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 4 test/test-lib.sh | 4 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ru

[PATCH 4/9] test: ruby: simplify MAIL_DIR initialization

2021-05-01 Thread Felipe Contreras
There's no need to complicate the script passing the MAIL_DIR environment variable. Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index 94fab106..67d6e205 100755 --- a/test/T3

[PATCH 2/9] test: ruby: refactor test_ruby()

2021-05-01 Thread Felipe Contreras
There's no point in repeating the same initialization in all the tests. Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 48 +++ 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index fec1f5ef

[PATCH 3/9] test: ruby: simplify MAIL_DIR check

2021-05-01 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index 1d27e191..94fab106 100755 --- a/test/T395-ruby.sh +++ b/test/T395-ruby.sh @@ -12,10 +12,7 @@ test_ruby() { ( cat <

[PATCH 0/9] test: ruby: several cleanups and simplifications

2021-05-01 Thread Felipe Contreras
I found a lot of areas of improvement in the Ruby tests, so I decided to clean them up. With these changes the tests are now much simpler and follow more closely the typical Ruby idioms. Felipe Contreras (9): test: move test_ruby() inside the only client test: ruby: refactor test_ruby() t

[PATCH 5/9] test: ruby: simplify test_ruby()

2021-05-01 Thread Felipe Contreras
We always do test_expect_equal_file, so do it in test_ruby() directly. The only subtest where we don't (get non-existent file) can be easily modified. Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/te

[PATCH 6/9] test: ruby: use much more standard puts

2021-05-01 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index 55bf4c2b..f871ddd9 100755 --- a/test/T395-ruby.sh +++ b/test/T395-ruby.sh @@ -25,7 +25,7 @@ test_ruby <<"EOF" @q =

[PATCH 7/9] test: ruby: use much more standard Ruby idioms

2021-05-01 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index f871ddd9..f5a8d245 100755 --- a/test/T395-ruby.sh +++ b/test/T395-ruby.sh @@ -24,7 +24,7 @@ notmuch search --

[PATCH 8/9] test: ruby: don't use instance variables

2021-05-01 Thread Felipe Contreras
Local variables are perfectly fine. Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index f5a8d245..30168109 100755 --- a/test/T395-ruby.sh +++ b/test/T395-rub

[PATCH 9/9] test: ruby: simplify output comparison

2021-05-01 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index 30168109..597330d3 100755 --- a/test/T395-ruby.sh +++ b/test/T395-ruby.sh @@ -20,22 +20,22 @@ test_ruby() { } test_begi

[PATCH 0/3] ruby: improve db.query

2021-05-01 Thread Felipe Contreras
I find it a bit annoying to have to modify the query object to add options when Notmuch::Database.query() can do that just fine. This series also adds a mapping to the notmuch_exclude_t enum in order to be able to specify NOTMUCH_EXCLUDE_ALL and others. This patch series goes on top of my ruby t

[PATCH 1/3] ruby: use notmuch_exclude_t enum

2021-05-01 Thread Felipe Contreras
It exists since 2013, let's allow it to be used in Ruby. Signed-off-by: Felipe Contreras --- bindings/ruby/init.c | 24 bindings/ruby/query.c | 8 +--- test/T395-ruby.sh | 17 + 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/bin

[PATCH 3/3] test: ruby: simplify basic tests

2021-05-01 Thread Felipe Contreras
We don't need to check for the order here, that is done in another test. Signed-off-by: Felipe Contreras --- test/T395-ruby.sh | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/T395-ruby.sh b/test/T395-ruby.sh index e828efed..9298bc9e 100755 --- a/test/T395-ru

[PATCH 2/3] ruby: add keyword arguments to db.query

2021-05-01 Thread Felipe Contreras
That way we don't need pass them to the query object ourselves. Signed-off-by: Felipe Contreras --- bindings/ruby/database.c | 47 +--- bindings/ruby/defs.h | 2 +- bindings/ruby/init.c | 2 +- test/T395-ruby.sh| 18 +++ 4 files c

Re: [PATCH 01/13] test: fix passwd_sanitize()

2021-05-01 Thread Tomi Ollila
On Sat, May 01 2021, Felipe Contreras wrote: > If any of the variables is empty the output is completely messed up, > because replace("", "FOO") puts "FOO" before every single character. > > I don't have my full name configured, and this is what I get: > > USER_FULL_NAME=USER_FULL_NAME=USER_FULL

Re: [PATCH 02/13] test: unset NAME environment variable

2021-05-01 Thread Tomi Ollila
On Sat, May 01 2021, Felipe Contreras wrote: > Otherwise the output from the tests would be different. > > Signed-off-by: Felipe Contreras > --- > test/test-lib.sh | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/test/test-lib.sh b/test/test-lib.sh > index e13797a7..ae653363 100644 > ---

Re: [PATCH 03/13] test: remove USER_FULL_NAME when not present

2021-05-01 Thread Tomi Ollila
On Sat, May 01 2021, Felipe Contreras wrote: > If a full name is not configured, the output is empty. > This is possibly not portable, but it's a start. > > Signed-off-by: Felipe Contreras > --- > test/T590-libconfig.sh | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/test/T

Re: [PATCH 04/13] test: use correct fqdn in passwd_sanitize()

2021-05-01 Thread Tomi Ollila
On Sat, May 01 2021, Felipe Contreras wrote: > My fqdn is 'natae.localdomain', however, socket.getfqdn() returns > 'localhost'. > > To fetch the true fqdn we need socket.getaddrinfo(). > > For more information see: https://stackoverflow.com/a/11580042/10474 > > Signed-off-by: Felipe Contreras > -

Re: [PATCH 00/13] test: several fixes and improvements

2021-05-01 Thread David Bremner
Felipe Contreras writes: > The current tests fail on my machine due to my configuration, mainly because > I didn't have dtach > installed, but also other stuff. > > The following patches fix all the issues I found, and also do plenty of > cleanups. I have applied 1,2,4,5,6,7 to master. 10, 11

Re: [PATCH 00/13] test: several fixes and improvements

2021-05-01 Thread Tomi Ollila
On Sat, May 01 2021, David Bremner wrote: > Felipe Contreras writes: > >> The current tests fail on my machine due to my configuration, mainly because >> I didn't have dtach >> installed, but also other stuff. >> >> The following patches fix all the issues I found, and also do plenty of >> clea