Comments (6)
Would it not be enough to print out the list of available plugins in these cases?
That should hopefully clarify what they are doing wrong automatically.
from kaocha.
Any namespace on the classpath could potentially be a plugin, so that's not really feasible.
from kaocha.
Can this be assigned to me?
from kaocha.
That would be great @noorfathima11 , thanks for looking into this. You'll find the code in kaocha.plugin
. What happens there is two things
First we try to load the plugin namespace based on the plugin name. How it does this depends on what kind of name the plugin has.
If it's a namespaced (qualified) keyword like :foo.bar/baz
then we try to first load foo.bar.baz
, and if that doesn't succeed then we try to load foo.bar
.
If it's a simple keyword that contains a period then we load the corresponding namespace, so :foo.bar.baz
-> (require 'foo.bar.baz)
. If there is no period in the name, e.g. :notifier
, then we consider the plugin to be under kaocha.plugin
, so we (require 'kaocha.plugin.notifier)
(that last bit is new, I've been wanting to do that forever, code coming to master today).
This namespace loading completely ignores all errors, it really doesn't care if it finds a namespace or not, it proceeds regardless.
The namespace that we try to load is expected to contain a (defmethod kaocha.plugin/-register :the-plugin-name ...)
. (or a (defplugin ...)
, which really does the same thing). After trying to load the namespace, we call -register
, and this is the point where you get the error message you see above. It's printed in the :default
implementation of -register
, so it's what you get if no specific -register
has been defined for the plugin.
So to give better diagnostics this code is going to have to become smarter. try-load-third-party-namespaces
should return information about which namespaces we tried to load, and which one of them actually loaded. The default version of -register
should not throw immediately, but it should return a special value so that the caller knows that the default was called.
In register
(without the -
) we now get all the information we need to generate a proper error message. We can check if the default version of -register
got called, and if so print out a message saying which files we attempted to load, and which ones did or did not load.
For example:
ERROR: Failed loading plugin :foo.bar.baz, no such namespace foo.bar.baz.
ERROR: Failed loading plugin :foo.bar/baz, no such namespace foo.bar or foo.bar/baz.
ERROR: Failed loading plugin :foo.bar/baz, loaded namespace foo.bar, but no definition of kaocha.plugin/-register found for :foo.bar/baz.
I hope that makes sense... let me know if you have any questions!
from kaocha.
Hi @noorfathima11 , I've unassigned you so others can take this up if they want you. Do let me know if you still want to try your hand at this or other issues.
from kaocha.
Fixed by #181
from kaocha.
Related Issues (20)
- print-config cannot be enabled from exec-fn HOT 12
- Use colors that support both dark and light color schemes HOT 5
- Optional filter on buffer data before write HOT 4
- Kaocha Watch fails on WSL2 When Files Are Edited on Windows HOT 16
- [enhancement] global fixtures HOT 3
- Configure binstub? HOT 3
- Issue with running with --watch HOT 3
- Sending SIGINT to `--watch` throws ClassCastException "java.io.OutputStreamWriter cannot be cast to java.io.PrintStream" HOT 2
- capture-output doesn't respect logback.xml config HOT 2
- Clearer error message when binding a non-existent variable
- Failing test when developing locally HOT 2
- Running a specific test suite in the REPL runs all test suites instead HOT 7
- Print values of the stdout and stderr in shell HOT 2
- Is `':minimal` a diff-style option? HOT 1
- Could we store the test result in the results that are passed to the post-summary hook? HOT 3
- Clojure 1.9 Compatibility Seems Broken HOT 7
- FR: change print-invocations plugin to put all invocations on one line HOT 5
- deep-diff not working for `expectations.clojure.test` HOT 6
- Reporter bug? HOT 3
- Homepage of GitHub repository links to outdated documentation 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 kaocha.