Skip to content

Commit 09469ce

Browse files
committed
Get the tests to pass, mostly
1 parent 80b2086 commit 09469ce

16 files changed

+252
-155
lines changed

project.clj

+57-63
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,53 @@
11
(defproject degasolv/degasolv "2.3.0-SNAPSHOT"
2-
:description "Democratize dependency management."
3-
:url "https://github.com/djhaskin987/degasolv"
4-
:license {:name "Eclipse Public License"
5-
:url "http://www.eclipse.org/legal/epl-v10.html"}
6-
:deploy-repositories [["clojars" {:url "https://clojars.org/repo"
7-
:username :env/clojars_username
8-
:password :env/clojars_password
9-
:sign-releases false}]]
2+
:description "Democratize dependency management."
3+
:url "https://github.com/djhaskin987/degasolv"
4+
:license {:name "Eclipse Public License"
5+
:url "http://www.eclipse.org/legal/epl-v10.html"}
6+
:deploy-repositories [["clojars" {:url "https://clojars.org/repo"
7+
:username :env/clojars_username
8+
:password :env/clojars_password
9+
:sign-releases false}]]
1010

11-
:dependencies [
12-
[org.clojure/clojure "1.10.2-alpha1"]
13-
[org.flatland/ordered "1.5.9"]
14-
[org.martinklepsch/clj-http-lite "0.4.3"]
15-
]
16-
:plugins [[lein-licenses "0.2.2"]
17-
[lein-print "0.1.0"]]
11+
:dependencies [[org.clojure/clojure "1.10.3"]
12+
[org.flatland/ordered "1.5.9"]
13+
[clj-http "3.12.0"]]
14+
;;[org.martinklepsch/clj-http-lite "0.4.3"]]
15+
:plugins [[lein-licenses "0.2.2"]
16+
[lein-print "0.1.0"]]
1817

19-
:java-source-paths ["src/java"
20-
"test/java"]
21-
:junit ["test/java"]
22-
:source-paths ["src"]
18+
:java-source-paths ["src/java"
19+
"test/java"]
20+
:junit ["test/java"]
21+
:source-paths ["src"]
2322

24-
:global-vars {*warn-on-reflection* true}
23+
:global-vars {*warn-on-reflection* true}
2524

26-
:test-selectors
27-
{
28-
:unit-tests :unit-tests
29-
}
30-
:profiles {
31-
:dev {
32-
:dependencies [
33-
;; extra deps
34-
[clj-wiremock "0.3.0"]
35-
[pjstadig/humane-test-output "0.9.0"]
36-
[org.clojure/core.match "0.3.0-alpha5"]
25+
:test-selectors
26+
{:unit-tests :unit-tests}
27+
:profiles {:dev {:source-paths ["src" "cli-src"]
28+
:managed-dependencies
29+
[[clj-http "3.12.0"]
30+
[clj-tuple "0.2.2"]]
31+
:dependencies [;; extra deps
32+
;;[org.clojure/core.specs.alpha "0.2.56"]
33+
[clj-wiremock "0.3.0"]
34+
[pjstadig/humane-test-output "0.9.0"]
35+
[org.clojure/core.match "0.3.0-alpha5"]
3736
;; normal deps
38-
[org.clojure/clojure "1.10.2-alpha1"]
39-
[org.flatland/ordered "1.5.9"]
40-
[org.martinklepsch/clj-http-lite "0.4.3"]
37+
[org.clojure/clojure "1.10.3"]
38+
[org.flatland/ordered "1.5.9"]
39+
[clj-http "3.12.0"]
40+
;;[org.martinklepsch/clj-http-lite "0.4.3"]
4141
;; cli deps
42-
[cheshire "5.9.0"]
43-
[com.velisco/tagged "0.5.0"]
44-
[org.clojure/tools.cli "0.3.5"]
45-
[serovers "1.6.2"]
46-
]
47-
:plugins [[test2junit "1.4.2"]]
48-
:test2junit-output-dir "target/test-results"
49-
:injections [(require 'pjstadig.humane-test-output)
50-
(pjstadig.humane-test-output/activate!)]
51-
}
52-
:uberjar {:aot :all
42+
[cheshire "5.9.0"]
43+
[com.velisco/tagged "0.5.0"]
44+
[org.clojure/tools.cli "0.3.5"]
45+
[serovers "1.6.2"]]
46+
:plugins [[test2junit "1.4.2"]]
47+
:test2junit-output-dir "target/test-results"
48+
:injections [(require 'pjstadig.humane-test-output)
49+
(pjstadig.humane-test-output/activate!)]}
50+
:uberjar {:aot :all
5351
;; old aot list
5452
;; [
5553
;; degasolv.pkgsys.core
@@ -60,23 +58,19 @@
6058
;; degasolv.resolver
6159
;; degasolv.cli
6260
;; ]
63-
:main degasolv.cli
64-
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]
65-
:source-paths ["src" "cli-src"]
66-
:dependencies [
67-
;; normal deps
68-
[org.clojure/clojure "1.10.2-alpha1"]
69-
[org.flatland/ordered "1.5.9"]
70-
[org.martinklepsch/clj-http-lite "0.4.3"]
61+
:main degasolv.cli
62+
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]
63+
:source-paths ["src" "cli-src"]
64+
:dependencies [;; normal deps
65+
[org.clojure/clojure "1.10.3"]
66+
[org.flatland/ordered "1.5.9"]
67+
[clj-http "3.12.0"]
68+
;;[org.martinklepsch/clj-http-lite "0.4.3"]
7169
;; cli deps
72-
[cheshire "5.9.0"]
73-
[com.velisco/tagged "0.5.0"]
74-
[org.clojure/tools.cli "0.3.5"]
75-
[serovers "1.6.2"]
70+
[cheshire "5.9.0"]
71+
[com.velisco/tagged "0.5.0"]
72+
[org.clojure/tools.cli "0.3.5"]
73+
[serovers "1.6.2"]
7674
;; uberjar deps
77-
[borkdude/clj-reflector-graal-java11-fix "0.0.1-graalvm-20.1.0"]
78-
]
79-
}
80-
}
81-
:target-path "target/%s/"
82-
)
75+
[borkdude/clj-reflector-graal-java11-fix "0.0.1-graalvm-20.1.0"]]}}
76+
:target-path "target/%s/")

