bensu / doo

doo is a library and lein plugin to run cljs.test on different js environments.
Eclipse Public License 1.0
324 stars 63 forks source link

Error encountered performing task 'doo' with profile(s): 'dev,test,test' #177

Open TimoKramer opened 6 years ago

TimoKramer commented 6 years ago

Hi there, I encountered this problem a few weeks ago and already asked on slack about it. I was asked to post it here, sorry for the delay. Since I am new to clojurescript I am sorry if it is a trivial error.

Problem is that I can not run my tests with doo anymore. It returns following error:

$> lein with-profile test doo phantom once
2018-04-13 13:36:37,595 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider 

;; ======================================================================
;; Testing with Phantom:

goog.require could not find: dispatcher.semantic_ui

  phantomjs://code/phantom5763165196387384656.js:81 in onError
Error encountered performing task 'doo' with profile(s): 'dev,test,test'
Subprocess failed

my project.clj:

(defproject myproject
  "0.0.43-SNAPSHOT"

  :description "FIXME: write description"
  :url "http://timokramer.de"

  :dependencies [[buddy "2.0.0"]
                 [cider/cider-nrepl "0.16.0"]
                 [clj-time "0.14.2"]
                 [clj-http "3.8.0"]
                 [cljs-ajax "0.7.3"]
                 [compojure "1.6.0"]
                 [cprop "0.1.11"]
                 [luminus-immutant "0.2.4"]
                 [luminus-nrepl "0.1.4"]
                 [markdown-clj "1.0.2"]
                 [metosin/muuntaja "0.5.0"]
                 [metosin/ring-http-response "0.9.0"]
                 [mount "0.1.12"]
                 [org.clojure/clojure "1.9.0"]
                 [org.clojure/clojurescript "1.9.655"]
                 [cljsjs/react-dom "15.5.4-0"]
                 [cljsjs/react-dom-server "15.5.4-0"]
                 [cljsjs/create-react-class "15.5.3-0"]
                 [reagent "0.7.0"]
                 [reagent-utils "0.3.1"]
                 [cljsjs/semantic-ui-react "0.78.2-0"]
                 [cljsjs/react-datepicker "0.55.0-0"]
                 [org.clojure/tools.cli "0.3.5"]
                 [org.clojure/tools.logging "0.4.0"]
                 [org.clojure/tools.reader "1.2.2"]
                 [org.webjars.bower/tether "1.4.3"]
                 [org.webjars/bootstrap "4.0.0-2"]
                 [org.webjars/font-awesome "5.0.6"]
                 [re-frame "0.10.5"]
                 [cljsjs/leaflet "1.2.0-0"]
                 [day8.re-frame/http-fx "0.1.5"]
                 [com.andrewmcveigh/cljs-time "0.5.2"]
                 [ring-webjars "0.2.0"]
                 [ring/ring-core "1.6.3"]
                 [ring/ring-defaults "0.3.1"]
                 [secretary "1.2.3"]
                 [selmer "1.11.7"]]

  :min-lein-version "2.0.0"

  :source-paths ["src/clj" "src/cljc"]
  :test-paths ["test/clj"]
  :resource-paths ["resources" "target/cljsbuild"]
  :target-path "target/%s/"
  :main ^:skip-aot dispatcher.core

  :plugins [[org.clojars.punkisdead/lein-cucumber "1.0.5"]
            [lein-ancient "0.6.15"]
            [lein-cljsbuild "1.1.5"]
            [lein-immutant "2.1.0"]]
  :cucumber-feature-paths ["test/clj/features"]

  :clean-targets ^{:protect false}
  [:target-path [:cljsbuild :builds :app :compiler :output-dir] [:cljsbuild :builds :app :compiler :output-to]]
  :figwheel
  {:http-server-root "public"
   :nrepl-port 7002
   :css-dirs ["resources/public/css"]
   :nrepl-middleware
   [cemerick.piggieback/wrap-cljs-repl cider.nrepl/cider-middleware]}

  :profiles
  {:uberjar {:omit-source true
             :prep-tasks ["compile" ["cljsbuild" "once" "min"]]
             :cljsbuild
             {:builds
              {:min
               {:source-paths ["src/cljc" "src/cljs" "env/prod/cljs"]
                :compiler
                {:output-to "target/cljsbuild/public/js/app.js"
                 :optimizations :advanced
                 :closure-defines {dispatcher.env/DEV false}
                 :pretty-print true
                 :pseudo-names true
                 :print-input-delimiter true
                 :closure-warnings
                 {:externs-validation :off :non-standard-jsdoc :off}
                 :externs ["react/externs/react.js"]}}}}
             :aot :all
             :uberjar-name "dispatcher.jar"
             :source-paths ["env/prod/clj"]
             :resource-paths ["env/prod/resources"]}

   :dev           [:project/dev :profiles/dev]
   :test          [:project/dev :project/test :profiles/test]

   :project/dev  {:jvm-opts ["-server" "-Dconf=dev-config.edn"]
                  :dependencies [[binaryage/devtools "0.9.9"]
                                 [clj-webdriver/clj-webdriver "0.7.2"]
                                 [com.cemerick/piggieback "0.2.2"]
                                 [doo "0.1.10"]
                                 [figwheel-sidecar "0.5.15"]
                                 [org.apache.httpcomponents/httpcore "4.4.9"]
                                 [org.clojure/core.cache "0.7.1"]
                                 [org.seleniumhq.selenium/selenium-server "3.11.0" :exclusions [org.bouncycastle/bcprov-jdk15on org.bouncycastle/bcpkix-jdk15on]]
                                 [pjstadig/humane-test-output "0.8.3"]
                                 [prone "1.5.0"]
                                 [day8.re-frame/re-frame-10x "0.2.1"]
                                 [ring/ring-devel "1.6.3"]
                                 [ring/ring-mock "0.3.2"]]
                  :plugins      [[com.jakemccrary/lein-test-refresh "0.19.0"]
                                 [lein-doo "0.1.9"]
                                 [lein-figwheel "0.5.14"]
                                 [org.clojure/clojurescript "1.9.655"]]
                  :cljsbuild
                  {:builds
                   {:app
                    {:source-paths ["src/cljs" "src/cljc" "env/dev/cljs"]
                     :figwheel {:on-jsload "dispatcher.core/mount-components"}
                     :compiler
                     {:main "dispatcher.app"
                      :asset-path "/js/out"
                      :output-to "target/cljsbuild/public/js/app.js"
                      :output-dir "target/cljsbuild/public/js/out"
                      :source-map true
                      :optimizations :none
                      :pretty-print true
                      :closure-defines {dispatcher.events/DEV true
                                        "re_frame.trace.trace_enabled_QMARK_" true}
                      :preloads [day8.re-frame-10x.preload]}}}}
                  :doo {:build "test"}
                  :source-paths ["env/dev/clj"]
                  :resource-paths ["env/dev/resources"]
                  :repl-options {:init-ns user}
                  :injections [(require 'pjstadig.humane-test-output)
                               (pjstadig.humane-test-output/activate!)]}
   :project/test {:jvm-opts ["-server" "-Dconf=test-config.edn"]
                  :resource-paths ["env/test/resources"]
                  :cljsbuild
                  {:builds
                   {:test
                    {:source-paths ["src/cljc" "src/cljs" "test/cljs"]
                     :compiler
                     {:output-to "target/test.js"
                      :main "dispatcher.doo-runner"
                      :optimizations :whitespace
                      :pretty-print true}}}}
                  }
   :profiles/dev {}
   :profiles/test {}})

I would be glad to run my tests again because I guess it is no good not to do so. thanks in advance for any help! Timo

kennethkalmer commented 6 years ago

Is your local phantomjs installation working correctly? Do you get the same error with Chrome or Firefox?

I ask because this just happened to me, but not because of phantomjs. I have a little gulp script that runs as part of the build phase and upgrading node cause this to break, and caused doo to fail with the same exception. Sorting out my little node issue and getting the gulp tasks to run again made the doo task function again.

I'm not sure if this a lein issue or a doo issue though.

bensu commented 6 years ago

Hi, @TimoKramer ,

You said "I cannot run them anymore". Can you please post the what has changed between the last time doo worked and now?

Also, @kennethkalmer point is relevant, are you sure phantomjs itself is working properties and you don't have other tooling running?

TimoKramer commented 6 years ago

@kennethkalmer thanks for your reply. I didn't succeed setting up karma on my linux so testing with chrome or firefox is not working at the moment. But with rhino it is not working with a different strange error message lein with-profile test doo rhino once

2018-05-08 12:19:23,949 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider 

;; ======================================================================
;; Testing with Rhino:

Error while loading file: "target/test.js"
ReferenceError: "Map" is not defined.
At line 1432

ERROR: doo was not loaded from the compiled script.

Make sure you start your tests using doo-tests or doo-all-tests
and that you include that file in your build

Error encountered performing task 'doo' with profile(s): 'dev,test,test'
Subprocess failed

I asked about this on slack some day but couldn't figure it out as well.

@bensu thanks for your reply. to be honest it is a few weeks ago that it occured and at that time I wasn't able to revert to a working state because at first I thought it was some update of a dep but it didn't work just reverting in git.

I am pretty sure now that it is a problem with leiningen but since I am beginner it is very hard to figure out. (https://clojurians.slack.com/archives/C053AK3F9/p1524480094000209). There is someone else that had the same problem (https://clojurians.slack.com/archives/C03S1L9DN/p1524602428000573) but didn't answer anymore.

I think the problem with doo is related to the problem with my repl but not sure on that.