Skip to content

Fix and clean up load-error handling, remove Orchestra #233

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

Merged
merged 11 commits into from
Sep 2, 2021

Conversation

plexus
Copy link
Member

@plexus plexus commented Jul 20, 2021

This makes kaocha.watch use the mechanisms already available in
kaocha.testable to deal with and report load errors. It also does a general
pass of cleaning things up, because we had created a bit of a mess.

handle-load-error is gone, the testable implementations should no longer need
this, just let kaocha.testable handle this stuff for you.

It also seems at some point we went from :kaocha.test-plan/load-error to
:kaocha.testable/load-error, and ended up with a bit of a hodge-podge. It's
surprising things still worked as well as they did. I changed the remaining
test-plan/load-error references to testable/load-error, since that now
dominates, and is IMO also the more intuitive, since we apply these on
individual testables (typically the suite).

I removed the Orchestra instrumentation, and disabled the fdef check plugin. These things get in the way too easily, at this point they are causing us a lot of work without adding much value. I also dropped the (outdated) Orchestra dependency. The orchestra plugin is still there, but going forward people should bring their own Orchestra if they still want to use it.

Other small bits

  • fixed a reflection warning in the notifier plugin
  • version bumps
  • added portal (dev use)
  • somewhat more comprehensive error message when the reporter throws (luckily a rare occasion, unless orchestra starts feeding it random bullshit)
  • lots of whitespace fixes

Closes #226

plexus added 8 commits July 20, 2021 09:42
People can bring their own Orchestra if they want it
Include a reduced version of the full event, instead of only the type.
(Toolkit/getDefaultToolkit) returns a SunToolkit, which is not publicly
accessible. Instead the `getImage` method should be called on the abstract base
class `java.awt.Toolkit`. We need a type hint on the string as well, to
disambiguate the overloaded method call.

Fixes this:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by clojure.lang.InjectedInvoker/0x000000084007b840 (file:/home/arne/.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.jar) to method sun.a
wt.SunToolkit.getImage(java.lang.String)
WARNING: Please consider reporting this to the maintainers of clojure.lang.InjectedInvoker/0x000000084007b840
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
It gets in the way too easily, at this point it's causing us a lot of work
without adding much value.
This makes kaocha.watch use the mechanisms already available in
`kaocha.testable` to deal with and report load errors. It also does a general
pass of cleaning things up, because we had created a bit of a mess.

`handle-load-error` is gone, the testable implementations should no longer need
this, just let kaocha.testable handle this stuff for you.

It also seems at some point we went from `:kaocha.test-plan/load-error` to
`:kaocha.testable/load-error`, and ended up with a bit of a hodge-podge. It's
surprising things still worked as well as they did. I changed the remaining
test-plan/load-error references to testable/load-error, since that now
dominates, and is IMO also the more intuitive, since we apply these on
individual testables (typically the suite).
@pesterhazy
Copy link
Contributor

Thanks for the quick fix! It works great.

Testing methodology: Gave this a try using {:extra-deps {lambdaisland/kaocha {:local/root "../../../kaocha"}}}

On master I see the behavior describe in #226 (comment)

On this branch, I get a stacktrace, which is the expected behavior

Exception: clojure.lang.Compiler$CompilerException: Syntax error compiling at (cas/core.clj:1:1).
#:clojure.error{:phase :compile-syntax-check, :line 1, :column 1, :source "cas/core.clj"}
 at clojure.lang.Compiler.load (Compiler.java:7652)
    ...
    lambdaisland.tools.namespace.reload$track_reload_one.invokeStatic (reload.clj:35)
    lambdaisland.tools.namespace.reload$track_reload_one.invoke (reload.clj:21)
    lambdaisland.tools.namespace.reload$track_reload.invokeStatic (reload.clj:52)
    lambdaisland.tools.namespace.reload$track_reload.invoke (reload.clj:43)
    kaocha.watch$track_reload_BANG_.invokeStatic (watch.clj:60)
    kaocha.watch$track_reload_BANG_.invoke (watch.clj:59)
    kaocha.watch$plugin_pre_load_hook.invokeStatic (watch.clj:231)
    kaocha.watch$plugin_pre_load_hook.invoke (watch.clj:223)
    ...
    kaocha.plugin$run_hook_STAR_$fn__2171.invoke (plugin.clj:83)
    ...
    kaocha.plugin$run_hook_STAR_.invokeStatic (plugin.clj:81)
    kaocha.plugin$run_hook_STAR_.doInvoke (plugin.clj:80)
    ...
    kaocha.plugin$run_hook.invokeStatic (plugin.clj:92)
    kaocha.plugin$run_hook.doInvoke (plugin.clj:91)
    ...
    kaocha.api$test_plan.invokeStatic (api.clj:50)
    kaocha.api$test_plan.invoke (api.clj:49)
    kaocha.api$run$fn__3175.invoke (api.clj:101)
    ...
    kaocha.api$run.invokeStatic (api.clj:99)
    kaocha.api$run.invoke (api.clj:86)
    kaocha.watch$try_run$fn__4923.invoke (watch.clj:53)
    kaocha.watch$try_run.invokeStatic (watch.clj:52)
    kaocha.watch$try_run.invoke (watch.clj:44)
    kaocha.watch$run_loop.invokeStatic (watch.clj:193)
    kaocha.watch$run_loop.invoke (watch.clj:187)
    kaocha.watch$run_STAR_.invokeStatic (watch.clj:295)
    kaocha.watch$run_STAR_.invoke (watch.clj:272)
    kaocha.watch$run$fn__5006.invoke (watch.clj:305)
    ...
    kaocha.watch$run$fn__5008.invoke (watch.clj:312)
    ...
    java.util.concurrent.FutureTask.run (FutureTask.java:264)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1130)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:630)
    ...
Caused by: java.io.FileNotFoundException: Could not locate clojure/stringz__init.class, clojure/stringz.clj or clojure/stringz.cljc on classpath.
 at clojure.lang.RT.load (RT.java:462)
    ...
    cas.core$eval5933$loading__6737__auto____5934.invoke (core.clj:1)
    cas.core$eval5933.invokeStatic (core.clj:1)
    cas.core$eval5933.invoke (core.clj:1)
    ...
    lambdaisland.tools.namespace.reload$track_reload_one.invokeStatic (reload.clj:35)
    lambdaisland.tools.namespace.reload$track_reload_one.invoke (reload.clj:21)
    lambdaisland.tools.namespace.reload$track_reload.invokeStatic (reload.clj:52)
    lambdaisland.tools.namespace.reload$track_reload.invoke (reload.clj:43)
    kaocha.watch$track_reload_BANG_.invokeStatic (watch.clj:60)
    kaocha.watch$track_reload_BANG_.invoke (watch.clj:59)
    kaocha.watch$plugin_pre_load_hook.invokeStatic (watch.clj:231)
    kaocha.watch$plugin_pre_load_hook.invoke (watch.clj:223)
    ...
    kaocha.plugin$run_hook_STAR_$fn__2171.invoke (plugin.clj:83)
    ...
    kaocha.plugin$run_hook_STAR_.invokeStatic (plugin.clj:81)
    kaocha.plugin$run_hook_STAR_.doInvoke (plugin.clj:80)
    ...
    kaocha.plugin$run_hook.invokeStatic (plugin.clj:92)
    kaocha.plugin$run_hook.doInvoke (plugin.clj:91)
    ...
    kaocha.api$test_plan.invokeStatic (api.clj:50)
    kaocha.api$test_plan.invoke (api.clj:49)
    kaocha.api$run$fn__3175.invoke (api.clj:101)
    ...
    kaocha.api$run.invokeStatic (api.clj:99)
    kaocha.api$run.invoke (api.clj:86)
    kaocha.watch$try_run$fn__4923.invoke (watch.clj:53)
    kaocha.watch$try_run.invokeStatic (watch.clj:52)
    kaocha.watch$try_run.invoke (watch.clj:44)
    kaocha.watch$run_loop.invokeStatic (watch.clj:193)
    kaocha.watch$run_loop.invoke (watch.clj:187)
    kaocha.watch$run_STAR_.invokeStatic (watch.clj:295)
    kaocha.watch$run_STAR_.invoke (watch.clj:272)
    kaocha.watch$run$fn__5006.invoke (watch.clj:305)
    ...
    kaocha.watch$run$fn__5008.invoke (watch.clj:312)
    ...
    java.util.concurrent.FutureTask.run (FutureTask.java:264)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1130)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:630)
    ...

@alysbrooks alysbrooks mentioned this pull request Jul 21, 2021
14 tasks
@codecov
Copy link

codecov bot commented Sep 1, 2021

Codecov Report

Merging #233 (d5ecf30) into main (1bd5a09) will decrease coverage by 0.15%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #233      +/-   ##
==========================================
- Coverage   77.88%   77.72%   -0.16%     
==========================================
  Files          49       50       +1     
  Lines        2550     2546       -4     
  Branches      246      243       -3     
==========================================
- Hits         1986     1979       -7     
- Misses        416      418       +2     
- Partials      148      149       +1     
Flag Coverage Δ
integration 59.81% <37.00%> (+0.09%) ⬆️
unit 71.17% <45.00%> (-0.72%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/kaocha/api.clj 74.22% <0.00%> (ø)
src/kaocha/plugin/profiling.clj 31.66% <0.00%> (ø)
src/kaocha/report.clj 84.73% <0.00%> (+0.67%) ⬆️
src/kaocha/runner.clj 52.00% <20.00%> (-1.49%) ⬇️
src/kaocha/specs.clj 76.71% <33.33%> (-1.37%) ⬇️
src/kaocha/util.clj 42.10% <42.10%> (ø)
src/kaocha/watch.clj 81.77% <63.15%> (-1.05%) ⬇️
src/kaocha/plugin/notifier.clj 87.95% <70.00%> (ø)
src/kaocha/testable.clj 83.56% <75.00%> (+3.56%) ⬆️
src/kaocha/type/ns.clj 95.74% <100.00%> (+7.50%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1bd5a09...d5ecf30. Read the comment docs.

@alysbrooks alysbrooks merged commit 38470aa into main Sep 2, 2021
@plexus plexus deleted the arne/reload-cleanup branch September 2, 2021 06:07
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

Successfully merging this pull request may close these issues.

Mark load errors during kaocha.watch reloads as load errors
3 participants