Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 4 additions & 5 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ jobs:
- name: Install sophios 🔧
run: |
pip install .[test]
# The tests marked package and the Nextflow tests that do not run
# Nextflow: no other pull-request lane runs them.
# Every test but those marked nextflow (no Nextflow here), cwl_corpus
# (no corpus checkout) or skip_pypi_ci: Lint And Test and Run
# Workflows run those.
- name: Test with pytest
run: |
python -m pytest -m "package and not nextflow and not skip_pypi_ci" -vv
python -m pytest tests/core/nextflow -m "not nextflow and not nextflow_corpus and not skip_pypi_ci" -vv
run: python -m pytest -m "not skip_pypi_ci and not nextflow and not cwl_corpus" -vv

- name: Build sophios
run: |
Expand Down
57 changes: 15 additions & 42 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,24 +229,15 @@ jobs:

# NOTE: Do NOT add coverage to PYPY CI runs https://github.com/tox-dev/tox/issues/2252

- name: PyTest CWL Embedding Independence
# Every corpus workflow compiled once and checked in every form the inline
# flags give: no Sophios key or tool-only field in what is emitted, each
# subworkflow as it compiles alone (the isomorphism check MUST run in
# serial), and the flat and embedded forms meaning what the nested form
# does; on POSIX, cwltool validates every form. cwltool would find each
# defect only in run_workflows, behind a container pull.
- name: PyTest CWL Corpus Forms
if: ${{ !cancelled() && steps.setup.outcome == 'success' && steps.corpus.outcome == 'success' }}
run: cd sophios/ && pytest -k test_cwl_embedding_independence # --cov --cov-config=.coveragerc_serial
# NOTE: This test MUST be run in serial! See is_isomorphic_with_timeout()
timeout-minutes: 20 # backup timeout for windows

# Two defect classes cwltool already catches -- a Sophios key written
# into `in:`, and a promoted port carrying a tool-only `inputBinding` --
# but only in run_workflows, behind a container pull. Measured at 21s
# over the full corpus here, against the minutes that round trip costs.
- name: PyTest Emitted CWL Residue
if: ${{ !cancelled() && steps.setup.outcome == 'success' && steps.corpus.outcome == 'success' }}
run: cd sophios/ && pytest -k test_emitted_cwl_says_nothing_cwl_cannot_read
timeout-minutes: 20 # backup timeout for windows

- name: PyTest Inline Flags
if: ${{ !cancelled() && steps.setup.outcome == 'success' && steps.corpus.outcome == 'success' }}
run: cd sophios/ && pytest tests/core/test_examples.py -k "test_embedding_keeps or test_flatten" # --cov --cov-config=.coveragerc_serial
run: cd sophios/ && pytest tests/core/test_examples.py -k "test_corpus_ and not weekly_corpus" # --cov --cov-config=.coveragerc_serial
timeout-minutes: 20 # backup timeout for windows

# Entry-point resolution and CI coverage. The core/contrib import boundary
Expand All @@ -265,35 +256,17 @@ jobs:
- name: PyTest Environment-Dependent
if: ${{ !cancelled() && steps.setup.outcome == 'success' }}
timeout-minutes: 20
run: cd sophios/ && pytest tests/core/test_predicates.py tests/core/test_leak_boundary.py tests/core/test_lang_version.py tests/core/test_lang_parser.py tests/core/test_hermeticity.py -m "skip_pypi_ci"

# The oracle suite: the generators, the equivalence relation and the
# suite's own hermeticity checks. Its own step, so a red build is
# attributable to a zone without bisecting. It needs nothing this matrix
# lacks: no plugins, no containers, no corpus.
#
# skip_pypi_ci excludes the per-stem `cwltool --validate` cases, for the
# reason the contrib step gives below.
- name: PyTest Oracle
if: ${{ !cancelled() && steps.setup.outcome == 'success' }}
run: cd sophios/ && pytest tests/core/test_hermeticity.py tests/core/test_generators.py tests/core/test_equivalence.py tests/core/test_equivalences.py -m "not skip_pypi_ci"

