Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ert tests fail if racket-mode is installed #246

Open
bremner opened this issue Jan 3, 2017 · 10 comments
Open

ert tests fail if racket-mode is installed #246

bremner opened this issue Jan 3, 2017 · 10 comments

Comments

@bremner
Copy link
Contributor

bremner commented Jan 3, 2017

If the package is not installed, the tests pass. However, if the package is already installed,
two tests fail.

2 unexpected results:
   FAILED  racket-tests/indent-rkt
   FAILED  racket-tests/run

Here are the relevant backtraces

Test racket-tests/indent-rkt backtrace:
  (if (unwind-protect (setq value-52 (apply fn-50 args-51)) (setq form
  (let (form-description-54) (if (unwind-protect (setq value-52 (apply
  (let ((value-52 (quote ert-form-evaluation-aborted-53))) (let (form-
  (let ((fn-50 (function racket-tests/same-indent)) (args-51 (list "ex
  (lambda nil (let ((fn-50 (function racket-tests/same-indent)) (args-
  ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
  ert-run-test([cl-struct-ert-test racket-tests/indent-rkt "Indentatio
  ert-run-or-rerun-test([cl-struct-ert--stats t [[cl-struct-ert-test r
  ert-run-tests(t #[385 "\306\307\"\203G\211\211G\310U\203\211@\20
  ert-run-tests-batch(nil)
  ert-run-tests-batch-and-exit()
  command-line-1(("-eval" "(progn (add-to-list (quote load-path) \"/ho
  command-line()
  normal-top-level()

Test racket-tests/run backtrace:
  (if (eq major-mode (quote racket-mode)) nil (error "Current buffer i
  racket--do-run(medium)
  racket-run()
  (let* ((racket--repl-command-connect-timeout (* 15 60)) (racket-comm
  (lambda nil (let* ((racket--repl-command-connect-timeout (* 15 60)) 
  ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
  ert-run-test([cl-struct-ert-test racket-tests/run nil (lambda nil (l
  ert-run-or-rerun-test([cl-struct-ert--stats t [[cl-struct-ert-test r
  ert-run-tests(t #[385 "\306\307\"\203G\211\211G\310U\203\211@\20
  ert-run-tests-batch(nil)
  ert-run-tests-batch-and-exit()
  command-line-1(("-eval" "(progn (add-to-list (quote load-path) \"/ho
  command-line()
  normal-top-level()
@greghendershott
Copy link
Owner

  1. How are you running the tests -- via make test?
  2. What is the Emacs version?

@bremner
Copy link
Contributor Author

bremner commented Jan 3, 2017 via email

@greghendershott
Copy link
Owner

Hmm. When you say "the package is already installed", do you mean using Emacs' package-install or something else?

@bremner
Copy link
Contributor Author

bremner commented Jan 3, 2017 via email

@bremner
Copy link
Contributor Author

bremner commented Jan 5, 2017 via email

@greghendershott
Copy link
Owner

Ah, interesting. I wonder what's a realistic scenario to test. I think most human users would install only one of these two packages -- or maybe, install both, but in their Emacs init file disambiguate mode they want as the default mode for .rkt files?

But to back up a step. It occurs to me now, need/ought you run packages' tests, at all?

I don't think that happens when people do the "normal" thing of using package-install?

(For example. I think some packages exclude test-related .el files from what MELPA distributes. Arguably it's wrong that the MELPA recipe for racket-mode is including them.)

@bremner
Copy link
Contributor Author

bremner commented Jan 6, 2017 via email

@greghendershott
Copy link
Owner

Thanks for explaining.

  1. I'll think about this more.

  2. In the meantime, my least-worst idea answer is that racket-mode expects that, if it is running, it's because the user wants to use it to handle .rkt files; otherwise it's not much use. :) The tests assume that. If the user's init file disambiguates which major mode is supposed to be set for .rkt files, and the answer is not racket-mode, then probably the correct thing to do is... not run the tests for the package that will not be used. Maybe the tests should check the .rkt mode and simply not run at all. idk

@greghendershott
Copy link
Owner

Or, maybe the tests that visit a .rkt file should explicitly call (racket-mode 1) -- similar to a user visiting the file, then manually doing a M-x racket-mode to set the mode.

The tests intentionally don't do that as an indirect way of making sure I set the auto-mode-alist and that it was effective. But, maybe that's "too strong" a test.

@bremner
Copy link
Contributor Author

bremner commented Jan 6, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants