-
Notifications
You must be signed in to change notification settings - Fork 10
140 lines (119 loc) · 5.9 KB
/
test-refgenie-cli.yml
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
name: Test refgenie CLI
on:
push:
branches: [master, dev]
jobs:
test_CLI:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.8]
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dev dependancies
run: if [ -f requirements/requirements-dev.txt ]; then pip install -r requirements/requirements-dev.txt; fi
- name: Install package
run: python -m pip install .
- name: install macOS-specific dependancies
if: startsWith(matrix.os, 'macOS')
run: brew install md5sha1sum
- name: create genomes dir
run: mkdir genomes
- name: refgenie init
working-directory: ./genomes
run: refgenie init -c g.yaml; cat g.yaml
- name: refgenie list
working-directory: ./genomes
run: refgenie list -c g.yaml
- name: refgenie build fasta (parent asset)
run: |
refgenie build -c genomes/g.yaml t7/fasta --files fasta=tests/data/t7.fa.gz --recipe tests/data/recipe_parent.json
./tests/assert_in_file.sh genomes/g.yaml t7 0
./tests/assert_in_file.sh genomes/g.yaml 6c5f19c9c2850e62cc3f89b04047fa05eee911662bd77905 0 # this is a digest that should be produced from this FASTA file
- name: refgenie build fasta_child (child asset)
run: |
refgenie build -c genomes/g.yaml t7/fasta_child --recipe tests/data/recipe_child.json
./tests/assert_in_file.sh genomes/g.yaml fasta_child 0
if [ -L `refgenie seek -c genomes/g.yaml t7/fasta_child` ]; then
echo "`refgenie seek -c genomes/g.yaml t7/fasta_child` exists."
else
echo "Error: `refgenie seek -c genomes/g.yaml t7/fasta_child` does not exist."
exit 1
fi
if [ -d genomes/data/6c5f19c9c2850e62cc3f89b04047fa05eee911662bd77905/fasta_child/default ]; then
echo "'genomes/data/6c5f19c9c2850e62cc3f89b04047fa05eee911662bd77905/fasta_child/default' exists."
else
echo "Error: 'genomes/data/6c5f19c9c2850e62cc3f89b04047fa05eee911662bd77905/fasta_child/default' does not exist."
exit 1
fi
- name: refgenie list
working-directory: ./genomes
run: refgenie list -c g.yaml
- name: refgenie build fasta
run: refgenie build -c genomes/g.yaml t7/fasta --files fasta=tests/data/t7.fa.gz --recipe tests/data/recipe_parent.json
- name: refgenie set aliases
run: |
refgenie alias set -c genomes/g.yaml --aliases t7_new t7_new1 --digest 6c5f19c9c2850e62cc3f89b04047fa05eee911662bd77905
./tests/assert_in_file.sh genomes/g.yaml t7_new 0
./tests/assert_in_file.sh genomes/g.yaml t7_new1 0
if [ -L `refgenie seek -c genomes/g.yaml t7_new/fasta` ]; then
echo "`refgenie seek -c genomes/g.yaml t7_new/fasta` exists."
else
echo "Error: `refgenie seek -c genomes/g.yaml t7_new/fasta` does not exist."
exit 1
fi
if [ -L `refgenie seek -c genomes/g.yaml t7_new1/fasta` ]; then
echo "`refgenie seek -c genomes/g.yaml t7_new1/fasta` exists."
else
echo "Error: `refgenie seek -c genomes/g.yaml t7_new1/fasta` does not exist."
exit 1
fi
- name: refgenie remove aliases
run: |
refgenie alias set -c genomes/g.yaml --aliases t7_another --digest 6c5f19c9c2850e62cc3f89b04047fa05eee911662bd77905
refgenie alias remove -c genomes/g.yaml --aliases t7_new t7_new1 t7 --digest 6c5f19c9c2850e62cc3f89b04047fa05eee911662bd77905
./tests/assert_in_file.sh genomes/g.yaml t7_new 1
./tests/assert_in_file.sh genomes/g.yaml t7_new1 1
./tests/assert_in_file.sh genomes/g.yaml t7_another 0
if [ -L genomes/alias/t7_new/fasta/default/6c5f19c9c2850e62cc3f89b04047fa05eee911662bd77905.fa.gz ]; then
echo "'genomes/alias/t7_new/fasta/default/6c5f19c9c2850e62cc3f89b04047fa05eee911662bd77905.fa.gz' exists."
exit 1
else
echo "Error: 'genomes/alias/t7_new/fasta/default/6c5f19c9c2850e62cc3f89b04047fa05eee911662bd77905.fa.gz' does not exist."
fi
- name: refgenie get aliases
run: |
refgenie alias get -c genomes/g.yaml
- name: refgneie add asset
run: |
refgenie add t7_another/test_asset -c genomes/g.yaml --path ../tests/data --seek-keys '{"recipe": "recipe_parent.json"}'
./tests/assert_in_file.sh genomes/g.yaml test_asset 0
if [ -L `refgenie seek t7_another/test_asset.recipe:default -c genomes/g.yaml` ]; then
echo "`refgenie seek t7_another/test_asset.recipe:default -c genomes/g.yaml` exists."
else
echo "Error: `refgenie seek t7_another/test_asset.recipe:default -c genomes/g.yaml` does not exist."
exit 1
fi
- name: refgenie tag asset
run: |
refgenie tag -c genomes/g.yaml t7_another/fasta_child:default -t new_tag -f
./tests/assert_in_file.sh genomes/g.yaml new_tag 0
if [ -f `refgenie seek t7_another/fasta_child:new_tag -c genomes/g.yaml` ]; then
echo "`refgenie seek t7_another/fasta_child:new_tag -c genomes/g.yaml` exists."
else
echo "Error: `refgenie seek t7_another/fasta_child:new_tag -c genomes/g.yaml` does not exist."
exit 1
fi
- name: refgenie id
run: |
./tests/assert_in_file.sh genomes/g.yaml `refgenie id -c genomes/g.yaml t7_another/fasta_child:new_tag` 0
- name: refgenie remove fasta_child
run: |
refgenie remove -c genomes/g.yaml t7_another/fasta_child -f
./tests/assert_in_file.sh genomes/g.yaml fasta_child 1
./tests/assert_in_file.sh genomes/g.yaml 6c5f19c9c2850e62cc3f89b04047fa05eee911662bd77905/fasta_child:new_tag 1 # test if the entry was removed from the fasta children list