-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
run_tests.sh
executable file
·585 lines (548 loc) · 21.1 KB
/
run_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
#!/bin/sh
# shellcheck disable=2103
# Script for executing Django PyUnit tests within a Docker container.
# Exit on failure.
set -e
print_description() {
echo "Runs the tests for workers. These tests require different Docker containers"
echo "depending on which code will be tested. By default all tests in the workers"
echo "project are run."
}
print_options() {
echo "Options:"
echo " -h Prints the help message"
echo " -t TAG Runs all tests that are tagged with \$TAG"
}
while getopts ":t:h" opt; do
case $opt in
t)
tag="$OPTARG"
;;
h)
print_description
echo
print_options
exit 0
;;
\?)
echo "Invalid option: -$OPTARG" >&2
print_options >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
print_options >&2
exit 1
;;
esac
done
# This script should always run as if it were being called from
# the directory it lives in.
script_directory="$(
cd "$(dirname "$0")" || exit
pwd
)"
cd "$script_directory" || exit
# However, in order to give Docker access to all the code we have to
# move up a level
cd ..
# Ensure that Postgres is running.
if ! [ "$(docker ps --filter name=drdb -q)" ]; then
echo "You must start Postgres first with:" >&2
echo "./scripts/run_postgres.sh" >&2
exit 1
fi
test_data_repo="https://s3.amazonaws.com/data-refinery-test-assets"
volume_directory="$script_directory/test_volume"
if [ -z "$tag" ] || [ "$tag" = "salmon" ]; then
# Download "salmon quant" test data The `newer` file was to
# signify that we using updated data. However the data has been
# updated again so now we need to go back to checking to make sure
# that it's not there so we know we have even NEWER data.
if [ ! -e "$volume_directory/salmon_tests" ] || [ -e "$volume_directory/salmon_tests/newer" ]; then
# Remove the data that comes from S3 so anything old is blown away.
rm -rf "$volume_directory/salmon_tests"
echo "Downloading 'salmon quant' test data..."
wget -q -O "$volume_directory"/salmon_tests.tar.gz "$test_data_repo"/salmon_tests_newer.tar.gz
tar xzf "$volume_directory"/salmon_tests.tar.gz -C "$volume_directory"
rm "$volume_directory"/salmon_tests.tar.gz
fi
# SalmonTools test data.
salmontools_test_zip="$test_data_repo/salmontools_test_data.tar.gz"
salmontools_test_dir="$volume_directory/salmontools"
# Clean the test data directory.
rm -rf "$salmontools_test_dir"
mkdir -p "$salmontools_test_dir"
echo "Downloading 'salmontools' test data..."
wget -q -O "$volume_directory"/salmontools.tar.gz "$salmontools_test_zip"
tar xzf "$volume_directory"/salmontools.tar.gz -C "$volume_directory"
rm "$volume_directory"/salmontools.tar.gz
# Make sure data for Salmon test is downloaded from S3.
rna_seq_test_raw_dir="$volume_directory/raw/TEST/SALMON"
read_1_name="ERR1562482_1.fastq.gz"
read_2_name="ERR1562482_2.fastq.gz"
dotsra_name="ERR1562482.sra"
rna_seq_test_data_1="$rna_seq_test_raw_dir/$read_1_name"
rna_seq_test_data_2="$rna_seq_test_raw_dir/$read_2_name"
dotsra="$rna_seq_test_raw_dir/$dotsra_name"
if [ ! -e "$rna_seq_test_data_1" ]; then
mkdir -p "$rna_seq_test_raw_dir"
echo "Downloading $read_1_name for Salmon tests."
wget -q -O "$rna_seq_test_data_1" \
"$test_data_repo/$read_1_name"
echo "Downloading $read_2_name for Salmon tests."
wget -q -O "$rna_seq_test_data_2" \
"$test_data_repo/$read_2_name"
fi
if [ ! -e "$dotsra" ]; then
mkdir -p "$rna_seq_test_raw_dir"
echo "Downloading $dotsra_name for Salmon tests."
wget -q -O "$dotsra" \
"$test_data_repo/$dotsra_name"
fi
fi
if [ -z "$tag" ] || [ "$tag" = "affymetrix" ]; then
# Make sure CEL for test is downloaded from S3.
cel_name="GSM1426071_CD_colon_active_1.CEL"
cel_name2="GSM45588.CEL"
cel_name3="GSM1364667_U_110208_7-02-10_S2.CEL"
pcl_name="GSM1426071_CD_colon_active_1.PCL"
pcl_name2="GSM45588.PCL"
pcl_name3="GSM1364667_U_110208_7-02-10_S2.PCL"
cel_test_raw_dir="$volume_directory/raw/TEST/CEL"
cel_test_data_1="$cel_test_raw_dir/$cel_name"
cel_test_data_2="$cel_test_raw_dir/$cel_name2"
cel_test_data_3="$cel_test_raw_dir/$cel_name3"
pcl_test_dir="$volume_directory/TEST/PCL"
pcl_test_data_1="$pcl_test_dir/$pcl_name"
pcl_test_data_2="$pcl_test_dir/$pcl_name2"
pcl_test_data_3="$pcl_test_dir/$pcl_name3"
if [ ! -e "$cel_test_data_1" ]; then
mkdir -p "$cel_test_raw_dir"
echo "Downloading CEL for tests."
wget -q -O "$cel_test_data_1" \
"$test_data_repo/$cel_name"
fi
if [ ! -e "$cel_test_data_2" ]; then
echo "Downloading Non-Brainarray CEL for tests."
wget -q -O "$cel_test_data_2" \
"$test_data_repo/$cel_name2"
fi
if [ ! -e "$cel_test_data_3" ]; then
echo "Downloading Huex Brain Array CEL for tests."
wget -q -O "$cel_test_data_3" \
"$test_data_repo/$cel_name3"
fi
if [ ! -e "$pcl_test_data_1" ]; then
mkdir -p "$pcl_test_dir"
echo "Downloading pre-computed PCL for tests."
wget -q -O "$pcl_test_data_1" \
"$test_data_repo/$pcl_name"
fi
if [ ! -e "$pcl_test_data_2" ]; then
mkdir -p "$pcl_test_dir"
echo "Downloading pre-computed Non-Brainarray PCL for tests."
wget -q -O "$pcl_test_data_2" \
"$test_data_repo/$pcl_name2"
fi
if [ ! -e "$pcl_test_data_3" ]; then
mkdir -p "$pcl_test_dir"
echo "Downloading pre-computed Huex Brain Array PCL for tests."
wget -q -O "$pcl_test_data_3" \
"$test_data_repo/$pcl_name3"
fi
fi
if [ -z "$tag" ] || [ "$tag" = "transcriptome" ]; then
# Make sure data for Transcriptome Index tests is downloaded.
tx_index_test_raw_dir="$volume_directory/raw/TEST/TRANSCRIPTOME_INDEX/AEGILOPS_TAUSCHII/"
fasta_file="aegilops_tauschii_short.fa.gz"
if [ ! -e "$tx_index_test_raw_dir/$fasta_file" ]; then
mkdir -p "$tx_index_test_raw_dir"
echo "Downloading fasta file for Transcriptome Index tests."
wget -q -O "$tx_index_test_raw_dir/$fasta_file" \
"$test_data_repo/$fasta_file"
fi
gtf_file="aegilops_tauschii_short.gtf.gz"
if [ ! -e "$tx_index_test_raw_dir/$gtf_file" ]; then
mkdir -p "$tx_index_test_raw_dir"
echo "Downloading gtf file for Transcriptome Index tests."
wget -q -O "$tx_index_test_raw_dir/$gtf_file" \
"$test_data_repo/$gtf_file"
fi
tx_index_test_raw_dir2="$volume_directory/raw/TEST/TRANSCRIPTOME_INDEX/"
gtf_file2="Homo_sapiens_testdata.gtf"
if [ ! -e "$tx_index_test_raw_dir2/$gtf_file2" ]; then
mkdir -p "$tx_index_test_raw_dir2"
echo "Downloading second gtf file for Transcriptome Index tests."
wget -q -O "$tx_index_test_raw_dir2/$gtf_file2" \
"$test_data_repo/$gtf_file2"
fi
fi
if [ -z "$tag" ] || [ "$tag" = "illumina" ]; then
ilu_test_raw_dir="$volume_directory/raw/TEST/ILLUMINA"
ilu_files='GSE22427_non-normalized.txt GSE54661_non_normalized.txt GSE106321_non-normalized.txt
GSE33814_trimmed_non-normalized.txt GSE112517_non-normalized.txt GSE48023_trimmed_non-normalized.txt
GSE41355_non-normalized.txt GSE100301_non-normalized.txt'
mkdir -p "$ilu_test_raw_dir"
i=1
for ilu_file in $ilu_files; do
if [ ! -e "$ilu_test_raw_dir/$ilu_file" ]; then
echo "Downloading Illumina file $i for Illumina tests."
wget -q -O "$ilu_test_raw_dir/$ilu_file" \
"$test_data_repo/$ilu_file"
fi
i=$((i + 1))
done
unset i
ilu_test_ref_dir="$volume_directory/raw/TEST/ILLUMINA/reference"
ilu_ref_file="Ad-Cre-2.AVG_Signal.tsv"
if [ ! -e "$ilu_test_ref_dir/$ilu_ref_file" ]; then
mkdir -p "$ilu_test_ref_dir"
echo "Downloading Illumin reference file for Illumina tests."
wget -q -O "$ilu_test_ref_dir/$ilu_ref_file" \
"$test_data_repo/$ilu_ref_file"
fi
fi
if [ -z "$tag" ] || [ "$tag" = "agilent" ]; then
# Agilnt Two Color test file
at_file="GSM466597_95899_agilent.txt"
at_test_raw_dir="$volume_directory/raw/TEST/AGILENT_TWOCOLOR"
if [ ! -e "$at_test_raw_dir/$at_file" ]; then
mkdir -p "$at_test_raw_dir"
echo "Downloading Agilent file for A2C tests."
wget -q -O "$at_test_raw_dir/$at_file" \
"$test_data_repo/$at_file"
fi
fi
if [ -z "$tag" ] || [ "$tag" = "no_op" ]; then
no_test_raw_dir="$volume_directory/raw/TEST/NO_OP"
no_file1="GSM557500-tbl-1.txt"
if [ ! -e "$no_test_raw_dir/$no_file1" ]; then
mkdir -p "$no_test_raw_dir"
echo "Downloading NOOP file1."
wget -q -O "$no_test_raw_dir/$no_file1" \
"$test_data_repo/$no_file1"
fi
no_file2="GSM1234847_sample_table.txt"
if [ ! -e "$no_test_raw_dir/$no_file2" ]; then
mkdir -p "$no_test_raw_dir"
echo "Downloading NOOP file2."
wget -q -O "$no_test_raw_dir/$no_file2" \
"$test_data_repo/$no_file2"
fi
no_file3="GSM1234847_sample_table_headerless.txt"
if [ ! -e "$no_test_raw_dir/$no_file3" ]; then
mkdir -p "$no_test_raw_dir"
echo "Processing NOOP file3."
tail -n +2 "$no_test_raw_dir/$no_file2" >"$no_test_raw_dir/$no_file3"
fi
no_file4="GSM1089291-tbl-1.txt"
if [ ! -e "$no_test_raw_dir/$no_file4" ]; then
mkdir -p "$no_test_raw_dir"
echo "Downloading NOOP file4."
wget -q -O "$no_test_raw_dir/$no_file4" \
"$test_data_repo/$no_file4"
fi
no_file5="GSM1089291-tbl-1-modified.txt"
if [ ! -e "$no_test_raw_dir/$no_file5" ]; then
mkdir -p "$no_test_raw_dir"
echo "Downloading NOOP file5."
wget -q -O "$no_test_raw_dir/$no_file5" \
"$test_data_repo/$no_file5"
fi
# Reference files.
no_test_exp_dir="$volume_directory/TEST/NO_OP/EXPECTED"
no_test_exp_files='gene_converted_GSM557500-tbl-1.txt GSM269747.PCL gene_converted_GSM1234847-tbl-1.txt gene_converted_GSM1089291-tbl-1.txt'
mkdir -p "$no_test_exp_dir"
i=1
for no_test_exp_file in $no_test_exp_files; do
if ! [ -e "$no_test_exp_dir/$no_test_exp_file" ]; then
echo "Downloading NOOP expected file$i."
wget -O "$no_test_exp_dir/$no_test_exp_file" \
"$test_data_repo/$no_test_exp_file"
fi
i=$((i + 1))
done
unset i
fi
if [ -z "$tag" ] || [ "$tag" = "smasher" ] || [ "$tag" = "compendia" ]; then
# Make sure PCL for test is downloaded from S3.
pcl_name="GSM1237810_T09-1084.PCL"
pcl_name2="GSM1237812_S97-PURE.PCL"
pcl_name3="GSM1238108-tbl-1.txt"
pcl_name4="GSM1487313_liver.PCL"
pcl_name5="SRP149598_gene_lengthScaledTPM.tsv"
pcl_name6="GSM1084806-tbl-1.txt"
pcl_name7="GSM1084807-tbl-1.txt"
pcl_name_gs1="GSM1084806-tbl-1.txt"
pcl_name_gs2="GSM1084807-tbl-1.txt"
pcl_name_ts1="SRR1731761_output_gene_lengthScaledTPM.tsv"
pcl_name_ts2="SRR1731762_output_gene_lengthScaledTPM.tsv"
pcl_name_ta1="danio_target.tsv"
pcl_test_raw_dir="$volume_directory/PCL"
pcl_test_data_1="$pcl_test_raw_dir/$pcl_name"
pcl_test_data_2="$pcl_test_raw_dir/$pcl_name2"
pcl_test_data_3="$pcl_test_raw_dir/$pcl_name3"
pcl_test_data_4="$pcl_test_raw_dir/$pcl_name4"
pcl_test_data_5="$pcl_test_raw_dir/$pcl_name5"
pcl_test_data_6="$pcl_test_raw_dir/$pcl_name6"
pcl_test_data_7="$pcl_test_raw_dir/$pcl_name7"
pcl_test_data_gs1="$pcl_test_raw_dir/$pcl_name_gs1"
pcl_test_data_gs2="$pcl_test_raw_dir/$pcl_name_gs2"
pcl_test_data_ts1="$pcl_test_raw_dir/$pcl_name_ts1"
pcl_test_data_ts2="$pcl_test_raw_dir/$pcl_name_ts2"
pcl_test_data_ta1="$pcl_test_raw_dir/$pcl_name_ta1"
bad_test_raw_dir="$volume_directory/BADSMASH"
bad_name="big.PCL"
bad_name2="small.PCL"
bad_name3="bad.PCL"
bad_test_data_1="$bad_test_raw_dir/$bad_name"
bad_test_data_2="$bad_test_raw_dir/$bad_name2"
bad_test_data_3="$bad_test_raw_dir/$bad_name3"
quant_test_raw_dir="$volume_directory/QUANT"
quant_name="smasher-test-quant.sf"
quant_test_data_1="$quant_test_raw_dir/$quant_name"
quant_name_2="smasher-test-truncated-quant.sf"
quant_test_data_2="$quant_test_raw_dir/$quant_name_2"
if [ ! -e "$pcl_test_data_1" ]; then
mkdir -p "$pcl_test_raw_dir"
echo "Downloading PCL for tests."
wget -q -O "$pcl_test_data_1" \
"$test_data_repo/$pcl_name"
fi
if [ ! -e "$pcl_test_data_2" ]; then
echo "Downloading PCL2 for tests."
wget -q -O "$pcl_test_data_2" \
"$test_data_repo/$pcl_name2"
fi
if [ ! -e "$pcl_test_data_3" ]; then
echo "Downloading PCL3 for tests."
wget -q -O "$pcl_test_data_3" \
"$test_data_repo/$pcl_name3"
fi
if [ ! -e "$pcl_test_data_4" ]; then
echo "Downloading PCL4 for tests."
wget -q -O "$pcl_test_data_4" \
"$test_data_repo/$pcl_name4"
fi
if [ ! -e "$pcl_test_data_5" ]; then
echo "Downloading PCL5 for tests."
wget -q -O "$pcl_test_data_5" \
"$test_data_repo/$pcl_name5"
fi
if [ ! -e "$pcl_test_data_6" ]; then
echo "Downloading PCL6 for tests."
wget -q -O "$pcl_test_data_6" \
"$test_data_repo/$pcl_name6"
fi
if [ ! -e "$pcl_test_data_7" ]; then
echo "Downloading PCL7 for tests."
wget -q -O "$pcl_test_data_7" \
"$test_data_repo/$pcl_name7"
fi
if [ ! -e "$pcl_test_data_gs1" ]; then
echo "Downloading PCLGS1 for tests."
wget -q -O "$pcl_test_data_gs1" \
"$test_data_repo/$pcl_name_gs1"
fi
if [ ! -e "$pcl_test_data_gs2" ]; then
echo "Downloading PCLGS2 for tests."
wget -q -O "$pcl_test_data_gs2" \
"$test_data_repo/$pcl_name_gs2"
fi
if [ ! -e "$pcl_test_data_ts1" ]; then
echo "Downloading PCLTS1 for tests."
wget -q -O "$pcl_test_data_ts1" \
"$test_data_repo/$pcl_name_ts1"
fi
if [ ! -e "$pcl_test_data_ts2" ]; then
echo "Downloading PCLTS2 for tests."
wget -q -O "$pcl_test_data_ts2" \
"$test_data_repo/$pcl_name_ts2"
fi
if [ ! -e "$pcl_test_data_ta1" ]; then
echo "Downloading PCLTA1 for tests."
wget -q -O "$pcl_test_data_ta1" \
"$test_data_repo/$pcl_name_ta1"
fi
if [ ! -e "$bad_test_data_1" ]; then
mkdir -p "$bad_test_raw_dir"
echo "Downloading Bad PCL for tests."
wget -q -O "$bad_test_data_1" \
"$test_data_repo/$bad_name"
fi
if [ ! -e "$bad_test_data_2" ]; then
mkdir -p "$bad_test_raw_dir"
echo "Downloading Bad PCL for tests."
wget -q -O "$bad_test_data_2" \
"$test_data_repo/$bad_name2"
fi
if [ ! -e "$bad_test_data_3" ]; then
mkdir -p "$bad_test_raw_dir"
echo "Downloading Bad PCL for tests."
wget -q -O "$bad_test_data_3" \
"$test_data_repo/$bad_name3"
fi
if [ ! -e "$quant_test_data_1" ]; then
mkdir -p "$quant_test_raw_dir"
echo "Downloading Quant files for tests."
wget -q -O "$quant_test_data_1" \
"$test_data_repo/$quant_name"
fi
if [ ! -e "$quant_test_data_2" ]; then
mkdir -p "$quant_test_raw_dir"
echo "Downloading Quant files for tests."
wget -q -O "$quant_test_data_2" \
"$test_data_repo/$quant_name_2"
fi
# Mock out the AWS keys since we use VCR to mock out the request with these
# as the AWS credentials.
export AWS_ACCESS_KEY_ID=XXX
export AWS_SECRET_ACCESS_KEY=XXX
fi
if [ -z "$tag" ] || [ "$tag" = "qn" ]; then
# Make sure PCL for test is downloaded from S3.
qn_name="1.tsv"
qn_test_raw_dir="$volume_directory/QN"
qn_test_data_1="$qn_test_raw_dir/$qn_name"
if [ ! -e "$qn_test_data_1" ]; then
mkdir -p "$qn_test_raw_dir"
echo "Downloading QN for tests."
wget -q -O "$qn_test_data_1" \
"$test_data_repo/$qn_name"
fi
qn_name="2.tsv"
qn_test_raw_dir="$volume_directory/QN"
qn_test_data_2="$qn_test_raw_dir/$qn_name"
if [ ! -e "$qn_test_data_2" ]; then
mkdir -p "$qn_test_raw_dir"
echo "Downloading QN for tests."
wget -q -O "$qn_test_data_2" \
"$test_data_repo/$qn_name"
fi
qn_name="3.tsv"
qn_test_raw_dir="$volume_directory/QN"
qn_test_data_3="$qn_test_raw_dir/$qn_name"
if [ ! -e "$qn_test_data_3" ]; then
mkdir -p "$qn_test_raw_dir"
echo "Downloading QN for tests."
wget -q -O "$qn_test_data_3" \
"$test_data_repo/$qn_name"
fi
qn_name="4.tsv"
qn_test_raw_dir="$volume_directory/QN"
qn_test_data_4="$qn_test_raw_dir/$qn_name"
if [ ! -e "$qn_test_data_4" ]; then
mkdir -p "$qn_test_raw_dir"
echo "Downloading QN for tests."
wget -q -O "$qn_test_data_4" \
"$test_data_repo/$qn_name"
fi
qn_name="5.tsv"
qn_test_raw_dir="$volume_directory/QN"
qn_test_data_5="$qn_test_raw_dir/$qn_name"
if [ ! -e "$qn_test_data_5" ]; then
mkdir -p "$qn_test_raw_dir"
echo "Downloading QN for tests."
wget -q -O "$qn_test_data_5" \
"$test_data_repo/$qn_name"
fi
qn_name="6.tsv"
qn_test_raw_dir="$volume_directory/QN"
qn_test_data_6="$qn_test_raw_dir/$qn_name"
if [ ! -e "$qn_test_data_6" ]; then
mkdir -p "$qn_test_raw_dir"
echo "Downloading QN for tests."
wget -q -O "$qn_test_data_6" \
"$test_data_repo/$qn_name"
fi
qn_name="7.tsv"
qn_test_raw_dir="$volume_directory/QN"
qn_test_data_7="$qn_test_raw_dir/$qn_name"
if [ ! -e "$qn_test_data_7" ]; then
mkdir -p "$qn_test_raw_dir"
echo "Downloading QN for tests."
wget -q -O "$qn_test_data_7" \
"$test_data_repo/$qn_name"
fi
fi
if [ -z "$tag" ] || [ "$tag" = "compendia" ]; then
# Download RNASEQ and MICROARRAY data from prod S3
micro_list_file="microarray.txt"
micro_list_dir="$volume_directory/raw/TEST/MICROARRAY"
if [ ! -e "$micro_list_dir/$micro_list_file" ]; then
mkdir -p "$micro_list_dir"
cp "workers/tests/data/$micro_list_file" "$micro_list_dir/$micro_list_file"
cd "$micro_list_dir" || exit
echo "Downloading Microarray Files!"
wget -q -i "$micro_list_file"
cd -
fi
rnaseq_list_file="rnaseq.txt"
rnaseq_list_dir="$volume_directory/raw/TEST/RNASEQ"
if [ ! -e "$rnaseq_list_dir/$rnaseq_list_file" ]; then
mkdir -p "$rnaseq_list_dir"
cp "workers/tests/data/$rnaseq_list_file" "$rnaseq_list_dir/$rnaseq_list_file"
cd "$rnaseq_list_dir" || exit
echo "Downloading RNASEQ Files!"
wget -q -i "$rnaseq_list_file"
cd -
fi
qn_name="danio_target.tsv"
qn_test_raw_dir="$volume_directory/QN"
qn_test_data_1="$qn_test_raw_dir/$qn_name"
if [ ! -e "$qn_test_data_1" ]; then
mkdir -p "$qn_test_raw_dir"
echo "Downloading QN for compendia tests."
wget -q -O "$qn_test_data_1" \
"$test_data_repo/$qn_name"
fi
fi
. ./scripts/common.sh
./scripts/prepare_image.sh -i base -s common
DB_HOST_IP=$(get_docker_db_ip_address)
# Ensure permissions are set for everything within the test data directory.
chmod -R a+rwX "$volume_directory"
worker_images="salmon transcriptome no_op downloaders smasher illumina agilent affymetrix qn janitor compendia"
for image in $worker_images; do
if [ -z "$tag" ] || [ "$tag" = "$image" ]; then
if [ "$image" = "agilent" ] || [ "$image" = "affymetrix" ]; then
# Agilent uses the same docker image as Affymetrix.
./scripts/prepare_image.sh -i affymetrix -s workers
image_name="$DOCKERHUB_REPO/dr_affymetrix"
elif [ "$tag" = "qn" ]; then
./scripts/prepare_image.sh -i smasher -s workers
image_name="$DOCKERHUB_REPO/dr_smasher"
elif [ "$tag" = "janitor" ]; then
./scripts/prepare_image.sh -i smasher -s workers
image_name="$DOCKERHUB_REPO/dr_smasher"
else
./scripts/prepare_image.sh -i "$image" -s workers
image_name="$DOCKERHUB_REPO/dr_$image"
fi
# Strip out tag argument.
# shellcheck disable=2001
args_without_tag="$(echo "$@" | sed "s/-t $tag//")"
# shellcheck disable=2086
test_command="$(run_tests_with_coverage --tag="$image" $args_without_tag)"
# Only run interactively if we are on a TTY.
if [ -t 1 ]; then
INTERACTIVE="--interactive"
fi
echo "Running tests with the following command:"
echo "$test_command"
# shellcheck disable=SC2086
docker run \
--add-host=database:"$DB_HOST_IP" \
--env AWS_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY \
--env-file workers/environments/test \
--memory=5G \
--platform linux/amd64 \
--tty \
--volume "$volume_directory":/home/user/data_store \
$INTERACTIVE \
"$image_name:$SYSTEM_VERSION" \
bash -c "$test_command"
fi
done