scilus / nf-scil

SCIL Nextflow Toolbox
GNU General Public License v3.0
1 stars 17 forks source link

Document test execution with local files #118

Open AlexVCaron opened 3 months ago

AlexVCaron commented 3 months ago

Use-case : a collaborator wants to run tests for a module/subworkflow using local files. It is totally possible and simple to do, using the file class and the path to the files in the local filesystem, e.g. :

local_file1 = file("path/to/local/file.1")
local_file2 = file("path/to/local/file.2")

input = Channel.value( [[id: 'id'], local_file1, local_file2] )

TEST_MODULE( input )

or to only change some files in an existing test :

local_file = file("path/to/local/file.1")

LOAD_TEST_DATA ( ["archive.zip"], "test.load-test-data" )

input = LOAD_TEST_DATA.out.test_data_directory
        .map{ test_data_directory -> [
        [ id: 'id' ],
        file("${test_data_directory}/..."),
        file("${test_data_directory}/..."),
        ...
        local_file
]}

TEST_MODULE( input )

Add this to the documentation.