Skip to content

Commit 74d982d

Browse files
committed
record coverage while running the conformance tests
1 parent 3439627 commit 74d982d

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

.coveragerc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[run]
22
branch = True
3-
source = cwlupgrader
3+
source_pkgs = cwlupgrader
4+
omit =
5+
tests/*
6+
*/site-packages/cwlupgrader/tests/*
47

58
[report]
69
exclude_lines =

.github/workflows/ci-tests.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,16 @@ jobs:
123123
- name: Set up Python
124124
uses: actions/setup-python@v6
125125
with:
126-
python-version: 3.12
126+
python-version: 3.14
127127
cache: pip
128-
129128
- name: "Test upgrading CWL conformance tests & running them"
130129
run: ./conformance-test.sh
130+
- name: Upload coverage to Codecov
131+
uses: codecov/codecov-action@v5
132+
with:
133+
fail_ci_if_error: true
134+
token: ${{ secrets.CODECOV_TOKEN }}
135+
131136

132137
release_test:
133138
name: cwl-upgrader release test
@@ -139,7 +144,7 @@ jobs:
139144
- name: Set up Python
140145
uses: actions/setup-python@v6
141146
with:
142-
python-version: 3.12
147+
python-version: 3.14
143148
cache: pip
144149
cache-dependency-path: |
145150
requirements.txt

conformance-test.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,24 @@ fi
8484

8585
CONFORMANCE_TEST1="${SCRIPT_DIRECTORY}/common-workflow-language-main/v1.0/conformance_test_v1_0_to_v1_1.yaml"
8686
CONFORMANCE_TEST2="${SCRIPT_DIRECTORY}/common-workflow-language-main/v1.0/conformance_test_v1_0_to_v1_2.yaml"
87+
COVBASE="coverage run --append --rcfile=${SCRIPT_DIRECTORY}/.coveragerc --data-file=${SCRIPT_DIRECTORY}/.coverage -m cwlupgrader"
8788

8889
pushd "${SCRIPT_DIRECTORY}"/common-workflow-language-main/v1.0
8990
cp -r v1.0 v1.1
9091
cp -r v1.0 v1.2
9192
rm v1.1/*.cwl
9293
rm v1.2/*.cwl
9394
set +x
94-
pushd v1.0 ; cwl-upgrader --v1.1-only --dir ../v1.1 --always-write ./*.cwl; popd
95-
pushd v1.0 ; cwl-upgrader --dir ../v1.2 --always-write ./*.cwl; popd
95+
pushd v1.0 ; $COVBASE --v1.1-only --dir ../v1.1 --always-write ./*.cwl; popd
96+
pushd v1.0 ; $COVBASE --dir ../v1.2 --always-write ./*.cwl; popd
9697
set -x
9798
cp conformance_test_v1.0.yaml "${CONFORMANCE_TEST1}"
9899
cp conformance_test_v1.0.yaml "${CONFORMANCE_TEST2}"
99100
sed -i 's=v1.0/=v1.1/=g' "${CONFORMANCE_TEST1}"
100101
sed -i 's=v1.0/=v1.2/=g' "${CONFORMANCE_TEST2}"
101102
popd
103+
coverage report
104+
coverage xml
102105

103106
cp "${CONFORMANCE_TEST1}" "${CONFORMANCE_TEST1%".yaml"}.cwltest.yaml"
104107
CONFORMANCE_TEST1="${CONFORMANCE_TEST1%".yaml"}.cwltest.yaml"
@@ -114,7 +117,7 @@ if [[ -n "${EXCLUDE}" ]] ; then
114117
EXCLUDE_COMMAND="--cwl-exclude=${EXCLUDE}"
115118
fi
116119

117-
pushd $(dirname "${CONFORMANCE_TEST1}")
120+
pushd "$(dirname "${CONFORMANCE_TEST1}")"
118121
set +e
119122
python3 -m pytest "${CONFORMANCE_TEST1}" -n auto -rs --junit-xml="${SCRIPT_DIRECTORY}"/cwltool_v1.0_to_v1.1_"${CONTAINER}".xml -o junit_suite_name=cwltool_$(echo "${CWLTOOL_OPTIONS}" | tr "[:blank:]-" _) ${EXCLUDE_COMMAND} ; RETURN_CODE1=$?
120123

cwlupgrader/__main__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Default entry point for the cwl-upgrader module."""
2+
3+
import sys
4+
5+
from . import main
6+
7+
sys.exit(main.main())

0 commit comments

Comments
 (0)