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

Unit test failures #147

Open
cloojure opened this issue May 24, 2018 · 9 comments
Open

Unit test failures #147

cloojure opened this issue May 24, 2018 · 9 comments

Comments

@cloojure
Copy link
Contributor

Hi - I got the unit tests to run with phantom & java 8, but had 11 test failures. Am I missing something?
Alan


~/gh/reagent-forms > lein clean; lein doo phantom test once

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


Testing reagent-forms.core-test

FAIL in (set-attrs-test) (:)
Attrs are cleaned.
expected: (= (core/set-attrs div {}) [:div {:random-attr :random-attr} "body"])
  actual: (not (= [:div {:visible? :visible?, :fmt :fmt, :postamble :postamble, :field :field, :date-format :date-format, :preamble :preamble, :event :event, :auto-close? :auto-close?, :save-fn :save-fn, :random-attr :random-attr, :inline :inline} "body"] [:div {:random-attr :random-attr} "body"]))

FAIL in (set-attrs-test) (:)
Opts are binded.
expected: (= (core/set-attrs div {:get :get, :save! :save}) [:div {:random-attr :random-attr, :get :get, :save! :save} "body"])
  actual: (not (= [:div {:visible? :visible?, :get :get, :fmt :fmt, :postamble :postamble, :field :field, :date-format :date-format, :preamble :preamble, :event :event, :save! :save, :auto-close? :auto-close?, :save-fn :save-fn, :random-attr :random-attr, :inline :inline} "body"] [:div {:random-attr :random-attr, :get :get, :save! :save} "body"]))

FAIL in (set-attrs-test) (:)
Default attributes are applied.
expected: (= (core/set-attrs div {} {:default-attr :default-attr}) [:div {:random-attr :random-attr, :default-attr :default-attr} "body"])
  actual: (not (= [:div {:visible? :visible?, :fmt :fmt, :postamble :postamble, :field :field, :date-format :date-format, :preamble :preamble, :event :event, :auto-close? :auto-close?, :save-fn :save-fn, :random-attr :random-attr, :default-attr :default-attr, :inline :inline} "body"] [:div {:random-attr :random-attr, :default-attr :default-attr} "body"]))

FAIL in (init-field-test) (:)
expected: (= component [:div.btn-group {:field :single-select, :id :selected} [:button.btn.btn-default {:key :left} "Left"] [:button.btn.btn-default {:key :middle} "Middle"] [:button.btn.btn-default {:key :right} "Right"]])
  actual: (not (= [:div.btn-group {:id :selected} [:button.btn.btn-default {:key :left} "Left"] [:button.btn.btn-default {:key :middle} "Middle"] [:button.btn.btn-default {:key :right} "Right"]] [:div.btn-group {:field :single-select, :id :selected} [:button.btn.btn-default {:key :left} "Left"] [:button.btn.btn-default {:key :middle} "Middle"] [:button.btn.btn-default {:key :right} "Right"]]))

FAIL in (init-field-test) (:)
expected: (= (dissoc-fns comp) [:div {:valid? :id, :class "some-text"} "body"])
  actual: (not (= [:div {:valid? :id} "body"] [:div {:valid? :id, :class "some-text"} "body"]))

FAIL in (init-field-test) (:)
expected: (let [comp ((core/init-field [:div {:field :container, :valid? :id} "body"] {:doc (atom {:id "some-text"}), :get (fn [kw] (when kw (kw {:id "some-text"}))), :save! (fn [& _]), :update! (fn [[& _]])}))] (is (= (dissoc-fns comp) [:div {:valid? :id, :class "some-text"} "body"])))
  actual: false

FAIL in (init-field-test) (:)
expected: (= (dissoc-fns comp) [:input {:type :text, :value nil}])
  actual: (not (= [:input {:type :number, :value nil}] [:input {:type :text, :value nil}]))

FAIL in (init-field-test) (:)
expected: (let [comp ((core/init-field [:input {:field :numeric}] {:doc (atom {}), :get (fn [kw] (when kw (kw {}))), :save! (fn [& _]), :update! (fn [[& _]])}))] (is (= (dissoc-fns comp) [:input {:type :text, :value nil}])))
  actual: false

FAIL in (bind-fields-test) (:)
:doc is associated with :get when map is passed.
expected: (= opts {:doc :get, :get :get, :save! :save!, :update! :update!})
  actual: (not (= {:doc nil, :get #object[Function], :save! #object[Function], :update! #object[Function]} {:doc :get, :get :get, :save! :save!, :update! :update!}))

FAIL in (bind-fields-test) (:)
:doc is associated with :get when map is passed.
expected: (= opts {:doc :get, :get :get, :save! :save!, :update! :update!})
  actual: (not (= {:doc nil, :get #object[Function], :save! #object[Function], :update! #object[Function]} {:doc :get, :get :get, :save! :save!, :update! :update!}))

FAIL in (bind-fields-test) (:)
:doc is associated with :get when map is passed.
expected: (= opts {:doc :get, :get :get, :save! :save!, :update! :update!})
  actual: (not (= {:doc nil, :get #object[Function], :save! #object[Function], :update! #object[Function]} {:doc :get, :get :get, :save! :save!, :update! :update!}))

Ran 13 tests containing 75 assertions.
11 failures, 0 errors.
Subprocess failed

@cloojure cloojure changed the title Update for Java 9 and Java 10 Unit test failures May 24, 2018
@yogthos
Copy link
Member

yogthos commented May 24, 2018

Hmm nothing jumps out at me. I actually get an exception locally with JDK 1.8.0_163:

Caused by: clojure.lang.ExceptionInfo: Wrong number of args (1) passed to: nodes/ranges at line 25 out/clojure/core/rrb_vector/trees.cljs {:file "out/clojure/core/rrb_vector/trees.cljs", :line 25, :column 24, :tag :cljs/analysis-error}

@cloojure
Copy link
Contributor Author

I get the same errors with the newer deps on clojure 1.9/java 10 (running on Ubuntu 16.04)

@cloojure
Copy link
Contributor Author

~/gh/reagent-forms > uname -a
Linux brandy 4.4.0-122-generic #146-Ubuntu SMP Mon Apr 23 15:34:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

~/gh/reagent-forms > lsb_release -a
LSB Version:	core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:printing-9.20160110ubuntu0.2-amd64:printing-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.4 LTS
Release:	16.04
Codename:	xenial

~/gh/reagent-forms > 
~/gh/reagent-forms > java --version
java 10 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10+46)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)

~/gh/reagent-forms > lein --version
Leiningen 2.8.1 on Java 10 Java HotSpot(TM) 64-Bit Server VM

@yogthos
Copy link
Member

yogthos commented May 24, 2018

The error doesn't appear to be related to anything in the project itself though.

@yogthos
Copy link
Member

yogthos commented May 24, 2018

Ah looks like a known issue

@yogthos
Copy link
Member

yogthos commented May 24, 2018

So looks like the best thing to do might be to roll back test dependencies to the older versions, doesn't look like it's possible to run tests otherwise.

@cloojure
Copy link
Contributor Author

cloojure commented May 30, 2018 via email

@yogthos
Copy link
Member

yogthos commented May 30, 2018

It looks like it needs to be addressed in lein-cljsbuild

@miikka
Copy link

miikka commented Oct 23, 2018

Doo does not use lein-cljsbuild for building even though it reads the :cljsbuild key in project.clj. Which is to say that the same problem might need to be fixed in Doo as well. I'm unable to reproduce this problem myself with Doo, but if you know how to do it, please open an issue in Doo.

(edit: okay, i was able to reproduce it myself after all.)

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

3 participants