GithubHelp home page GithubHelp logo

Module tests about modules HOT 4 CLOSED

drpatelh avatar drpatelh commented on July 28, 2024
Module tests

from modules.

Comments (4)

sven1103 avatar sven1103 commented on July 28, 2024

I think we have to distinguish between a module/process test and documentation. Maybe an own issue for docs?

Regarding module tests: You can think of a module as a set of processes and functions. Each process and function has a particular responsibility. Both consume input data as arguments, execute a task, and can return an output. And it would be nice to test if such a unit executes as expected. That is the fundamental idea of a Unit Test :)

So ideally, a module has a corresponding module test suite, that does exactly that:

  1. It sets up the environment and set up the preconditions for the unit (here a Nextflow process or function) (given)
  2. It executes the unit (the process or function) (when)
  3. It checks assertions about the expected behaviour (then)

How can this look like? Assume we have a module file myModule.nf that contains a process myProcess(). A Test Suite could be a file myModuleTest.nf that actually includes the process from myModule.nf and correctly sets up the environment (linking a container, defines URLs to source data, etc.). Assertions could be realised by just routing the output from the process of interest to an assertionProcess() and check the output there. This process should fail, if at least one assertion was false.

Maybe we can just set up a proof-of-concept test for one of your modules, and see if this works out?

from modules.

ewels avatar ewels commented on July 28, 2024

Need to think about where we keep test data and how it is organised.

Suggestion: still use nf-core/test-data but reorganise. Keep everything in one branch, have a set of data under common that can be used by multiple tools. Stuff that is specific to a single tool can then go in subdirectories that mirror nf-core/modules.

from modules.

edmundmiller avatar edmundmiller commented on July 28, 2024

So can we consider this one closed now that we've got so many tests we hit the GitHub actions limit?

from modules.

drpatelh avatar drpatelh commented on July 28, 2024

I think we can indeed 😁 🎉

from modules.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.