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

Feature request: run figwheel.main.generated.build-auto-test-runner #309

Open
timothypratley opened this issue Dec 23, 2021 · 0 comments
Open

Comments

@timothypratley
Copy link
Collaborator

Figwheel provides excellent convenience with the :auto-testing flag. However, it is currently not possible to run the generated tests from the command line. This means that to have a CI job run tests, you must craft your own test runner. This in turn necessitates requiring all test namespaces or crafting a bespoke test runner generation. Figwheel already does a really good job of this and in addition, hooks the generation so that it can pick up new tests. So it would be preferable to simply use :auto-testing.

The blocker is that the namespace of the generated test runner: figwheel.main.generated.build-auto-test-runner does not exist initially, and is not on the classpath, and figwheel.main refuses to attempt to run it:

:main-opts   ["-m" "figwheel.main" "--compile-opts" "webapp.cljs.edn"
              "-fwo" "{:auto-testing true, :launch-js [\"/usr/bin/firefox\" \"--headless\" :open-url]}"
              "-m" "figwheel.main.generated.webapp-auto-test-runner"]

Fails with

Error in command line args
-- Spec failed --------------------

  ["--compile-opts"
   "webapp.cljs.edn"
   "-fwo"
   "{:auto-testing true, :launch-js [\"/usr/bin/firefox\" \"-headless\" :open-url]}"
   "-m"
   "figwheel.main.generated.webapp-auto-test-runner"]
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

should be a CLJS namespace available on the classpath

This is the classic chicken and egg dilemma!

Bypassing the spec check does not solve the problem, because :auto-testing only kicks in when you do a --build but not a -m.
I think it would be necessary to combine both --build-once and -m; However this is not currently possible because the only thing that can follow --build-once is --serve.

It feels like there is an opportunity here, but I'm out of ideas on how to both build :auto-testing and launch it from the command line.

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

1 participant