Skip to content

Commit fbd0685

Browse files
committed
Test CI
1 parent b228997 commit fbd0685

5 files changed

Lines changed: 57 additions & 257 deletions

File tree

.github/workflows/ci-tests.yaml

Lines changed: 17 additions & 254 deletions
Original file line numberDiff line numberDiff line change
@@ -3,209 +3,20 @@ on:
33
push:
44
branches:
55
- master
6+
- debug/blurb
67
pull_request:
78
branches:
89
- master
910
concurrency:
1011
group: build-${{ github.event.pull_request.number || github.ref }}
1112
cancel-in-progress: true
1213
jobs:
13-
code-ql-check:
14-
name: "StreamFlow CodeQL check"
15-
runs-on: ubuntu-24.04
16-
permissions:
17-
security-events: write
18-
steps:
19-
- uses: actions/checkout@v4
20-
- uses: github/codeql-action/init@v3
21-
with:
22-
config-file: .github/codeql/config.yml
23-
languages: python
24-
- uses: github/codeql-action/analyze@v3
25-
cwl-conformance:
26-
name: "CWL conformance tests"
27-
strategy:
28-
matrix:
29-
on: [ "ubuntu-24.04" ]
30-
python: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
31-
version: [ "v1.0", "v1.1", "v1.2" ]
32-
docker: [ "docker" ]
33-
include:
34-
- commit: "1c1f122f780075d910fdfdea7e15e46eef3c078d"
35-
exclude: "docker_entrypoint"
36-
version: "v1.0"
37-
- commit: "6397014050177074c9ccd0d771577f7fa9f728a3"
38-
exclude: "docker_entrypoint,stdin_shorcut,inplace_update_on_file_content"
39-
version: "v1.1"
40-
- commit: "76bdf9b55e2378432e0e6380ccedebb4a94ce483"
41-
exclude: "docker_entrypoint,modify_file_content"
42-
version: "v1.2"
43-
- docker: "singularity"
44-
commit: "76bdf9b55e2378432e0e6380ccedebb4a94ce483"
45-
exclude: "docker_entrypoint,modify_file_content,iwd-container-entryname1"
46-
on: "ubuntu-24.04"
47-
python: "3.13"
48-
version: "v1.2"
49-
- docker: "kubernetes"
50-
commit: "76bdf9b55e2378432e0e6380ccedebb4a94ce483"
51-
exclude: "docker_entrypoint,modify_file_content"
52-
on: "ubuntu-24.04"
53-
python: "3.13"
54-
version: "v1.2"
55-
- on: "macos-13"
56-
python: "3.13"
57-
commit: "76bdf9b55e2378432e0e6380ccedebb4a94ce483"
58-
exclude: "docker_entrypoint,modify_file_content"
59-
version: "v1.2"
60-
runs-on: ${{ matrix.on }}
61-
steps:
62-
- uses: actions/checkout@v4
63-
- uses: actions/setup-python@v5
64-
with:
65-
python-version: ${{ matrix.python }}
66-
cache: pip
67-
cache-dependency-path: |
68-
requirements.txt
69-
test-requirements.txt
70-
- uses: actions/setup-node@v4
71-
with:
72-
node-version: "20"
73-
- name: "Install Docker (MacOS X)"
74-
uses: douglascamata/setup-docker-macos-action@v1-alpha.16
75-
with:
76-
colima-additional-options: '--mount /private/var/folders:w --mount-type virtiofs'
77-
if: ${{ startsWith(matrix.on, 'macos-') }}
78-
- uses: docker/setup-qemu-action@v3
79-
if: ${{ startsWith(matrix.on, 'ubuntu-') }}
80-
- name: "Install Apptainer"
81-
uses: eWaterCycle/setup-apptainer@v2
82-
with:
83-
apptainer-version: 1.3.6
84-
if: ${{ matrix.docker == 'singularity' }}
85-
- name: "Install KinD"
86-
uses: helm/kind-action@v1.12.0
87-
with:
88-
config: .github/kind/config.yaml
89-
kubectl_version: v1.30.3
90-
version: v0.21.0
91-
if: ${{ matrix.docker == 'kubernetes' }}
92-
- name: "Configure Calico on KinD"
93-
run: |
94-
kubectl apply -f https://docs.projectcalico.org/v3.25/manifests/calico.yaml
95-
kubectl -n kube-system set env daemonset/calico-node FELIX_IGNORELOOSERPF=true
96-
if: ${{ matrix.docker == 'kubernetes' }}
97-
- name: "Install StreamFlow"
98-
run: |
99-
python -m pip install . --user
100-
- name: "Test CWL ${{ matrix.version }} conformance"
101-
env:
102-
VERSION: ${{ matrix.version }}
103-
COMMIT: ${{ matrix.commit }}
104-
EXCLUDE: ${{ matrix.exclude }}
105-
DOCKER: ${{ matrix.docker }}
106-
run: ./cwl-conformance-test.sh
107-
- name: "Upload test results"
108-
if: ${{ !cancelled() }}
109-
uses: codecov/test-results-action@v1
110-
with:
111-
flags: ${{ startsWith(matrix.on, 'macos-') && 'macos' || 'ubuntu' }}
112-
token: ${{ secrets.CODECOV_TOKEN }}
113-
- name: "Upload coverage report for conformance tests"
114-
uses: actions/upload-artifact@v4
115-
with:
116-
name: ${{ format('{0}-py{1}-cwl{2}-{3}-conformance-tests', matrix.on, matrix.python, matrix.version, matrix.docker) }}
117-
path: |
118-
./coverage.xml
119-
retention-days: 1
120-
if-no-files-found: error
121-
docker-image:
122-
name: "StreamFlow Docker image tests"
123-
runs-on: ubuntu-24.04
124-
steps:
125-
- uses: actions/checkout@v4
126-
- uses: docker/setup-qemu-action@v3
127-
- uses: docker/setup-buildx-action@v3
128-
- name: "Build Docker image"
129-
uses: docker/build-push-action@v6
130-
with:
131-
build-args: |
132-
HELM_VERSION=v3.17.0
133-
load: true
134-
tags: alphaunito/streamflow:latest
135-
- name: "Run test with Docker"
136-
run: |
137-
mkdir -p "${TMPDIR:-/tmp}"/project "${TMPDIR:-/tmp}"/results "${TMPDIR:-/tmp}"/streamflow
138-
docker run --rm \
139-
--mount type=bind,source="$(pwd)/tests/data/cwl/example",target="/streamflow/project" \
140-
--mount type=bind,source="${TMPDIR:-/tmp}"/results,target="/streamflow/results" \
141-
--mount type=bind,source="${TMPDIR:-/tmp}"/streamflow,target="/tmp/streamflow" \
142-
alphaunito/streamflow:latest \
143-
streamflow run /streamflow/project/streamflow.yml
144-
documentation:
145-
name: "Build Sphinx documentation"
146-
runs-on: ubuntu-24.04
147-
steps:
148-
- uses: actions/checkout@v4
149-
- uses: actions/setup-python@v5
150-
with:
151-
python-version: 3.13
152-
cache: pip
153-
cache-dependency-path: |
154-
docs/requirements.txt
155-
- name: "Install Python Dependencies"
156-
run: |
157-
python -m pip install -r docs/requirements.txt
158-
- name: "Build documentation and check for consistency"
159-
env:
160-
CHECKSUM: "3e5b9b31f71a3ee27e28d5ca66942c50497447f129b7dae7eb8f0ea5f84c39b7"
161-
run: |
162-
cd docs
163-
HASH="$(make checksum | tail -n1)"
164-
echo "Docs checksum is ${HASH}"
165-
test "${HASH}" == "${CHECKSUM}"
166-
test-flux:
167-
runs-on: ubuntu-24.04
168-
permissions:
169-
packages: read
170-
strategy:
171-
fail-fast: false
172-
matrix:
173-
container: ["fluxrm/flux-sched:noble-v0.39.0-amd64"]
174-
container:
175-
image: ${{ matrix.container }}
176-
options: "--platform=linux/amd64 --user root -it"
177-
name: ${{ matrix.container }}
178-
steps:
179-
- name: Make Space
180-
run: |
181-
rm -rf /usr/share/dotnet
182-
rm -rf /opt/ghc
183-
- name: Checkout
184-
uses: actions/checkout@v4
185-
- name: Install Python modules
186-
run: |
187-
apt update
188-
apt install -yq python3-pip python3-venv
189-
su fluxuser
190-
- name: Install StreamFlow
191-
run: |
192-
python3 -m venv /tmp/venv
193-
. /tmp/venv/bin/activate
194-
pip install .
195-
pip install --upgrade --force-reinstall attrs lockfile
196-
which streamflow
197-
- name: Start Flux and Test Workflow
198-
run: |
199-
. /tmp/venv/bin/activate
200-
which streamflow
201-
cd examples/flux
202-
flux start streamflow run streamflow.yml
20314
static-checks:
20415
name: "StreamFlow static checks"
20516
runs-on: ubuntu-24.04
20617
strategy:
20718
matrix:
208-
step: [ "bandit", "lint" ]
19+
step: [ "lint" ]
20920
env:
21021
TOXENV: ${{ matrix.step }}
21122
steps:
@@ -224,18 +35,18 @@ jobs:
22435
python -m pip install . --user
22536
- name: "Run StreamFlow static analysis via Tox"
22637
run: tox
227-
unit-tests:
228-
name: "StreamFlow unit tests"
38+
blurb:
39+
name: "StreamFlow blurb tests"
22940
strategy:
23041
matrix:
23142
on: [ "ubuntu-24.04"]
23243
python: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
233-
include:
234-
- on: "macos-13"
235-
python: "3.13"
44+
retries: ["1", "2", "3", "4", "5", "6"]
23645
runs-on: ${{ matrix.on }}
23746
env:
238-
TOXENV: ${{ format('py{0}-unit', matrix.python) }}
47+
VERSION: "v1.2"
48+
COMMIT: "main"
49+
REPO: "cwl-v1.2"
23950
steps:
24051
- uses: actions/checkout@v4
24152
- uses: actions/setup-python@v5
@@ -248,66 +59,18 @@ jobs:
24859
- uses: actions/setup-node@v4
24960
with:
25061
node-version: "20"
251-
- name: "Install Docker (MacOs X)"
252-
uses: douglascamata/setup-docker-macos-action@v1-alpha.16
253-
with:
254-
colima-additional-options: '--mount /private/var/folders:w --mount-type virtiofs'
255-
if: ${{ startsWith(matrix.on, 'macos-') }}
25662
- uses: docker/setup-qemu-action@v3
25763
if: ${{ startsWith(matrix.on, 'ubuntu-') }}
258-
- name: "Install Apptainer"
259-
uses: eWaterCycle/setup-apptainer@v2
260-
with:
261-
apptainer-version: 1.3.6
262-
if: ${{ startsWith(matrix.on, 'ubuntu-') }}
263-
- name: "Install KinD"
264-
uses: helm/kind-action@v1.12.0
265-
with:
266-
config: .github/kind/config.yaml
267-
kubectl_version: v1.30.3
268-
version: v0.21.0
269-
if: ${{ startsWith(matrix.on, 'ubuntu-') }}
270-
- name: "Configure Calico on KinD"
271-
run: |
272-
kubectl apply -f https://docs.projectcalico.org/v3.25/manifests/calico.yaml
273-
kubectl -n kube-system set env daemonset/calico-node FELIX_IGNORELOOSERPF=true
274-
if: ${{ startsWith(matrix.on, 'ubuntu-') }}
27564
- name: "Install Python Dependencies and StreamFlow"
27665
run: |
27766
python -m pip install tox --user
27867
python -m pip install . --user
279-
- name: "Run StreamFlow tests via Tox"
280-
run: python -m tox
281-
- name: "Upload test results"
282-
if: ${{ !cancelled() }}
283-
uses: codecov/test-results-action@v1
284-
with:
285-
flags: ${{ startsWith(matrix.on, 'macos-') && 'macos' || 'ubuntu' }}
286-
token: ${{ secrets.CODECOV_TOKEN }}
287-
- name: "Upload coverage report for unit tests"
288-
uses: actions/upload-artifact@v4
289-
with:
290-
name: ${{ format('{0}-py{1}-unit-tests', matrix.on, matrix.python) }}
291-
path: |
292-
./coverage.xml
293-
retention-days: 1
294-
if-no-files-found: error
295-
upload-to-codecov:
296-
name: "Codecov report upload"
297-
needs: ["cwl-conformance", "unit-tests"]
298-
runs-on: ubuntu-24.04
299-
steps:
300-
- uses: actions/checkout@v4
301-
- name: "Download conformance tests artifacts"
302-
uses: actions/download-artifact@v4
303-
with:
304-
pattern: "*-conformance-tests"
305-
- name: "Download unit tests artifacts"
306-
uses: actions/download-artifact@v4
307-
with:
308-
pattern: "*-unit-tests"
309-
- name: "Upload coverage to Codecov"
310-
uses: codecov/codecov-action@v5
311-
with:
312-
fail_ci_if_error: true
313-
token: ${{ secrets.CODECOV_TOKEN }}
68+
- name: "Download CWL tests"
69+
run: |
70+
wget "https://github.com/common-workflow-language/${REPO}/archive/${COMMIT}.tar.gz"
71+
tar xzf "${COMMIT}.tar.gz"
72+
- name: "Run blurb"
73+
run: |
74+
cd ${REPO}-${COMMIT}
75+
cwl-runner --version
76+
cwl-runner tests/inpdir_update_wf.cwl tests/empty.json --debug

