librelist archives

« back to archive

Running Tests on master

Running Tests on master

From:
Daniel Dyba
Date:
2012-11-27 @ 22:43
I'm having trouble running the tests on the master branch. I run the
command `lein test` and get the following output:

java.lang.RuntimeException: Unable to resolve symbol: make in this context,
compiling:(leiningen/core/test/project.clj:70)

Here is the output for that

file<https://github.com/technomancy/leiningen/blob/master/leiningen-core/test/leiningen/core/test/project.clj>
:

     67 (deftest test-merge-profile-paths
     68   (with-redefs [default-profiles test-profiles]
     69     (is (= ["/etc/myapp" "test/hi" "blue-resources" "resources"]
     *70            (-> (make*
     71                 {:resource-paths ["resources"]
     72                  :profiles {:blue {:resource-paths
["blue-resources"]}}})
     73                (merge-profiles [:blue :tes :qa])
     74                :resource-paths)))
     75     (is (= ["/etc/myapp" "test/hi" "blue-resources"]
     76            (-> (make
     77                 {:resource-paths ^:displace ["resources"]
     78                  :profiles {:blue {:resource-paths
["blue-resources"]}}})
     79                (merge-profiles [:blue :tes :qa])
     80                :resource-paths)))
     81     (is (= ["replaced"]
     82            (-> (make
     83                 {:resource-paths ["resources"]
     84                  :profiles {:blue {:resource-paths ^:replace
["replaced"]}}})
     85                (merge-profiles [:tes :qa :blue])
     86                :resource-paths)))
     87     (is (= {:url "http://" :username "u" :password "p"}
     88            (-> (make
     89                 {:repositories [["foo" {:url "http://" :creds
:gpg}]]
     90                  :profiles {:blue {:repositories {"foo"
     91                                                   ^:replace {:url
"http://"
     92
 :username "u"
     93
 :password "p"}}}}})
     94                (merge-profiles [:blue :qa :tes])
     95                :repositories
     96                last last)))))

For some reason, Leiningen doesn't see the make function. But that function
is 
defined<https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/project.clj>
in
the project.clj file in the src directory of leiningen-core:

*    138 (defn make*
    139   ([project project-name version root]
    140      (make (assoc project
    141              :name (name project-name)
    142              :group (or (namespace project-name)
    143                         (name project-name))
    144              :version version
    145              :root root)))
    146   ([project]
    147      (let [repos (if (:omit-default-repositories project)
    148                    (do (println "WARNING:"
    149                                 ":omit-default-repositories is
deprecated;"
    150                                 "use :repositories ^:replace [...]
instead.")
    151                        empty-repositories)
    152                    default-repositories)]
    153        (meta-merge
    154         {:repositories repos
    155          :plugin-repositories repos
    156          :deploy-repositories deploy-repositories
    157          :plugins empty-dependencies
    158          :dependencies empty-dependencies
    159          :source-paths empty-paths
    160          :resource-paths empty-paths
    161          :test-paths empty-paths}
    162         (-> (merge defaults project)
    163             (dissoc :eval-in-leiningen :omit-default-repositories)
    164             (assoc :eval-in (or (:eval-in project)
    165                                 (if (:eval-in-leiningen project)
    166                                   :leiningen, :subprocess))
    167                    :offline? (not (nil? (System/getenv
"LEIN_OFFLINE")))))))))

And we are using the correct namespace in the project.clj file located in
the test directory:

      1 (ns leiningen.core.test.project
      2   (:refer-clojure :exclude [read])
*      3   (:use [clojure.test]*
*      4         [leiningen.core.project])*
      5   (:require [leiningen.core.user :as user]
      6             [leiningen.core.classpath :as classpath]
      7             [clojure.java.io :as io]))
      8

Is anyone else experiencing the same problem? What am I doing wrong?

Respectfully,

Mieczysław Daniel Dyba
Electrical Engineering Associate II
ITS Network Engineering & Security
Los Angeles Department of Water & Power
LinkedIn: http://www.linkedin.com/in/danieldyba
Github (Social Coding): https://github.com/dyba

Re: [leiningen] Running Tests on master

From:
Bruce Adams
Date:
2012-11-28 @ 00:20
Daniel -

From the root of a leiningen checkout, you need to run:

bin/lein test

This will run the Leiningen in the checkout, instead of whatever your
installed "lein" script points to (such as 2.0.0-preview10).

Also, before running the tests, you need to "build" leiningen-core using
Leiningen 1.7.x, something like this:

cd leiningen-core
lein1 install
cd ..

- Bruce

On Nov 27, 2012 5:44 PM, "Daniel Dyba" <daniel.dyba
<daniel.dyba@gmail.com>@<daniel.dyba@gmail.com>
gmail.com <daniel.dyba@gmail.com>> wrote:
>
> I'm having trouble running the tests on the master branch. I run the
command `lein test` and get the following output:
>
> java.lang.RuntimeException: Unable to resolve symbol: make in this
context, compiling:(leiningen/core/test/project.clj:70)

Re: [leiningen] Running Tests on master

From:
Daniel Dyba
Date:
2012-11-28 @ 00:44
Thank you Bruce! A real n00b mistake I made. I eventually realized that was
the problem. I found Phil on IRC and he mentioned just what you said: I had
to build the core with lein1. Thank you again. I realized there isn't a
Wiki about how to get started with contributing to Leiningen. I will create
it to help other developers interested in volunteering.

Respectfully,

Mieczysław Daniel Dyba
Electrical Engineering Associate II
ITS Network Engineering & Security
Los Angeles Department of Water & Power
LinkedIn: http://www.linkedin.com/in/danieldyba
Github (Social Coding): https://github.com/dyba




On Tue, Nov 27, 2012 at 4:20 PM, Bruce Adams <bruce.adams@acm.org> wrote:

> Daniel -
>
> From the root of a leiningen checkout, you need to run:
>
> bin/lein test
>
> This will run the Leiningen in the checkout, instead of whatever your
> installed "lein" script points to (such as 2.0.0-preview10).
>
> Also, before running the tests, you need to "build" leiningen-core using
> Leiningen 1.7.x, something like this:
>
> cd leiningen-core
> lein1 install
> cd ..
>
> - Bruce
>
> On Nov 27, 2012 5:44 PM, "Daniel Dyba" <daniel.dyba<daniel.dyba@gmail.com>
> @ <daniel.dyba@gmail.com>gmail.com <daniel.dyba@gmail.com>> wrote:
> >
> > I'm having trouble running the tests on the master branch. I run the
> command `lein test` and get the following output:
> >
> > java.lang.RuntimeException: Unable to resolve symbol: make in this
> context, compiling:(leiningen/core/test/project.clj:70)
>

Re: [leiningen] Running Tests on master

From:
Phil Hagelberg
Date:
2012-11-28 @ 01:08
On Tue, Nov 27, 2012 at 4:44 PM, Daniel Dyba <daniel.dyba@gmail.com> wrote:
> Thank you Bruce! A real n00b mistake I made. I eventually realized that was
> the problem. I found Phil on IRC and he mentioned just what you said: I had
> to build the core with lein1. Thank you again. I realized there isn't a Wiki
> about how to get started with contributing to Leiningen. I will create it to
> help other developers interested in volunteering.

There's a "Building" section in the readme that covers this; can you
see about adding things there instead of creating a new page on the
wiki?

thanks,
Phil

Re: [leiningen] Running Tests on master

From:
Daniel Dyba
Date:
2012-11-28 @ 01:51
No problem. I'll do that.

Respectfully,

Mieczysław Daniel Dyba
Electrical Engineering Associate II
ITS Network Engineering & Security
Los Angeles Department of Water & Power
LinkedIn: http://www.linkedin.com/in/danieldyba
Github (Social Coding): https://github.com/dyba




On Tue, Nov 27, 2012 at 5:08 PM, Phil Hagelberg <phil@hagelb.org> wrote:

> On Tue, Nov 27, 2012 at 4:44 PM, Daniel Dyba <daniel.dyba@gmail.com>
> wrote:
> > Thank you Bruce! A real n00b mistake I made. I eventually realized that
> was
> > the problem. I found Phil on IRC and he mentioned just what you said: I
> had
> > to build the core with lein1. Thank you again. I realized there isn't a
> Wiki
> > about how to get started with contributing to Leiningen. I will create
> it to
> > help other developers interested in volunteering.
>
> There's a "Building" section in the readme that covers this; can you
> see about adding things there instead of creating a new page on the
> wiki?
>
> thanks,
> Phil
>