[bug#77391,v4,4/4] gnu: emacs-ellama: Enable tests.

Message ID bbd5a575d0a3cc358a6e7a4202a7036fc243455c.1743632075.git.suhail@bayesians.ca
State New
Headers
Series gnu: emacs-ellama: Update to 1.8.0. |

Commit Message

Suhail Singh April 2, 2025, 2:42 p.m. UTC
  * gnu/packages/emacs-xyz.scm (emacs-ellama)[arguments]: Enable tests; skip
failing.

Change-Id: I1b468c7b30ad35ae553d354ef63da2d4d1c056a7
---
 gnu/packages/emacs-xyz.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)
  

Comments

Cayetano Santos April 3, 2025, 6:58 a.m. UTC | #1
>Wed 02 Apr 2025 at 10:42, "Suhail Singh" <suhailsingh247@gmail.com> wrote:

> * gnu/packages/emacs-xyz.scm (emacs-ellama)[arguments]: Enable tests; skip
> failing.

> +    (arguments
> +     (list #:phases
> +           #~(modify-phases %standard-phases
> +               (add-after 'unpack 'disable-failing-tests
> +                 (lambda _
> +                   (substitute* (find-files "tests/" "\\.el$")
> +                     (("\\(ert-deftest test-ellama-context-element-extract-info-node .*" all)

This line 5798 is way too long (93 characters), as for the linter.

Other than this, looks good to me.
  
Suhail Singh April 3, 2025, 1:07 p.m. UTC | #2
Cayetano Santos <cayetano.santos@inventati.org> writes:

>> +                     (("\\(ert-deftest test-ellama-context-element-extract-info-node .*" all)
>
> This line 5798 is way too long (93 characters), as for the linter.

Indeed.  Even with the "all)" on the subsequent line it'd be too long.
An option may be to split the string into multiple and concatenate it,
but I believe it would hurt readability for little gain.

I'll be happy with whatever decision someone with commit rights makes in
this regard.  In the meanwhile, it seems 1.8.1 is out so I'll send v5.
  

Patch

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 5189ddd5d1..f8324bf00d 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -5789,6 +5789,19 @@  (define-public emacs-ellama
               (sha256 (base32
                        "075bxdy2jzaq4nw2vpzlmxlq3mlvr0dklva5hbpzqm6pvwa2xz1k"))))
     (build-system emacs-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'disable-failing-tests
+                 (lambda _
+                   (substitute* (find-files "tests/" "\\.el$")
+                     (("\\(ert-deftest test-ellama-context-element-extract-info-node .*" all)
+                      (string-append all "(skip-unless nil)\n"))))))
+           #:tests? #t
+           #:test-command #~(list "emacs" "-Q" "--batch"
+                                  "-l" "ellama.el"
+                                  "-l" "tests/test-ellama.el"
+                                  "-f" "ert-run-tests-batch-and-exit")))
     (propagated-inputs (list emacs-compat emacs-llm emacs-plz emacs-transient))
     (home-page "https://github.com/s-kostyaev/ellama")
     (synopsis "Tool for interacting with LLMs")