# The front end's opinion of the documents the
# compiler manufactures. Its own step because a red build here means the
# compiler emitted something the language refuses — a different fact from
# a property failing, and one worth reading without bisecting. ~3s.
- name: PyTest Manufactured Documents
if: ${{ !cancelled() && steps.setup.outcome == 'success' }}
run: cd sophios/ && pytest tests/core/test_manufactured_documents.py
run: cd sophios/ && pytest tests/core/test_predicates.py tests/core/test_leak_boundary.py tests/core/test_lang_version.py tests/core/test_lang_parser.py -m "skip_pypi_ci"

# Phase contracts plus the composed
# pipeline. It does not assert that a retired name has stayed retired --
# a deleted symbol coming back is a review failure, and a test that
# names one can only ever restate its own deletion.
# Phase contracts, the laws every compile keeps, and the compiler judged on
# example workflows in files: what each compiles to on every leg, and what
# cwltool runs each to on POSIX. It does not assert that a retired name has
# stayed retired -- a deleted symbol coming back is a review failure, and a
# test that names one can only ever restate its own deletion.
- name: PyTest IR Phases
if: ${{ !cancelled() && steps.setup.outcome == 'success' }}
timeout-minutes: 30
run: cd sophios/ && pytest tests/core/test_lower.py tests/core/test_emit.py tests/core/test_resolve.py tests/core/test_link.py tests/core/test_infer_phase.py tests/core/test_pipeline.py
run: cd sophios/ && pytest tests/core/test_lower.py tests/core/test_emit.py tests/core/test_resolve.py tests/core/test_infer_phase.py tests/core/test_compiler.py

# The Python API surfaces that used to be example scripts nothing executed:
# `search_paths_wic` reaches the corpus repositories and docs/tutorials,
Expand Down
25 changes: 8 additions & 17 deletions .github/workflows/lint_and_test_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,13 @@ jobs:

# NOTE: Do NOT add coverage to PYPY CI runs https://github.com/tox-dev/tox/issues/2252

- name: PyTest CWL Embedding Independence
# Every corpus workflow compiled once and checked in every form the inline
# flags give: no Sophios key or tool-only field in what is emitted, each
# subworkflow as it compiles alone (the isomorphism check MUST run in
# serial), and the flat and embedded forms meaning what the nested form
# does; on POSIX, cwltool validates every form. cwltool would find each
# defect only in run_workflows, behind a container pull.
- name: PyTest CWL Corpus Forms
if: ${{ !cancelled() && steps.setup.outcome == 'success' && steps.corpus.outcome == 'success' }}
run: cd sophios/ && pytest -k test_cwl_embedding_independence # --cov --cov-config=.coveragerc_serial
# NOTE: This test MUST be run in serial! See is_isomorphic_with_timeout()
timeout-minutes: 20 # backup timeout for windows

# Two defect classes cwltool already catches -- a Sophios key written
# into `in:`, and a promoted port carrying a tool-only `inputBinding` --
# but only in run_workflows, behind a container pull. Measured at 21s
# over the full corpus here, against the minutes that round trip costs.
- name: PyTest Emitted CWL Residue
if: ${{ !cancelled() && steps.setup.outcome == 'success' && steps.corpus.outcome == 'success' }}
run: cd sophios/ && pytest -k test_emitted_cwl_says_nothing_cwl_cannot_read
timeout-minutes: 20 # backup timeout for windows

- name: PyTest Inline Flags
if: ${{ !cancelled() && steps.setup.outcome == 'success' && steps.corpus.outcome == 'success' }}
run: cd sophios/ && pytest tests/core/test_examples.py -k "test_embedding_keeps or test_flatten" # --cov --cov-config=.coveragerc_serial
run: cd sophios/ && pytest tests/core/test_examples.py -k "test_corpus_ and not weekly_corpus" # --cov --cov-config=.coveragerc_serial
timeout-minutes: 20 # backup timeout for windows
15 changes: 5 additions & 10 deletions .github/workflows/property_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,17 @@ jobs:
id: setup
run: 'true'

