Closed ikappaki closed 8 months ago
I'm not sure, this looks like a bug in Buttercup to me. If I completely exclude Eldev out of the equation, it still fails with the same errors:
~/eldev/test/project-e$ emacs --batch -L ~/git/buttercup -L . -L ../dependency-a --eval "(progn (require 'buttercup) (load \"test/project-e.el\") (buttercup-run t))"
Loading /home/paul/eldev/test/project-e/test/project-e.el (source)...
Running 2 specs.
Project E tests
has a dummy passing test FAILED (5.30ms)
`eldev--buttercup-do-fail' to be nil FAILED (0.59ms)
========================================
Project E tests has a dummy passing test
Traceback (most recent call last):
cl--assertion-failed((eq 'closure (car-safe oclosure)))
error: (cl-assertion-failed ((eq 'closure (car-safe oclosure)) nil))
========================================
Project E tests `eldev--buttercup-do-fail' to be nil
Traceback (most recent call last):
cl--assertion-failed((eq 'closure (car-safe oclosure)))
error: (cl-assertion-failed ((eq 'closure (car-safe oclosure)) nil))
If I check out revision 3c6c888 in ~/git/buttercup
, i.e. before all the OClosure stuff, then the tests pass as expected.
@snogge: Do you have an idea of what's going on?
Right, thanks for looking into this @doublep
It turns out the buttercup test files need to be set to lexical binding to make this work with the open closures
;;; -*-lexical-binding:t-*-
(require 'project-e)
(require 'buttercup)
;; All tests pass.
(defvar eldev--buttercup-do-fail nil)
(describe "Project E tests"
(it "has a dummy passing test"
(expect t :to-be t))
(it "`eldev--buttercup-do-fail' to be nil"
;; Result of this test can be altered from command line.
(expect eldev--buttercup-do-fail :to-be nil)))
c:/src/eldev/test/project-e $ emacs --batch -L c:/src/emacs-buttercup -L . -L ../dependency-a --eval "(progn (require 'buttercup) (load \"test/project-e.el\") (buttercup-run t))"
Loading c:/src/eldev/test/project-e/test/project-e.el (source)...
Running 2 specs.
Project E tests
has a dummy passing test (8.13ms)
`eldev--buttercup-do-fail' to be nil (0.10ms)
Ran 2 specs, 0 failed, in 8.35ms.
I'll open an issue at buttercup ... https://github.com/jorgenschaefer/emacs-buttercup/issues/244
As stated in the docs https://github.com/jorgenschaefer/emacs-buttercup/blob/master/docs/writing-tests.md#its-just-functions lexical-binding is a requirement for buttercup, at least for the tests themselves. But it obviously needs to be made more apparent. I'll follow up in https://github.com/jorgenschaefer/emacs-buttercup/issues/244
Describe the bug
The Eldev buttercup invocation framework appears to be broken with the latest buttercup release on melpa (1.34 at the time of this writing)
Steps to reproduce
project-e
integration tests which are about testing buttercup integrationProject E tests has a dummy passing test FAILED (0.06ms) `eldev--buttercup-do-fail' to be nil FAILED (0.05ms)
======================================== Project E tests has a dummy passing test
Traceback (most recent call last): cl--assertion-failed((eq 'closure (car-safe oclosure))) error: (cl-assertion-failed ((eq 'closure (car-safe oclosure)) nil))
======================================== Project E tests `eldev--buttercup-do-fail' to be nil
Traceback (most recent call last): cl--assertion-failed((eq 'closure (car-safe oclosure))) error: (cl-assertion-failed ((eq 'closure (car-safe oclosure)) nil))
Ran 2 specs, 2 failed, in 3.30ms.
Environment
Additional context
The issue seems to be related to a recent buttercup change to support open closures in Emacs 29, that breaks Eldev support for buttercup.
The same works fine on Emacs 28
Do you think you could confirm the issue and have a look if so please?
Thanks