Skip to content

Commit 0b743f8

Browse files
authored
Merge pull request #20884 from nsoranzo/main_tool_CI_tests
Add main tool CI tests
2 parents dbcf3e3 + 26e6a17 commit 0b743f8

File tree

8 files changed

+96
-20
lines changed

8 files changed

+96
-20
lines changed

.github/workflows/framework_tools.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
uses: actions/cache@v4
6868
with:
6969
path: 'galaxy root/.venv'
70-
key: gxy-venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('galaxy root/requirements.txt') }}-framework-tools
70+
key: gxy-venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('galaxy root/requirements.txt') }}-framework
7171
- name: Run tests
7272
run: ./run_tests.sh --coverage --framework-tools
7373
working-directory: 'galaxy root'
@@ -78,5 +78,5 @@ jobs:
7878
- uses: actions/upload-artifact@v4
7979
if: failure()
8080
with:
81-
name: Framework test results (${{ matrix.python-version }})
81+
name: Tool framework test results (${{ matrix.python-version }})
8282
path: 'galaxy root/run_framework_tests.html'

.github/workflows/framework_workflows.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ on:
55
- 'client/**'
66
- 'doc/**'
77
- 'lib/galaxy_test/selenium/**'
8+
- 'packages/**'
89
pull_request:
910
paths-ignore:
1011
- 'client/**'
1112
- 'doc/**'
1213
- 'lib/galaxy_test/selenium/**'
14+
- 'packages/**'
1315
schedule:
1416
# Run at midnight UTC every Tuesday
1517
- cron: '0 0 * * 2'
@@ -66,16 +68,16 @@ jobs:
6668
uses: actions/cache@v4
6769
with:
6870
path: 'galaxy root/.venv'
69-
key: gxy-venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('galaxy root/requirements.txt') }}-framework-workflows
71+
key: gxy-venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('galaxy root/requirements.txt') }}-framework
7072
- name: Run tests
7173
run: ./run_tests.sh --coverage --framework-workflows
7274
working-directory: 'galaxy root'
7375
- uses: codecov/codecov-action@v3
7476
with:
75-
flags: framework
77+
flags: framework-workflows
7678
working-directory: 'galaxy root'
7779
- uses: actions/upload-artifact@v4
7880
if: failure()
7981
with:
80-
name: Framework test results (${{ matrix.python-version }})
82+
name: Workflow framework test results (${{ matrix.python-version }})
8183
path: 'galaxy root/run_framework_workflows_tests.html'

.github/workflows/main_tools.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Main tool tests
2+
on:
3+
push:
4+
paths-ignore:
5+
- 'client/**'
6+
- 'doc/**'
7+
- 'lib/galaxy_test/selenium/**'
8+
- 'packages/**'
9+
pull_request:
10+
paths-ignore:
11+
- 'client/**'
12+
- 'doc/**'
13+
- 'lib/galaxy_test/selenium/**'
14+
- 'packages/**'
15+
env:
16+
GALAXY_TEST_DBURI: 'postgresql://postgres:postgres@localhost:5432/galaxy?client_encoding=utf8'
17+
GALAXY_TEST_RAISE_EXCEPTION_ON_HISTORYLESS_HDA: '1'
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
jobs:
22+
test:
23+
name: Test
24+
runs-on: ubuntu-latest
25+
strategy:
26+
matrix:
27+
python-version: ['3.9']
28+
services:
29+
postgres:
30+
image: postgres:17
31+
env:
32+
POSTGRES_USER: postgres
33+
POSTGRES_PASSWORD: postgres
34+
POSTGRES_DB: postgres
35+
ports:
36+
- 5432:5432
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
path: 'galaxy root'
41+
persist-credentials: false
42+
- name: Read Node.js version
43+
id: node-version
44+
run: echo "version=$(cat 'galaxy root/client/.node_version')" >> $GITHUB_OUTPUT
45+
- uses: actions/setup-node@v4
46+
with:
47+
node-version: ${{ steps.node-version.outputs.version }}
48+
cache: 'yarn'
49+
cache-dependency-path: 'galaxy root/client/yarn.lock'
50+
- uses: actions/setup-python@v5
51+
with:
52+
python-version: ${{ matrix.python-version }}
53+
cache: 'pip'
54+
cache-dependency-path: 'galaxy root/requirements.txt'
55+
- name: Get full Python version
56+
id: full-python-version
57+
shell: bash
58+
run: echo "version=$(python -c 'import sys; print("-".join(str(v) for v in sys.version_info))')" >> $GITHUB_OUTPUT
59+
- name: Cache galaxy venv
60+
uses: actions/cache@v4
61+
with:
62+
path: 'galaxy root/.venv'
63+
key: gxy-venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('galaxy root/requirements.txt') }}-framework
64+
- name: Run tests
65+
run: ./run_tests.sh --coverage --main_tools
66+
working-directory: 'galaxy root'
67+
- uses: codecov/codecov-action@v3
68+
with:
69+
flags: main-tools
70+
working-directory: 'galaxy root'
71+
- uses: actions/upload-artifact@v4
72+
if: failure()
73+
with:
74+
name: Main tool test results (${{ matrix.python-version }})
75+
path: 'galaxy root/run_framework_tests.html'

