Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Chouffe/clojure fix tests #14531

Merged
merged 7 commits into from
Mar 29, 2019
Merged

Conversation

Chouffe
Copy link
Contributor

@Chouffe Chouffe commented Mar 26, 2019

Description

Fixes some clojure tests that were not being run because the is macro from clojure.test was returning true.
Tests were defined like so

(is (= expected) value)

instead of like this

(is (= expected value))

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http:https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Feature1, tests, (and when applicable, API doc)
  • Feature2, tests, (and when applicable, API doc)

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@Chouffe Chouffe requested a review from gigasquid as a code owner March 26, 2019 15:46
@gigasquid
Copy link
Member

Thanks for fixing this 💯 - Will review shortly

@@ -206,4 +210,5 @@
fname)
good-contents (slurp "test/good-test-ndarray.clj")
contents (slurp fname)]
(is (= good-contents contents)))))
;; FIXME
#_(is (= good-contents contents)))))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand why this one fails for me...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a new line thing - I have a fixed in the follow up pr

@@ -70,8 +70,8 @@
(util/option->value)))))

(deftest test-keyword->snake-case
(is (= [:foo-bar :foo2 :bar-bar])
(util/keyword->snake-case [:foo_bar :foo2 :bar-bar])))
(is (= ["foo_bar" "foo2" "bar_bar"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this is the test you wanted to write in the first place

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to test the base functionality. It was one of those cases where the dev generator was written initially without any tests and then I circled back and put tests in, so the tests don't make as much sense as if they would have if it was initially written with that intent.

@abhinavs95
Copy link
Contributor

@mxnet-label-bot add [Clojure, Test, pr-awaiting-review]

@marcoabreu marcoabreu added Clojure pr-awaiting-review PR is waiting for code review Test labels Mar 26, 2019
Copy link
Member

@gigasquid gigasquid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for finding and fixing this and making it better 💯

There will be a follow up pr to fix the commented out tests

@@ -86,18 +86,21 @@
(is (= "LRN" (-> lrn-info vals ffirst :name str)))))

(deftest test-symbol-vector-args
(is (= `(if (clojure.core/map? kwargs-map-or-vec-or-sym)
;; FIXME
#_(is (= `(if (clojure.core/map? kwargs-map-or-vec-or-sym)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to do a follow-up PR to fix all the FIXME tests for you to review :)

@@ -206,4 +210,5 @@
fname)
good-contents (slurp "test/good-test-ndarray.clj")
contents (slurp fname)]
(is (= good-contents contents)))))
;; FIXME
#_(is (= good-contents contents)))))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a new line thing - I have a fixed in the follow up pr

@@ -70,8 +70,8 @@
(util/option->value)))))

(deftest test-keyword->snake-case
(is (= [:foo-bar :foo2 :bar-bar])
(util/keyword->snake-case [:foo_bar :foo2 :bar-bar])))
(is (= ["foo_bar" "foo2" "bar_bar"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to test the base functionality. It was one of those cases where the dev generator was written initially without any tests and then I circled back and put tests in, so the tests don't make as much sense as if they would have if it was initially written with that intent.

@gigasquid gigasquid merged commit 9f5dfbf into apache:master Mar 29, 2019
vdantu pushed a commit to vdantu/incubator-mxnet that referenced this pull request Mar 31, 2019
* fix ndarray-test namespace

* fix symbol-test

* fix operator_test

* fix imageclassifier_test

* fix rest of test files and add fixme pragmas

* fix util-test

* [clojure][tests] remove keyword->snake-case duplicate
ZhennanQin pushed a commit to ZhennanQin/incubator-mxnet that referenced this pull request Apr 3, 2019
* fix ndarray-test namespace

* fix symbol-test

* fix operator_test

* fix imageclassifier_test

* fix rest of test files and add fixme pragmas

* fix util-test

* [clojure][tests] remove keyword->snake-case duplicate
nswamy pushed a commit that referenced this pull request Apr 5, 2019
* fix ndarray-test namespace

* fix symbol-test

* fix operator_test

* fix imageclassifier_test

* fix rest of test files and add fixme pragmas

* fix util-test

* [clojure][tests] remove keyword->snake-case duplicate
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
* fix ndarray-test namespace

* fix symbol-test

* fix operator_test

* fix imageclassifier_test

* fix rest of test files and add fixme pragmas

* fix util-test

* [clojure][tests] remove keyword->snake-case duplicate
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Clojure pr-awaiting-review PR is waiting for code review Test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants