Skip to content

Conversation

@hweej
Copy link
Collaborator

@hweej hweej commented Oct 23, 2025

  1. Adds initial unit test scaffolding for SAMPLESHEET_CHECK and CONVERT_ADAPTIVE nextflow processes.
  2. Also modifies the github actions workflow to run unit tests before the integration test. Since running the pipeline even on the minimal-example takes quite some time before it might fail.
  3. Adds smaller bite-sized testing fixtures to use per-process

Once the scaffolding is set up we can write some unit tests for #60

@github-actions
Copy link

github-actions bot commented Oct 23, 2025

Unit Test Results

10 tests   10 ✅  2m 50s ⏱️
 2 suites   0 💤
 1 files     0 ❌

Results for commit f514062.

♻️ This comment has been updated with latest results.

minimal-example pipeline run. Artifact too large
@hweej hweej requested review from dimalvovs and dltamayo October 23, 2025 21:51
@dimalvovs dimalvovs requested a review from Copilot November 6, 2025 20:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces comprehensive test infrastructure using nf-test for the Nextflow pipeline. The changes add unit tests for core modules (SAMPLESHEET_CHECK and CONVERT_ADAPTIVE), create test fixtures with sample data, and enhance the CI/CD workflow to run automated tests on pull requests.

Key changes:

  • Adds nf-test unit tests for samplesheet validation and Adaptive format conversion modules
  • Creates test fixtures including valid, empty, malformed, and missing-column samplesheets, plus Adaptive TCR data files
  • Restructures GitHub Actions workflow to run separate unit tests and pipeline integration tests with JUnit XML reporting

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/modules/local/samplesheet/samplesheet_check.nf.test Unit tests for samplesheet validation covering valid, empty, malformed, and minimal-example inputs
tests/modules/local/airr_convert/convert_adaptive.nf.test Unit tests for Adaptive format conversion including metadata preservation, gene call validation, and error handling
tests/fixtures/valid_samplesheet.csv Test fixture with valid 4-sample samplesheet data
tests/fixtures/empty_samplesheet.csv Test fixture with header-only samplesheet for edge case testing
tests/fixtures/malformed_samplesheet.csv Test fixture with malformed CSV data for error handling validation
tests/fixtures/missing_columns_samplesheet.csv Test fixture missing required columns for validation testing
tests/fixtures/data/PD1_Patient*.tsv Test fixtures with Adaptive TCR format data subsets for conversion testing
tests/fixtures/data/malformed_adaptive.tsv Malformed Adaptive data for error handling tests
.gitignore Adds nf-test artifacts and output directories to ignore list
.github/workflows/nextflow-test.yaml Refactored CI workflow with separate unit-tests and pipeline-test jobs, adds test result publishing and artifact uploading

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- name: run pipeline
run: nf-test test
- name: Run pipeline test
run: nf-test test tests/main.nf.test --verbose --junitxml=pipeline-test-results.xml
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pipeline-test job generates pipeline-test-results.xml but doesn't have steps to publish or upload these results, unlike the unit-tests job (lines 39-53). Consider adding similar steps to publish and upload the pipeline test results for consistency and better CI/CD visibility.

Suggested change
run: nf-test test tests/main.nf.test --verbose --junitxml=pipeline-test-results.xml
run: nf-test test tests/main.nf.test --verbose --junitxml=pipeline-test-results.xml
- name: Publish pipeline test results
if: always()
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: pipeline-test-results.xml
check_name: Pipeline Test Results
- name: Upload pipeline test results
if: always()
uses: actions/upload-artifact@v4
with:
name: pipeline-test-results
path: |
.nf-test/tests/
pipeline-test-results.xml

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would normally keep the --junitxml resulting artifact from Integration like tests. So in the ideal scenario we should keep this option. BUT, the integration tests here use a relatively large dataset, so the resulting artifact generated by the tests is quite large. Gigabytes in size IIRC.

The correct solution is to use a dataset that is a bit more truncated that the one in the minimal-example

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@dimalvovs dimalvovs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on adding module tests!

There is one copilot comment that looks legit, should we accept proposed changes?

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@dltamayo dltamayo merged commit de65a0b into main Nov 10, 2025
3 checks passed
@dltamayo dltamayo deleted the feature/add-unit-test-scaffolding branch November 10, 2025 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants