Skip to content

Write initial tests and update dependencies #93

Merged
merged 1 commit into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ pom.xml.asc
.lein-*
.nrepl-port
.idea
.eastwood
8 changes: 4 additions & 4 deletions flower-common/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
:scm {:dir ".."}
:license {:name "MIT License"
:url "https://opensource.org/licenses/MIT"}
:plugins [[jonase/eastwood "0.2.5"]
:plugins [[jonase/eastwood "0.3.5"]
[lein-cljfmt "0.5.7"]
[lein-bump-version "0.1.6"]]
:cljfmt {:remove-consecutive-blank-lines? false}
:aliases {"lint" ["do" ["cljfmt" "check"] ["eastwood"]]
"test-all" ["with-profile" "default:+1.7:+1.8" "test"]
"test-all" ["with-profile" "default:+1.9:+1.8" "test"]
"lint-and-test-all" ["do" ["lint"] ["test-all"]]}
:dependencies [[org.clojure/clojure "1.9.0"]
:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/core.memoize "0.7.1"]
[com.cemerick/pomegranate "1.1.0"]
[lambdaisland/uri "1.1.0"]
[cprop "0.1.13"]
[trptcolin/versioneer "0.2.0"]]
:profiles {:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:profiles {:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})
5 changes: 3 additions & 2 deletions flower-common/src/flower/credentials.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns flower.credentials
(:require [clojure.java.io :as io]
[clojure.string :as string]
[cprop.core :as cprop]
[cprop.source]))

Expand All @@ -9,8 +10,8 @@
;;

(def ^:dynamic *credentials-file*
(clojure.string/join "/" [(System/getProperty "user.home")
".credentials.edn"]))
(string/join "/" [(System/getProperty "user.home")
".credentials.edn"]))