# The oracle suite (tests/core/test_hermeticity.py::ORACLE_FILES) and the
# The oracle suite (tests/core/hermetic.py::ORACLE_FILES) and the
# phase properties beside it, slow ones included: the `--validate`
# property is slow-marked, and deepening it is the point of this lane.
# test_leak_boundary.py's other tests compile against a discovered
# registry, so its five hermetic properties are named.
# test_leak_boundary.py's other test compiles against a discovered
# registry, so its hermetic property is named.
- name: PyTest Oracle and Phase Properties
if: ${{ !cancelled() && steps.setup.outcome == 'success' }}
timeout-minutes: 180
run: >-
pytest tests/core/test_generators.py tests/core/test_equivalence.py tests/core/test_equivalences.py tests/core/test_predicates.py tests/core/test_reference_compatibility.py tests/core/test_canonical_path.py tests/core/test_emit.py tests/core/test_resolve.py tests/core/test_link.py tests/core/test_infer_phase.py tests/core/test_cwl_version.py tests/core/test_names_emitted.py tests/core/test_edge_binding.py tests/core/test_lower.py tests/core/test_pipeline.py
tests/core/test_leak_boundary.py::test_step_passthrough_is_byte_identical
tests/core/test_leak_boundary.py::test_top_level_passthrough_is_byte_identical
tests/core/test_leak_boundary.py::test_hints_survive_on_the_document_and_the_step_and_change_nothing_else
tests/core/test_leak_boundary.py::test_unknown_keys_change_nothing_else
tests/core/test_leak_boundary.py::test_no_key_lands_on_both_sides
pytest tests/core/test_predicates.py tests/core/test_reference_compatibility.py tests/core/test_canonical_path.py tests/core/test_emit.py tests/core/test_resolve.py tests/core/test_infer_phase.py tests/core/test_edge_binding.py tests/core/test_lower.py
tests/core/test_leak_boundary.py::test_freight_survives_byte_for_byte_and_changes_nothing_else
--hypothesis-seed="$HYPOTHESIS_SEED" --junitxml=property-reports/oracle.xml

# The language layer's properties. Its skip_pypi_ci tests compile against
Expand All @@ -118,7 +114,6 @@ jobs:
run: >-
pytest tests/core/test_input_output.py tests/core/test_runtime_inputs.py tests/core/test_python_api_tool_builder.py
tests/core/test_python_api_inference.py::test_an_inference_is_refused_at_construction_or_keeps_what_it_was_given
tests/core/test_python_api_workflow.py::test_python_api_uses_the_conservative_language_judgment
tests/core/test_python_api_workflow.py::test_a_diagnostic_names_the_python_line_that_made_its_object
tests/core/test_python_api_workflow.py::test_a_built_tool_is_one_step_through_every_door
tests/core/test_realtime.py::test_a_declaration_is_returned_instead_of_emitted_or_is_wic044_at_each_port
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ jobs:
# One compile and a round of docker pulls per corpus workflow, mostly
# waiting on the registry: 2.2 min in series, so it gets the same
# workers as the runs that follow it.
run: cd sophios/ && pytest tests/core/test_examples.py -k test_cwl_docker_extract --workers "${PYTEST_WORKERS}" --durations=0
run: cd sophios/ && pytest tests/core/test_examples.py -k test_cwl_docker_extract -n "${PYTEST_WORKERS}" --durations=0
# For self-hosted runners, make sure the docker cache is up-to-date.

- name: PyTest Tool Builder
Expand All @@ -240,7 +240,7 @@ jobs:

- name: PyTest Run Workflows
if: ${{ !cancelled() && steps.setup.outcome == 'success' && steps.corpus.outcome == 'success' }}
run: cd sophios/ && pytest tests/core/test_examples.py -k test_run_workflows_on_push --workers "${PYTEST_WORKERS}" --cwl_runner cwltool --durations=0 # --cov
run: cd sophios/ && pytest tests/core/test_examples.py -k test_run_workflows_on_push -n "${PYTEST_WORKERS}" --cwl_runner cwltool --durations=0 # --cov

