From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: ``make test'' failure Date: Wed, 01 Nov 2017 21:57:55 +0100 Message-ID: <877ev91zu4.fsf@nicolasgoaziou.fr> References: <87h8ufyrdt.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eA05K-0001Hs-VW for emacs-orgmode@gnu.org; Wed, 01 Nov 2017 16:58:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eA05H-0001H9-SR for emacs-orgmode@gnu.org; Wed, 01 Nov 2017 16:58:03 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:36085) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eA05H-0001F9-LY for emacs-orgmode@gnu.org; Wed, 01 Nov 2017 16:57:59 -0400 In-Reply-To: <87h8ufyrdt.fsf@alphaville.usersys.redhat.com> (Nick Dokos's message of "Tue, 31 Oct 2017 16:49:34 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nick Dokos Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello, Nick Dokos writes: > I get one failure in test-org-publish/resolve-external-link. > Bisecting fingers this commit: > > ,---- > | $ git bisect good > | 007bbddbccfd06ab9c97d51bf833a068cb1b07a2 is the first bad commit > | commit 007bbddbccfd06ab9c97d51bf833a068cb1b07a2 > | Author: Nicolas Goaziou > | Date: Sun Sep 10 00:16:12 2017 +0200 > | > | ox-html: Prevent spurious target below headlines > | > | * lisp/ox-html.el (org-html-headline): > | (org-html-link): Do not insert an additional target. > | > | * lisp/ox-publish.el (org-publish-resolve-external-link): Add an > | optional argument. > | > | * lisp/ox.el (org-export-get-reference): Improve docstring. > | > | * testing/examples/pub/a.org: > | * testing/examples/pub/b.org: New files. > | * testing/lisp/test-ox-publish.el (test-org-publish/resolve-external-link): > | New test. > | > | :040000 040000 fda080e0db653c9049448200be5ad03369379cc3 ec0eb8a5cd9b3c3b204fd7134e515fb360b85c79 M etc > | :040000 040000 39afe6514335e2ccd549fc5b7fafcac344cbb471 a0fdf6967cc3ab95b046f81dab08095fe0d302de M lisp > | :040000 040000 120e098640643a963336d77d65929ef5863eeba5 679329e78a4bbc04f6f84bb176821a3084732ab3 M testing > `---- > > which *introduced* this test, but of course the test may be at fault, > rather than the code. There is a non-deterministic part in that failure since neither our Build nor my machine can reproduce it. Could you try the following patch and tell me if the test succeed? Thank you. Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-failing-test.patch >From dc8d8d1b9bf92d9fe826cfe8a13c6ad89c1f9c8e Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 1 Nov 2017 17:54:12 +0100 Subject: [PATCH] Fix failing test * testing/lisp/test-ox-publish.el (test-org-publish/resolve-external-link): Rewrite test to prevent race condition which could affect results. * testing/examples/pub/b.org: Add missing keyword. --- testing/examples/pub/b.org | 3 +++ testing/lisp/test-ox-publish.el | 34 ++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/testing/examples/pub/b.org b/testing/examples/pub/b.org index 60387460e..261152e99 100644 --- a/testing/examples/pub/b.org +++ b/testing/examples/pub/b.org @@ -2,5 +2,8 @@ #+date: <2012-03-29 Thu> * Headline1 +:PROPERTIES: +:CUSTOM_ID: b1 +:END: [[file:a.org::#a1]] diff --git a/testing/lisp/test-ox-publish.el b/testing/lisp/test-ox-publish.el index a51190578..0c3aaedca 100644 --- a/testing/lisp/test-ox-publish.el +++ b/testing/lisp/test-ox-publish.el @@ -366,27 +366,29 @@ Unless set otherwise in PROPERTIES, `:base-directory' is set to ;; instead of internal reference, whenever possible. (should (equal - "a1" + '("a1" "b1") (let* ((ids nil) + (link-transcoder + (lambda (l c i) + (let ((option (org-element-property :search-option l)) + (path (org-element-property :path l))) + (push (org-publish-resolve-external-link option path t) + ids) + ""))) (backend (org-export-create-backend - :transcoders - '((headline . (lambda (h c i) c)) - (paragraph . (lambda (p c i) c)) - (section . (lambda (s c i) c)) - (link . (lambda (l c i) - (let ((option (org-element-property :search-option l)) - (path (org-element-property :path l))) - (when option - (throw :exit (org-publish-resolve-external-link - option path t))))))))) + :transcoders `((headline . (lambda (h c i) c)) + (paragraph . (lambda (p c i) c)) + (section . (lambda (s c i) c)) + (link . ,link-transcoder)))) (publish (lambda (plist filename pub-dir) - (push (catch :exit - (org-publish-org-to backend filename ".test" plist pub-dir)) - ids)))) - (org-test-publish (list :publishing-function (list publish)) #'ignore) - (car ids))))) + (org-publish-org-to backend filename ".test" plist pub-dir)))) + (org-test-publish (list :publishing-function (list publish) + :exclude "." + :include '("a.org" "b.org")) + #'ignore) + (sort ids #'string<))))) ;;; Tools -- 2.14.3 --=-=-=--