Comments (8)
Just discovered that there is a development tool for Elisp packages, and yet it lacks the functionality I need the most...
In case anyone ever starts working on it, some feature requests:
-
Let developer choose which tests to run (of course, all by default). E.g. in ERT this would be selector. (I presume
[args]
is meant for that...) -
Let developer choose which test files to load (again, all by default). So I would be able to narrow down tests to run using either selectors (which operate on all defined testcases), or files (which results in never even defining some testcases), or both.
Usecase: lets say I have a thousand of fairly slow tests and want to quickly run five out of them, as I'm fixing a particular bug.
from cask.
There are tools for that, for example ert-runner which you can then execute with cask as
cask exec ert-runner
or buttercup which by default exports a binary
cask exec buttercup
Both of these accept -p
flag as pattern for test cases to run.
from cask.
I use cask emacs --load "assess-discover" --funcall assess-discover-run-and-exit-batch
.
But the OP is correct. You have to know about these things and they don't appear in cask help
. Adding ert-runner
, buttercup
and assess
as subcommands would probably do 90% of the job, with cask test
making a heuristic guess between the three.
I'd be happy to add, assuming it seems a good addition (and everyone is patient!)
from cask.
@phillord No problem with a pull request, but I wonder if it's really that useful. After 6 years this is the first time someone is asking for the feature/bumping the thread.
Also keep in mind this will add maintenance overhead in case ert-runner, buttercup or assess changes in the future, cask will automatically stop (potentially) working correctly.
from cask.
cask exec ert-runner
OK, after some tries I guessed that it runs files test/*-test.el
, not everything under test
. I couldn't find this in documentation, cask --verbose exec ert-runner
, --debug
or --dev
print nothing at all. I have no idea what those options do, apparently not what one would expect.
You see no intermediate output with it (what if you run 1000 tests, and the third already fails?), and if you abort with C-c
, you see no output at all.
Also, there is that bug about ert--print-backtrace
on Emacs 27 that no-one is fixing.
buttercup
Maybe it's great, but I don't plan to switch from ERT currently.
cask emacs --load "assess-discover" --funcall assess-discover-run-and-exit-batch
I couldn't make it work, e.g. it opens a separate Emacs window, which then complains that assess-discover-run-and-exit-batch
is only for batch mode. But:
cask emacs --load "assess-discover" --funcall assess-discover-run-and-exit-batch
does it not cry "I want cask test
instead of a 80-character command" to you?
I wonder if it's really that useful
And I wonder what other people use Cask for. The only reason I looked for something like this is running regression tests from command line with simple syntax to narrow down to exact tests I need. Packaging? I just push to Github and let Melpa build packages. Developing several cross-dependent packages (cask link ...
)? I have a homegrown solution of loading local-environment.el
, which could e.g. modify load-path
(and do whatever per-machine setup steps I want in general, so e.g. on Travis it installs the packages from Melpa). Or I could just add symbolic links.
Frankly, so far it looks like I'll keep using ugly, but at least working shell scripts I have.
from cask.
The output is line-buffered so you need to use different reporter with ert-runner.
This is what I use
cask exec ert-runner --reporter ert+duration -p 'kill-symbol'
You can look at other project's travis setups, that's what people use it for. And to have the same env available locally.
from cask.
@doublep "I couldn't make it work, e.g. it opens a separate Emacs window, which then complains that assess-discover-run-and-exit-batch is only for batch mode."
Oh dear, my apologies. I shortened the command because it was just an example.
cask emacs --batch -q \
--directory=. \
--load "assess-discover" \
--funcall assess-discover-run-and-exit-batch
@rejeep "but I wonder if it's really that useful."
It's a good question, and you have a point. But, I do remember when trying out cask
that I was expecting a test
option. Nowadays I work around the somewhat long cask
command line with a make file. You are correct, that it adds to the maintainer load. The risks are there but I think are low, given the overlap in authorship between these four projects.
I'll have a go at the PR (it will take time!) and keep it as simple as possible, because as you say, why create work for the future.
from cask.
There are many test frameworks, cask exec <framework>
is better than cask test
, I think.
Close for now, but please comment if anyone has a productive idea.
from cask.
Related Issues (20)
- Cask fails to initialize with Emacs 29 due to outdated package in Stable Melpa HOT 5
- Make fails with package-build 3.2 (package-build-expand-file-specs obsolete) HOT 1
- install cask in macOS HOT 8
- epl-0.9.el not found HOT 4
- Installation error HOT 1
- error: cask install HOT 1
- Cask build should not always build with development dependencies HOT 2
- Is document about usage outdated? HOT 1
- State of cask.readthedocs.io? HOT 4
- Please hide bundled package-build HOT 1
- Can I use cask as is package-manager HOT 1
- Install cask with cask? HOT 2
- Cask update fails with "Wrong type argument: epl-package" HOT 6
- Cask update fails with error "Some dependencies were not available: cask" HOT 1
- cask package fails with "wrong number of arguments" for "package-build--package" HOT 2
- Guidance for how to integrate in a dev-container HOT 5
- Build issue: bin/cask: line 37: servant: command not found HOT 4
- Cask fails to initialize - Cannot open load file" "No such file or directory" "package-build" HOT 4
- Installation on Windows HOT 5
- Installation fails if ~/.local/bin does not exist HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cask.