@@ -89,6 +89,7 @@ class CondaCacheTest extends Specification {
89
89
def cache = Spy (CondaCache )
90
90
def BASE = Paths . get(' /conda/envs' )
91
91
def ENV = folder. resolve(' foo.yml' )
92
+ def hash = CondaCache . sipHash(ENV )
92
93
ENV . text = '''
93
94
channels:
94
95
- bioconda
@@ -99,13 +100,12 @@ class CondaCacheTest extends Specification {
99
100
- bwa=0.7.15
100
101
'''
101
102
.stripIndent(true ) // https://issues.apache.org/jira/browse/GROOVY-9423
102
-
103
103
when :
104
104
def prefix = cache. condaPrefixPath(ENV . toString())
105
105
then :
106
106
1 * cache. isYamlFilePath(ENV . toString())
107
107
1 * cache. getCacheDir() >> BASE
108
- prefix. toString() == ' /conda/envs/foo- 9416240708c49c4e627414b46a743664'
108
+ prefix. toString() == " /conda/envs/env- ${ hash } - 9416240708c49c4e627414b46a743664"
109
109
110
110
cleanup :
111
111
folder?. deleteDir()
@@ -118,6 +118,7 @@ class CondaCacheTest extends Specification {
118
118
def cache = Spy (CondaCache )
119
119
def BASE = Paths . get(' /conda/envs' )
120
120
def ENV = Files . createTempFile(' test' ,' .yml' )
121
+ def hash = CondaCache . sipHash(ENV )
121
122
ENV . text = '''
122
123
name: my-env-1.1
123
124
channels:
@@ -135,7 +136,7 @@ class CondaCacheTest extends Specification {
135
136
then :
136
137
1 * cache. isYamlFilePath(ENV . toString())
137
138
1 * cache. getCacheDir() >> BASE
138
- prefix. toString() == ' /conda/envs/my- env-1.1 -e7fafe40ca966397a2c0d9bed7181aa7'
139
+ prefix. toString() == " /conda/envs/env-${ hash } -e7fafe40ca966397a2c0d9bed7181aa7"
139
140
140
141
}
141
142
@@ -146,6 +147,7 @@ class CondaCacheTest extends Specification {
146
147
def cache = Spy (CondaCache )
147
148
def BASE = Paths . get(' /conda/envs' )
148
149
def ENV = folder. resolve(' bar.txt' )
150
+ def hash = CondaCache . sipHash(ENV )
149
151
ENV . text = '''
150
152
star=2.5.4a
151
153
bwa=0.7.15
@@ -159,7 +161,7 @@ class CondaCacheTest extends Specification {
159
161
1 * cache. isYamlFilePath(ENV . toString())
160
162
1 * cache. isTextFilePath(ENV . toString())
161
163
1 * cache. getCacheDir() >> BASE
162
- prefix. toString() == ' /conda/envs/bar- 8a4aa7db8ddb8ce4eb4d450d4814a437'
164
+ prefix. toString() == " /conda/envs/env- ${ hash } - 8a4aa7db8ddb8ce4eb4d450d4814a437"
163
165
164
166
cleanup :
165
167
folder?. deleteDir()
0 commit comments