# The corpus workflows the Nextflow target supports, compiled with it and
# run under Nextflow with Docker: tests/core/nextflow/test_corpus.py. The
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/run_workflows_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ jobs:
- name: PyTest Run Workflows (On Push)
if: ${{ !cancelled() && steps.setup.outcome == 'success' && steps.corpus.outcome == 'success' }}
# NOTE: Do NOT add coverage to PYPY CI runs https://github.com/tox-dev/tox/issues/2252
run: cd sophios/ && pytest -k test_run_workflows_on_push --workers 8 --cwl_runner toil-cwl-runner --durations=0 # --cov
run: cd sophios/ && pytest -k test_run_workflows_on_push -n 8 --cwl_runner toil-cwl-runner --durations=0 # --cov

- name: Disk usage (after workflows (on push))
if: ${{ !cancelled() && steps.setup.outcome == 'success' }}
Expand All @@ -196,7 +196,7 @@ jobs:
- name: PyTest Run Inlined Workflows (On Push)
if: ${{ !cancelled() && steps.setup.outcome == 'success' && steps.corpus.outcome == 'success' }}
# NOTE: Do NOT add coverage to PYPY CI runs https://github.com/tox-dev/tox/issues/2252
run: cd sophios/ && pytest -k test_run_inlined_workflows_on_push --workers 8 --cwl_runner toil-cwl-runner --durations=0 # --cov
run: cd sophios/ && pytest -k test_run_inlined_workflows_on_push -n 8 --cwl_runner toil-cwl-runner --durations=0 # --cov

- name: Disk usage (after inlined (on push))
if: ${{ !cancelled() && steps.setup.outcome == 'success' }}
Expand All @@ -209,7 +209,7 @@ jobs:
- name: PyTest Run Workflows (Weekly)
if: ${{ !cancelled() && steps.setup.outcome == 'success' && steps.corpus.outcome == 'success' }}
# NOTE: Do NOT add coverage to PYPY CI runs https://github.com/tox-dev/tox/issues/2252
run: cd sophios/ && pytest -k test_run_workflows_weekly --workers 8 --cwl_runner toil-cwl-runner --durations=0 # --cov
run: cd sophios/ && pytest -k test_run_workflows_weekly -n 8 --cwl_runner toil-cwl-runner --durations=0 # --cov

# The flat and the embedded forms of the weekly workflows, checked at
# compile time; the pull-request lanes skip these workflows as large.
Expand All @@ -224,12 +224,12 @@ jobs:

- name: PyTest Inline Forms Keep Meaning (Weekly)
if: ${{ !cancelled() && steps.setup.outcome == 'success' && steps.corpus.outcome == 'success' }}
run: cd sophios/ && pytest tests/core/test_examples.py -k test_weekly_corpus
run: cd sophios/ && pytest tests/core/test_examples.py -k weekly_corpus

- name: PyTest Run Inlined Workflows (Weekly)
if: ${{ !cancelled() && steps.setup.outcome == 'success' && steps.corpus.outcome == 'success' }}
# NOTE: Do NOT add coverage to PYPY CI runs https://github.com/tox-dev/tox/issues/2252
run: cd sophios/ && pytest -k test_run_inlined_workflows_weekly --workers 8 --cwl_runner toil-cwl-runner --durations=0 # --cov
run: cd sophios/ && pytest -k test_run_inlined_workflows_weekly -n 8 --cwl_runner toil-cwl-runner --durations=0 # --cov

- name: Disk usage (after inlined (weekly))
if: ${{ !cancelled() && steps.setup.outcome == 'success' }}
Expand Down
14 changes: 7 additions & 7 deletions design_docs/one-target-table-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ the pointer nor the file stays:
- nothing in the docs promised it: `docs/cli-reference.md`, `docs/running.md` and `docs/checks-and-errors.md` name
`error_<workflow>.txt` only for a failure Sophios did not expect, and `docs/nextflow.md` named it nowhere;
- one test pinned it, `test_nextflow_cli_conversion_error_is_concise_and_actionable`, now folded into
`test_a_refusal_is_reported_on_stderr_as_a_diagnostic`, which keeps its point: a refusal leaves none of the four
`tests/core/nextflow/test_public_api.py`, which keeps its point: a refusal leaves none of the four
files an earlier write left;
- a refusal is a reported problem, which exit 1 already describes as "its diagnostics are on stderr"; the file is
for a traceback, and a refusal has none. The crash handler keeps its `error_<stem>.txt`.
Expand Down Expand Up @@ -191,10 +191,10 @@ released; when Nextflow learns a construct its code is retired and its row says
is refused for its type (`nf-s048`) too, and an array step output is refused at its producer (`nf-s031`).
`nf-s007`, a `nested_crossproduct` result read by a later step: two scattered inputs make an array of arrays, which
the reading port must declare (`nf-s048`) or Link refuses (`wic023`), and one scattered input is a `dotproduct`,
which lowers (`tests/core/data/nextflow/rejected/scatter.yaml`, `a_nested_crossproduct_result_read_by_a_later_step`).
which lowers (`tests/core/data/nextflow/refused/scatter`, step `reads_pairs`).
Each stays its own code: the scatter is its own construct, and a target that learns nested arrays still refuses it.

