Update run_differential.sh #651
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: 'release' | |
| # The test suite is deliberately dependency-free: base R only, no | |
| # Bioconductor. That is what makes this job take a minute instead of | |
| # fifteen, and what lets the label and spectral cores be checked on any | |
| # machine without an install step. | |
| - name: Unit tests | |
| run: | | |
| Rscript tests/test_labels.R | |
| Rscript tests/test_spectrum.R | |
| Rscript tests/test_condition_invariants.R | |
| Rscript tests/test_differential.R | |
| # End-to-end run on synthetic data with a known injected peak: catches | |
| # regressions that unit tests cannot, such as a stage writing a schema the | |
| # next stage does not read. | |
| # Every stage is invoked through the real CLI, not through the test | |
| # harness: a module missing from the load path fails here and nowhere | |
| # else, because the unit tests source what they need explicitly. | |
| # Paths are supplied because config/project.R has no defaults and a dry | |
| # run's whole output is where it would read and write. This step used to | |
| # omit them and started failing the moment the defaults were removed -- | |
| # the workflow lagged the policy change, which is what CI is for. | |
| - name: CLI reaches every stage | |
| env: | |
| TSF_GEO_DIR: data | |
| TSF_INTERIM_DIR: interim | |
| TSF_RESULTS_DIR: results | |
| run: | | |
| ./tsf --help > /dev/null | |
| for s in ingest spectra maxt condition consensus clean stability peaks compare; do | |
| ./tsf run --to "$s" --dry-run > /dev/null || exit 1 | |
| done | |
| # Each command must ask only for the paths it uses. `fetch` downloads and | |
| # has no results tree; demanding one is a false requirement. | |
| - name: Path requirements are per command | |
| run: | | |
| # fetch needs geo_dir and nothing else. | |
| ./tsf fetch --geo-dir data --dry-run > /dev/null | |
| # run needs all three, and must say so rather than failing later. | |
| if ./tsf run --to ingest --dry-run > /dev/null 2>&1; then | |
| echo "run should require paths and did not"; exit 1 | |
| fi | |
| ./tsf run --to ingest --dry-run 2>&1 | grep -q -- "--interim-dir" \ | |
| || { echo "the error should name the missing flag"; exit 1; } | |
| - name: Self-check | |
| env: | |
| TSF_MAXT_B: '100' | |
| TSF_CONDITION_B: '500' | |
| run: ./tsf selfcheck |