cwl-conformance-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ mv "${CONFORMANCE_TEST}" "${CONFORMANCE_TEST%".yaml"}.cwltest.yaml"
6464
CONFORMANCE_TEST="${CONFORMANCE_TEST%".yaml"}.cwltest.yaml"
6565

6666
# Build command
67-
TEST_COMMAND="python -m pytest ${CONFORMANCE_TEST} -n auto -rs"
67+
TEST_COMMAND="python -m pytest ${CONFORMANCE_TEST} -n auto -rv"
6868
if [[ -n "${EXCLUDE}" ]] ; then
6969
TEST_COMMAND="${TEST_COMMAND} --cwl-exclude ${EXCLUDE}"
7070
fi

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,7 @@ exclude = "streamflow/cwl/antlr"
119119

120120
[tool.isort]
121121
profile = "black"
122-
skip = "streamflow/cwl/antlr"
122+
skip = "streamflow/cwl/antlr"
123+
124+
[pytest]
125+
addopts = "-v"

streamflow/cwl/step.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,7 @@ async def _update_file_token(
719719
# Build unique destination path
720720
filepath = dst_path or (dst_dir / selected_location.relpath)
721721
if not self.prefix_path:
722+
logger.info(f"src exists -> copy unique: {filepath}")
722723
filepath = cast(CWLWorkflow, self.workflow).get_unique_output_path(
723724
path=filepath, src_location=selected_location
724725
)
@@ -765,6 +766,22 @@ async def _update_file_token(
765766
)
766767
checksum = f"sha1${await loc_path.checksum()}"
767768
if checksum != original_checksum:
769+
logger.info(
770+
f"Checksums are different\n"
771+
f"Checksum expected: {original_checksum}\n"
772+
f"Checksum got: {checksum}"
773+
)
774+
logger.info(f"Data_locations: {len(data_locations)}")
775+
for data_location in data_locations:
776+
logger.info(f"data_location.name: {data_location.name}")
777+
logger.info(f"data_location.path: {data_location.path}")
778+
logger.info(f"location.name: {location.name}")
779+
logger.info(f"filepath: {filepath}")
780+
await asyncio.sleep(2)
781+
new_checksum = f"sha1${await loc_path.checksum()}"
782+
logger.info(
783+
f"Checksum after sleep 2 seconds: {new_checksum}"
784+
)
768785
raise WorkflowExecutionException(
769786
"Error transferring file {} in location {} to {} in location {}".format(
770787
selected_location.path,
@@ -809,6 +826,7 @@ async def _update_file_token(
809826
# Build unique destination path
810827
filepath = dst_path or dst_dir
811828
if not self.prefix_path:
829+
logger.info(f"Create unique: {filepath}")
812830
filepath = cast(CWLWorkflow, self.workflow).get_unique_output_path(
813831
path=filepath
814832
)

0 commit comments

Comments
 (0)