**The list** is `docs/error_codes.md`; `test_the_error_codes_page_says_what_the_code_says` keeps it equal to the
**The list** is `docs/error_codes.md`; `tests/core/test_diagnostics.py` keeps it equal to the
catalog. A source written as text has two codes: `nf-s027`, a nested call's output, valid CWL as
`tests/core/data/python_api_pairs/re_export.wic` shows; `nf-s028`, a step that is not there, the document's mistake.

Expand All @@ -220,14 +220,14 @@ Refusals a case still reaches stay, coded, and so do the listing checks a tool w

## 7. Tests, and what was measured

Every rejected case (`tests/core/data/nextflow/rejected/*.yaml`) names its refusals' codes in order, and new cases
reach each code and each family of §5 no case reached. Other tests pin the table against `--target` and the
Every refused family (`tests/core/data/nextflow/refused/<family>`) names its refusals' codes in order, and new
cases reach each code and each family of §5 no case reached. Other tests pin the table against `--target` and the
`Literal`, an unknown target, a refusal's layout from Python and the command line, `check()` returning refusals,
`--explain nf-s007`, and `--allow_raw_cwl` under Nextflow.

- Expectations whose text D changes by design: a workflow input of a type the target does not lower names the type
(`scatter_over_an_array_typed_port`, `scatter_over_a_non_array_workflow_input`); a `when` that is text is
`wic056`'s wording (`tests/core/data/when_boolean.yaml`); the made-input test and the no-inputs `when` test read
`wic056`'s wording (`tests/core/data/compiler/when`); the made-input test and the no-inputs `when` test read
the diagnostic.

**Measured.** The byte harness, taught that from D on only a `NotLowered` is a refusal and any other `ValueError` a
Expand All @@ -254,7 +254,7 @@ Literal["cwl", "nextflow"]`; `--target` and every other flag; `NotLowered` a `Va
value is not the text it stands for) and `nf-s055` (CWL cwltool would not run) are the workflow's problems, which
under `--target cwl` the compile writes and the runner meets. Kept as nf-s codes of kind `document`: only the
Nextflow target reads those fields closely enough to find them. `SophiosErrorCode.is_language` counts them with
the `wic` codes, as describing the document, which `test_every_code_is_explained` holds kind `document` to.
the `wic` codes, as describing the document, which `tests/core/test_diagnostics.py` holds kind `document` to.
Moving them to `wic` codes for both targets would make CWL compiles that succeed today fail, and for `nf-s028` it
would stop `re_export.wic`'s valid shape too.
2. **`nf-s011`**, a `when` reading an input its step does not bind, stays kind `target`: cwltool reads `undefined`,
Expand Down
4 changes: 2 additions & 2 deletions docs/dev/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ real-time declarations.
An idempotent completion step, run before Link and again after Infer, materialises emission
facts already decided (boundary spellings, source strings); it looks nothing
up and decides nothing. The phases are tested one by one (`tests/core/test_resolve.py`,
`test_lower.py`, `test_link.py`, `test_infer_phase.py`, `test_emit.py`) and
together (`test_pipeline.py`).
`test_lower.py`, `test_infer_phase.py`), together by the laws of `test_emit.py`, and
on example workflows in files (`tests/core/data/examples`, `tests/core/data/compiler`).

## Names

Expand Down
Loading
Loading