;;
Expand Down
8 changes: 4 additions & 4 deletions flower-integration-default/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
:scm {:dir ".."}
:license {:name "MIT License"
:url "https://opensource.org/licenses/MIT"}
:plugins [[jonase/eastwood "0.2.5"]
:plugins [[jonase/eastwood "0.3.5"]
[lein-cljfmt "0.5.7"]
[lein-bump-version "0.1.6"]]
:cljfmt {:remove-consecutive-blank-lines? false}
:aliases {"lint" ["do" ["cljfmt" "check"] ["eastwood"]]
"test-all" ["with-profile" "default:+1.7:+1.8" "test"]
"test-all" ["with-profile" "default:+1.9:+1.8" "test"]
"lint-and-test-all" ["do" ["lint"] ["test-all"]]}
:dependencies [[org.clojure/clojure "1.9.0"]
:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/core.async "0.4.490"]
[flower/flower-common "0.4.6-SNAPSHOT"]
[flower/flower-proto "0.4.6-SNAPSHOT"]]
:profiles {:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:profiles {:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})
8 changes: 4 additions & 4 deletions flower-integration-exchange/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
:scm {:dir ".."}
:license {:name "MIT License"
:url "https://opensource.org/licenses/MIT"}
:plugins [[jonase/eastwood "0.2.5"]
:plugins [[jonase/eastwood "0.3.5"]
[lein-cljfmt "0.5.7"]
[lein-bump-version "0.1.6"]]
:cljfmt {:remove-consecutive-blank-lines? false}
:eastwood {:exclude-namespaces [flower.messaging.exchange.async]}
:aliases {"lint" ["do" ["cljfmt" "check"] ["eastwood"]]
"test-all" ["with-profile" "default:+1.7:+1.8" "test"]
"test-all" ["with-profile" "default:+1.9:+1.8" "test"]
"lint-and-test-all" ["do" ["lint"] ["test-all"]]}
:repositories {"atlassian-public" "https://maven.atlassian.com/content/repositories/atlassian-public/"
"sonatype" "https://oss.sonatype.org/content/repositories/releases"}
:dependencies [[org.clojure/clojure "1.9.0"]
:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/core.async "0.4.490"]
[com.microsoft.ews-java-api/ews-java-api "2.0"]
[flower/flower-common "0.4.6-SNAPSHOT"]
[flower/flower-proto "0.4.6-SNAPSHOT"]]
:profiles {:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:profiles {:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})
8 changes: 4 additions & 4 deletions flower-integration-github/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
:scm {:dir ".."}
:license {:name "MIT License"
:url "https://opensource.org/licenses/MIT"}
:plugins [[jonase/eastwood "0.2.5"]
:plugins [[jonase/eastwood "0.3.5"]
[lein-cljfmt "0.5.7"]
[lein-bump-version "0.1.6"]]
:cljfmt {:remove-consecutive-blank-lines? false}
:aliases {"lint" ["do" ["cljfmt" "check"] ["eastwood"]]
"test-all" ["with-profile" "default:+1.7:+1.8" "test"]
"test-all" ["with-profile" "default:+1.9:+1.8" "test"]
"lint-and-test-all" ["do" ["lint"] ["test-all"]]}
:repositories {"eclipse-releases" "https://repo.eclipse.org/content/groups/releases/"}
:dependencies [[org.clojure/clojure "1.9.0"]
:dependencies [[org.clojure/clojure "1.10.0"]
[com.google.code.gson/gson "2.8.5"]
[org.eclipse.mylyn.github/org.eclipse.egit.github.core "4.9.0.201710071750-r"]
[clj-time "0.15.1"]
[flower/flower-common "0.4.6-SNAPSHOT"]
[flower/flower-proto "0.4.6-SNAPSHOT"]]
:profiles {:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:profiles {:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})
8 changes: 4 additions & 4 deletions flower-integration-gitlab/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
:scm {:dir ".."}
:license {:name "MIT License"
:url "https://opensource.org/licenses/MIT"}
:plugins [[jonase/eastwood "0.2.5"]
:plugins [[jonase/eastwood "0.3.5"]
[lein-cljfmt "0.5.7"]
[lein-bump-version "0.1.6"]]
:cljfmt {:remove-consecutive-blank-lines? false}
:aliases {"lint" ["do" ["cljfmt" "check"] ["eastwood"]]
"test-all" ["with-profile" "default:+1.7:+1.8" "test"]
"test-all" ["with-profile" "default:+1.9:+1.8" "test"]
"lint-and-test-all" ["do" ["lint"] ["test-all"]]}
:repositories {"sonatype" "https://oss.sonatype.org/content/repositories/releases"}
:dependencies [[org.clojure/clojure "1.9.0"]
:dependencies [[org.clojure/clojure "1.10.0"]
[joda-time/joda-time "2.10.1"]
[org.gitlab/java-gitlab-api "4.1.0"]
[clj-time "0.15.1"]
[flower/flower-common "0.4.6-SNAPSHOT"]
[flower/flower-proto "0.4.6-SNAPSHOT"]]
:profiles {:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:profiles {:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})
5 changes: 3 additions & 2 deletions flower-integration-gitlab/src/flower/repository/gitlab/pr.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns flower.repository.gitlab.pr
(:require [flower.macros :as macros]
(:require [clojure.string :as string]
[flower.macros :as macros]
[flower.repository.proto :as proto]
[flower.repository.gitlab.common :as common])
(:import (java.io FileNotFoundException)
Expand Down Expand Up @@ -162,7 +163,7 @@
project-id (.getId project-inner)
changes (common/get-gitlab-changes-inner repository pull-request)
flat-list (map (fn [diff]
(let [splitted (clojure.string/split (.getDiff diff) #"\n")
(let [splitted (string/split (.getDiff diff) #"\n")
grouped (group-by first splitted)
added (count (get grouped \+ []))
deleted (count (get grouped \- []))]
Expand Down
8 changes: 4 additions & 4 deletions flower-integration-jira/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
:scm {:dir ".."}
:license {:name "MIT License"
:url "https://opensource.org/licenses/MIT"}
:plugins [[jonase/eastwood "0.2.5"]
:plugins [[jonase/eastwood "0.3.5"]
[lein-cljfmt "0.5.7"]
[lein-bump-version "0.1.6"]]
:cljfmt {:remove-consecutive-blank-lines? false}
:aliases {"lint" ["do" ["cljfmt" "check"] ["eastwood"]]
"test-all" ["with-profile" "default:+1.7:+1.8" "test"]
"test-all" ["with-profile" "default:+1.9:+1.8" "test"]
"lint-and-test-all" ["do" ["lint"] ["test-all"]]}
:repositories {"atlassian-public" "https://maven.atlassian.com/content/repositories/atlassian-public/"
"eclipse-releases" "https://repo.eclipse.org/content/groups/releases/"}
:dependencies [[org.clojure/clojure "1.9.0"]
:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/core.memoize "0.7.1"]
[joda-time/joda-time "2.10.1"]
[org.slf4j/slf4j-api "1.7.25"]
Expand All @@ -23,5 +23,5 @@
[clj-time "0.15.1"]
[flower/flower-common "0.4.6-SNAPSHOT"]
[flower/flower-proto "0.4.6-SNAPSHOT"]]
:profiles {:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:profiles {:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})
8 changes: 4 additions & 4 deletions flower-integration-slack/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
:scm {:dir ".."}
:license {:name "MIT License"
:url "https://opensource.org/licenses/MIT"}
:plugins [[jonase/eastwood "0.2.5"]
:plugins [[jonase/eastwood "0.3.5"]
[lein-cljfmt "0.5.7"]
[lein-bump-version "0.1.6"]]
:cljfmt {:remove-consecutive-blank-lines? false}
:aliases {"lint" ["do" ["cljfmt" "check"] ["eastwood"]]
"test-all" ["with-profile" "default:+1.7:+1.8" "test"]
"test-all" ["with-profile" "default:+1.9:+1.8" "test"]
"lint-and-test-all" ["do" ["lint"] ["test-all"]]}
:dependencies [[org.clojure/clojure "1.9.0"]
:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/core.async "0.4.490"]
[org.clojure/data.json "0.2.6"]
[org.julienxx/clj-slack "0.6.2"]
[stylefruits/gniazdo "1.1.1"]
[flower/flower-common "0.4.6-SNAPSHOT"]
[flower/flower-proto "0.4.6-SNAPSHOT"]]
:profiles {:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:profiles {:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})
8 changes: 4 additions & 4 deletions flower-integration-tfs/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
:scm {:dir ".."}
:license {:name "MIT License"
:url "https://opensource.org/licenses/MIT"}
:plugins [[jonase/eastwood "0.2.5"]
:plugins [[jonase/eastwood "0.3.5"]
[lein-cljfmt "0.5.7"]
[lein-bump-version "0.1.6"]]
:cljfmt {:remove-consecutive-blank-lines? false}
:aliases {"lint" ["do" ["cljfmt" "check"] ["eastwood"]]
"test-all" ["with-profile" "default:+1.7:+1.8" "test"]
"test-all" ["with-profile" "default:+1.9:+1.8" "test"]
"lint-and-test-all" ["do" ["lint"] ["test-all"]]}
:dependencies [[org.clojure/clojure "1.9.0"]
:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/data.json "0.2.6"]
[joda-time/joda-time "2.10.1"]
[clj-http "3.9.1"]
[clj-time "0.15.1"]
[flower/flower-common "0.4.6-SNAPSHOT"]
[flower/flower-proto "0.4.6-SNAPSHOT"]]
:profiles {:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:profiles {:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})
3 changes: 2 additions & 1 deletion flower-integration-tfs/src/flower/tracker/tfs/common.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns flower.tracker.tfs.common
(:require [clj-http.client :as client]
[clojure.string :as string]
[clojure.data.json :as json]
[flower.macros :as macros]
[flower.tracker.proto :as proto]))
Expand Down Expand Up @@ -60,7 +61,7 @@

(defn- private-get-tfs-workitems-inner [tracker task-ids]
(if-not (empty? (filter identity task-ids))
(let [query-string {:ids (clojure.string/join "," task-ids)
(let [query-string {:ids (string/join "," task-ids)
:$expand "relations"}]
(with-tfs-function tracker false ("/_apis/wit/workitems") query-string :value
result))))
Expand Down
4 changes: 2 additions & 2 deletions flower-integration-tfs/src/flower/tracker/tfs/task.clj
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
(let [{task-url :url
relation-type :rel} relation]
(if task-url
(let [task-id (last (clojure.string/split task-url #"/"))]
(let [task-id (last (string/split task-url #"/"))]
(update acc relation-type (fn [acc workitem]
(if workitem
(conj acc workitem)
Expand Down Expand Up @@ -107,7 +107,7 @@
(into {}
(map (fn [[key value]]
[key (if (= key :task-tags)
(clojure.string/join "; " (sort value))
(string/join "; " (sort value))
value)])
tags)))

Expand Down
8 changes: 4 additions & 4 deletions flower-messaging/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
:scm {:dir ".."}
:license {:name "MIT License"
:url "https://opensource.org/licenses/MIT"}
:plugins [[jonase/eastwood "0.2.5"]
:plugins [[jonase/eastwood "0.3.5"]
[lein-cljfmt "0.5.7"]
[lein-bump-version "0.1.6"]]
:cljfmt {:remove-consecutive-blank-lines? false}
:aliases {"lint" ["do" ["cljfmt" "check"] ["eastwood"]]
"test-all" ["with-profile" "default:+1.7:+1.8" "test"]
"test-all" ["with-profile" "default:+1.9:+1.8" "test"]
"lint-and-test-all" ["do" ["lint"] ["test-all"]]}
:dependencies [[org.clojure/clojure "1.9.0"]
:dependencies [[org.clojure/clojure "1.10.0"]
[com.stuartsierra/component "0.4.0"]
[flower/flower-common "0.4.6-SNAPSHOT"]
[flower/flower-proto "0.4.6-SNAPSHOT"]]
:profiles {:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:profiles {:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})
8 changes: 4 additions & 4 deletions flower-proto/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
:scm {:dir ".."}
:license {:name "MIT License"
:url "https://opensource.org/licenses/MIT"}
:plugins [[jonase/eastwood "0.2.5"]
:plugins [[jonase/eastwood "0.3.5"]
[lein-cljfmt "0.5.7"]
[lein-bump-version "0.1.6"]]
:cljfmt {:remove-consecutive-blank-lines? false}
:aliases {"lint" ["do" ["cljfmt" "check"] ["eastwood"]]
"test-all" ["with-profile" "default:+1.7:+1.8" "test"]
"test-all" ["with-profile" "default:+1.9:+1.8" "test"]
"lint-and-test-all" ["do" ["lint"] ["test-all"]]}
:dependencies [[org.clojure/clojure "1.9.0"]]
:profiles {:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:dependencies [[org.clojure/clojure "1.10.0"]]
:profiles {:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})
8 changes: 4 additions & 4 deletions flower-repository/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
:scm {:dir ".."}
:license {:name "MIT License"
:url "https://opensource.org/licenses/MIT"}
:plugins [[jonase/eastwood "0.2.5"]
:plugins [[jonase/eastwood "0.3.5"]
[lein-cljfmt "0.5.7"]
[lein-bump-version "0.1.6"]]
:cljfmt {:remove-consecutive-blank-lines? false}
:aliases {"lint" ["do" ["cljfmt" "check"] ["eastwood"]]
"test-all" ["with-profile" "default:+1.7:+1.8" "test"]
"test-all" ["with-profile" "default:+1.9:+1.8" "test"]
"lint-and-test-all" ["do" ["lint"] ["test-all"]]}
:dependencies [[org.clojure/clojure "1.9.0"]
:dependencies [[org.clojure/clojure "1.10.0"]
[com.stuartsierra/component "0.4.0"]
[tesser.core "1.0.3"]
[flower/flower-common "0.4.6-SNAPSHOT"]
[flower/flower-proto "0.4.6-SNAPSHOT"]]
:profiles {:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:profiles {:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})
4 changes: 2 additions & 2 deletions flower-repository/src/flower/repository/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
(let [repo-projects-list (or repo-projects (list nil))]
[repo-name (map #((resolver/resolve-implementation repo-type :repository)
(let [[repo-project & repo-reversed-ns] (-> %
(clojure.string/split #"/")
(string/split #"/")
reverse)
repo-ns (if repo-reversed-ns
(->> repo-reversed-ns
reverse
(clojure.string/join #"/"))
(string/join #"/"))
repo-ns)]
{:repository-component repository-component
:repo-name repo-name
Expand Down
47 changes: 47 additions & 0 deletions flower-repository/test/flower/repository/core_test.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
(ns flower.repository.core-test
(:require [clojure.test :as test]
[flower.repository.core :as repository.core]))


(test/deftest test-repository-info
(test/testing "Getting repository info"
(test/testing "for GitHub"
(test/is (= (repository.core/get-repository-info "https://github.com/PositiveTechnologies/flower")
{:repo-type :github
:repo-url "https://github.com/PositiveTechnologies"
:repository-ns nil
:repo-projects ["PositiveTechnologies/flower"]
:repo-name :github-github.com-flower}))
(test/is (= (repository.core/get-repository-info "https://github.com/example/test")
{:repo-type :github
:repo-url "https://github.com/example"
:repository-ns nil
:repo-projects ["example/test"]
:repo-name :github-github.com-test})))

(test/testing "for GitLab"
(test/is (= (repository.core/get-repository-info "https://gitlab.com/example/test")
{:repo-type :gitlab
:repo-url "https://gitlab.com"
:repository-ns nil
:repo-projects ["example/test"]
:repo-name :gitlab-gitlab.com-test}))
(test/is (= (repository.core/get-repository-info "https://gitlab.example.com/example/test")
{:repo-type :gitlab
:repo-url "https://gitlab.example.com"
:repository-ns nil
:repo-projects ["example/test"]
:repo-name :gitlab-gitlab.example.com-test}))
(test/is (= (repository.core/with-repository-type :gitlab
(repository.core/get-repository-info "https://hello.example.com/example/test"))
{:repo-type :gitlab
:repo-url "https://hello.example.com"
:repository-ns nil
:repo-projects ["example/test"]
:repo-name :gitlab-hello.example.com-test})))

(test/testing "unrecognized"
(test/is (= (repository.core/get-repository-info "https://hello.example.com/example/test")
{:repo-type :default
:repo-name :default-hello.example.com
:repo-url "https://hello.example.com"})))))
Loading