src/degasolv/resolver_core.clj

+3-3
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ successful?
603603
#(get % 1)
604604
clause-result))])))))))
605605

606-
(defn make-packrat-install-graph
606+
(defn make-install-graph
607607
[package-graph handle]
608608
(as-> package-graph grph
609609
;; get all the packages in the graph
@@ -699,8 +699,8 @@ successful?
699699
:exclude (reduce (fn [c [k v]] (into c v))
700700
#{}
701701
present-packages)))
702-
:packrat-install-graph
703-
(make-packrat-install-graph
702+
:install-graph
703+
(make-install-graph
704704
(second result)
705705
(if (= conflict-strat :inclusive)
706706
#(str (:id %) "@" (:version %))

src/degasolv/util.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
(:require [clojure.java.io :as io]
33
[clojure.java.io :as io]
44
[clojure.pprint :as pprint]
5-
[clj-http.lite.client :as client]))
5+
[clj-http.client :as client]))
66

77
; UTF-8 by default :)
88
(defn base-slurp [loc]

test/resources/scripts/test-apt

+2-10
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,37 @@ jar=${root_path}/target/uberjar/${name}-${version}-standalone.jar
2222
runthis=
2323
if [ -e "${ni}" ]
2424
then
25-
runthis="${ni}"
25+
runthis="${ni} -Xss16m"
2626
else
27-
runthis="java -jar ${jar}"
27+
runthis="java -Xss16m -jar ${jar}"
2828
fi
2929

3030
try_time ${runthis} \
31-
-Xss16m \
3231
query-repo \
3332
--repository "binary-amd64 file://${PWD}/${test_home}/avail /" \
3433
--package-system apt \
3534
--query "libc6"
3635

3736
try_time ${runthis} \
38-
-Xss16m \
3937
resolve-locations \
4038
--resolve-strat "fast" \
4139
--repository "binary-amd64 file://${PWD}/${test_home}/avail /" \
4240
--package-system apt \
4341
--requirement "libc6"
4442

4543
try_time ${runthis} \
46-
-Xss16m \
4744
resolve-locations \
4845
--repository "binary-amd64 file://${PWD}/${test_home}/avail /" \
4946
--package-system apt \
5047
--requirement "libc6"
5148

5249
try_time ${runthis} \
53-
-Xss16m \
5450
resolve-locations \
5551
--repository "binary-amd64 file://${PWD}/${test_home}/avail /" \
5652
--package-system apt \
5753
--requirement "bash"
5854

5955
try_time ${runthis} \
60-
-Xss16m \
6156
resolve-locations \
6257
--resolve-strat fast \
6358
--disable-alternatives \
@@ -71,7 +66,6 @@ try_time ${runthis} \
7166
--requirement "firefox"
7267

7368
try_time ${runthis} \
74-
-Xss16m \
7569
resolve-locations \
7670
--repository "binary-i386 file://${PWD}/${test_home}/i386 /" \
7771
--repository "binary-amd64 file://${PWD}/${test_home}/amd64 /" \
@@ -82,7 +76,6 @@ try_time ${runthis} \
8276
--requirement "firefox"
8377

8478
try_time ${runthis} \
85-
-Xss16m \
8679
resolve-locations \
8780
--disable-alternatives \
8881
--resolve-strat fast \
@@ -95,7 +88,6 @@ try_time ${runthis} \
9588
--requirement "ubuntu-desktop"
9689

9790
try_time ${runthis} \
98-
-Xss16m \
9991
resolve-locations \
10092
--repository "binary-i386 file://${PWD}/${test_home}/i386 /" \
10193
--repository "binary-amd64 file://${PWD}/${test_home}/amd64 /" \

test/resources/scripts/test-env-vars

+13-4
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,22 @@ mkdir -p "${test_home}"
1919
cd "${test_home}"
2020

2121
# First, generate the needed cards for resolution.
22+
ni=${root_path}/${name}-${version}-standalone
23+
jar=${root_path}/target/uberjar/${name}-${version}-standalone.jar
24+
runthis=
25+
if [ -e "${ni}" ]
26+
then
27+
runthis="${ni} -Xss16m"
28+
else
29+
runthis="java -Xss16m -jar ${jar}"
30+
fi
2231

2332
DEGASOLV_ID="a" \
2433
DEGASOLV_REQUIREMENTS="b" \
2534
DEGASOLV_VERSION="1.0.0" \
2635
DEGASOLV_LOCATION="https://example.com/repo/a-1.0.0.zip" \
2736
DEGASOLV_CARD_FILE=$PWD/a-1.0.0.zip.dscard \
28-
${root_path}/${name}-${version}-standalone \
37+
${runthis} \
2938
generate-card
3039

3140
cat > ./config.json << JSON_CONFIG
@@ -44,12 +53,12 @@ EDN_CONFIG
4453
DEGASOLV_CONFIG_FILES="./config.edn" \
4554
DEGASOLV_JSON_CONFIG_FILES="./config.json" \
4655
DEGASOLV_CARD_FILE=$PWD/b-2.3.0.zip.dscard \
47-
${root_path}/${name}-${version}-standalone \
56+
${runthis} \
4857
generate-card
4958

50-
${root_path}/${name}-${version}-standalone generate-repo-index -d $PWD -I $PWD/index.dsrepo
59+
${runthis} generate-repo-index -d $PWD -I $PWD/index.dsrepo
5160

52-
${root_path}/${name}-${version}-standalone \
61+
${runthis} \
5362
resolve-locations \
5463
-R ${PWD}/index.dsrepo \
5564
--requirement "a<=1.0.0"

test/resources/scripts/test-index-sort-order

+15-6
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,43 @@ mkdir -p "${test_home}"
1919
cd "${test_home}"
2020

2121
# First, generate the needed cards for resolution.
22+
ni=${root_path}/${name}-${version}-standalone
23+
jar=${root_path}/target/uberjar/${name}-${version}-standalone.jar
24+
runthis=
25+
if [ -e "${ni}" ]
26+
then
27+
runthis="${ni} -Xss16m"
28+
else
29+
runthis="java -Xss16m -jar ${jar}"
30+
fi
2231

23-
${root_path}/${name}-${version}-standalone \
32+
${runthis} \
2433
generate-card \
2534
-i "a" \
2635
-v "1.0.0" \
2736
-l "https://example.com/repo/a-1.0.0.zip" \
2837
-C $PWD/a-1.0.0.zip.dscard
2938

30-
${root_path}/${name}-${version}-standalone \
39+
${runthis} \
3140
generate-card \
3241
-i "a" \
3342
-v "2.0.0" \
3443
-l "https://example.com/repo/a-2.0.0.zip" \
3544
-C $PWD/a-2.0.0.zip.dscard
3645

37-
${root_path}/${name}-${version}-standalone generate-repo-index -O ascending -d $PWD -I $PWD/ascending.dsrepo
46+
${runthis} generate-repo-index -O ascending -d $PWD -I $PWD/ascending.dsrepo
3847

39-
${root_path}/${name}-${version}-standalone generate-repo-index --index-sort-order descending -d $PWD -I $PWD/descending.dsrepo
48+
${runthis} generate-repo-index --index-sort-order descending -d $PWD -I $PWD/descending.dsrepo
4049

41-
if ${root_path}/${name}-${version}-standalone \
50+
if ${runthis} \
4251
resolve-locations \
4352
-R ${PWD}/descending.dsrepo \
4453
--requirement "a" | grep -F -q '1.0.0'
4554
then
4655
exit 1
4756
fi
4857

49-
if ${root_path}/${name}-${version}-standalone \
58+
if ${runthis} \
5059
resolve-locations \
5160
-R ${PWD}/ascending.dsrepo \
5261
--requirement "a" | grep -F -q '2.0.0'

test/resources/scripts/test-json-config

+10-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,14 @@ cat > "degasolv.json" << JSON
2727
}
2828
JSON
2929

30-
${root_path}/${name}-${version}-standalone \
30+
ni=${root_path}/${name}-${version}-standalone
31+
jar=${root_path}/target/uberjar/${name}-${version}-standalone.jar
32+
runthis=
33+
if [ -e "${ni}" ]
34+
then
35+
runthis="${ni} -Xss16m"
36+
else
37+
runthis="java -Xss16m -jar ${jar}"
38+
fi
39+
${runthis} \
3140
-j "degasolv.json" display-config

0 commit comments

Comments
 (0)