tools/filters/gff/gff_filter_by_attribute.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,16 @@
4545
"UnaryOp",
4646
"Invert",
4747
"Not",
48+
"UAdd",
49+
"USub",
4850
"NotIn",
4951
"In",
5052
"Is",
5153
"IsNot",
5254
"List",
5355
"Index",
5456
"Subscript",
57+
"Constant",
5558
"Name",
5659
]
5760

tools/filters/gff/gff_filter_by_feature_count.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,16 @@
4848
"UnaryOp",
4949
"Invert",
5050
"Not",
51+
"UAdd",
52+
"USub",
5153
"NotIn",
5254
"In",
5355
"Is",
5456
"IsNot",
5557
"List",
5658
"Index",
5759
"Subscript",
60+
"Constant",
5861
"Name",
5962
]
6063

tools/filters/gff/gtf_filter_by_attribute_values_list.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ def gff_filter(gff_file, attribute_name, ids_file, output_file):
5555
# Filter GFF file using ids.
5656
with open(output_file, "w") as output, open(gff_file) as ingff:
5757
for line in ingff:
58-
if not line or line.startswith("#"):
58+
if not line.rstrip() or line.startswith("#"):
5959
output.write(line)
6060
continue
6161
fields = line.split("\t")
62+
assert len(fields) == 9, f"Line should have exactly 9 fields: {line}"
6263
attributes = parse_gff_attributes(fields[8])
6364
if attribute_name in attributes and attributes[attribute_name] in ids_dict:
6465
output.write(line)

tools/filters/grep.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
<param name="keep_header" value="true"/>
7777
<output name="out_file1">
7878
<assert_contents>
79-
<not_has_text text="CCDS989.1_cds_0_0_chr1_147962193_r"/>
79+
<has_text text="CCDS989.1_cds_0_0_chr1_147962193_r"/>
80+
<has_n_lines n="1"></has_n_lines>
8081
</assert_contents>
8182
</output>
8283
</test>

tools/phenotype_association/ldtools_wrapper.sh

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
set -e
77

8-
SCRIPT_DIR=$(dirname $0)
8+
SCRIPT_DIR=$(dirname "$0")
99

1010
## pagetag options
1111
input=
@@ -46,16 +46,7 @@ do
4646
done
4747

4848
## run pagetag
49-
python $SCRIPT_DIR/pagetag.py --rsquare $rsquare --freq $freq "$input" snps.txt neighborhood.txt
50-
if [ $? -ne 0 ]; then
51-
echo "failed: pagetag.py --rsquare $rsquare --freq $freq \"$input\" snps.txt neighborhood.txt"
52-
exit 1
53-
fi
54-
55-
## run sentag
56-
python $SCRIPT_DIR/senatag.py neighborhood.txt snps.txt > "$output"
57-
if [ $? -ne 0 ]; then
58-
echo "failed: senatag.py neighborhood.txt snps.txt"
59-
exit 1
60-
fi
49+
python "$SCRIPT_DIR/pagetag.py" --rsquare $rsquare --freq $freq "$input" snps.txt neighborhood.txt
6150

51+
## run senatag
52+
python "$SCRIPT_DIR/senatag.py" neighborhood.txt snps.txt > "$output"

0 commit comments

Comments
 (0)