Skip to content

Commit

Permalink
Update README.md (#21)
Browse files Browse the repository at this point in the history
Improved language in README.md
  • Loading branch information
adamrtalbot committed Jan 29, 2024
1 parent 4a9ef1b commit 03779fe
Showing 1 changed file with 37 additions and 33 deletions.
70 changes: 37 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,47 @@

# :bird: nf-canary

A minimal Nextflow workflow for testing infrastructure.
A lightweight Nextflow workflow designed for testing infrastructure.

## Introduction

After setting up and deploying your infrastructure, you may need to test you can effectively run a Nextflow pipeline. Common issues include network problems, permissions and invalid paths. The aim of this pipeline is to run through a set of standard tasks and confirm they are able to work. By using simple tasks which test as few things as possible, we can isolate individual any problems that may be occurring and fix them.
After configuring and deploying your infrastructure, validating the functionality of a Nextflow pipeline is crucial. Common issues include network problems, permission discrepancies, and invalid paths. The purpose of this pipeline is to execute a series of straightforward tasks to ensure they function properly. By employing simple tasks that test specific functionalities, we can pinpoint and resolve individual issues effectively.

This pipeline aims to be as simple as possible. Therefore it comes with no additional configuration and the user will need to configure the run for their own infrastructure.
This pipeline is intentionally minimalistic, arriving with no additional configuration. Users are required to tailor the run settings to their specific infrastructure.

All tests are in the `main.nf` file and aim to be as simple and legible as possible. If it is difficult to understand a test, please raise an issue.
All tests are consolidated in the `main.nf` file, prioritizing simplicity and readability. If any test is challenging to comprehend, please raise an issue.

## Usage

### Running locally
### Running Locally

To run locally, you can simply run:
To execute locally, use the following command:

```
```bash
nextflow run seqeralabs/nf-canary
```

This will execute on your local machine with default settings. All tests should pass here. If they do not something is incorrect about your Nextflow installation or configuration.
This will run on your local machine with default settings. Successful execution of all tests indicates a correctly configured Nextflow installation. Any failures suggest potential issues with your configuration.

### Running on your infrastructure
### Running on Your Infrastructure

Add the configuration for your infrastructure using the relevant configuration files as listed in [the Nextflow documentation](https://www.nextflow.io/docs/latest/config.html). You can then run the same pipeline but with the additional configuration to run on your set up.
Configure your infrastructure using the appropriate configuration files listed in [the Nextflow documentation](https://www.nextflow.io/docs/latest/config.html). Run the pipeline with the additional configuration to execute it on your setup.

### Output directory
### Output Directory

nf-canary uses the `--outdir` convention established by [nf-core](https://nf-co.re/) to select where to publish the output files. If not specified, the output files are written to the work directory under a subfolder `outputs`.
nf-canary adheres to the `--outdir` convention established by [nf-core](https://nf-co.re/) to determine the output file destination. If not specified, output files are written to the work directory under a subfolder named `outputs`.

### Skipping Tests

Each test can be skipped by name with the parameter `--skip`, e.g. `--skip TEST_INPUT`. Multiple test can be specified with comma delimited values, e.g. `--skip TEST_CREATE_FILE,TEST_PASS_FILE`. Case insensitive.
Skip individual tests by name using the `--skip` parameter, e.g., `--skip TEST_INPUT`. Multiple tests can be specified with comma-delimited values, e.g., `--skip TEST_CREATE_FILE,TEST_PASS_FILE`. The parameter is case-insensitive.

### Selectively running tests
### Selectively Running Tests

By default, all tests are ran, however you can selectively run a test with `--run`, e.g. `--run TEST_INPUT`. When using this parameter, _only_ the tests selected will be run. Multiple test can be specified with comma delimited values, e.g. `--run TEST_CREATE_FILE,TEST_PASS_FILE`. Case insensitive.
By default, all tests are executed. However, you can selectively run a specific test with the `--run` parameter, e.g., `--run TEST_INPUT`. When using this parameter, only the selected tests will run. Multiple tests can be specified with comma-delimited values, e.g., `--run TEST_CREATE_FILE,TEST_PASS_FILE`. Case insensitive.

### Note on test dependency
### Note on Test Dependency

Note, some tests depend on previous tests running so will be skipped if an upstream test does not run (or fails). All tests which are dependent on previous tests are listed here:
Certain tests depend on the successful execution of previous tests and will be skipped if an upstream test fails. The dependencies for each test are listed below:

```yaml
TEST_CREATE_FILE:
Expand All @@ -51,68 +51,72 @@ TEST_CREATE_FOLDER:
- TEST_PASS_FOLDER
```
### Interpreting the results
### Interpreting the Results
The code for each test includes a short comment explaining what it is aiming to test. If it fails, check the comment for what it was trying to achieve and compare that to the error message reported by Nextflow.
Each test includes a brief comment explaining its purpose. In case of failure, review the comment to understand the intended outcome and compare it to the error message reported by Nextflow.
## Test Overview
### `TEST_SUCCESS`

This process should automatically succeed with exit status 0.
This process should succeed automatically with exit status 0.

### `TEST_CREATE_FILE`

This process should create a file on the worker machine then move it to the working directory.
This process creates a file on the worker machine and then moves it to the working directory.

### `TEST_CREATE_FOLDER`

This process should create a folder in the working directory.
This process creates a folder in the working directory.

### `TEST_INPUT`

This process should retrieve a file from the working directory and read the contents on the worker machine.
This process retrieves a file from the working directory and reads its contents on the worker machine.

### `TEST_BIN_SCRIPT`

Tests a shell script in the `bin/` directory which creates a single file.
Tests a shell script in the `bin/` directory that creates a single file.

### `TEST_STAGE_REMOTE`

_Note: This will only be enabled if the parameter `--remoteFile` is specified._
_Note: Enabled only if the parameter `--remoteFile` is specified._

This process retrieves a file from a remote resource to the worker machine and reads the contents. This uses the URL defined in the parameter `--remoteFile`, e.g. to download this README:
This process retrieves a file from a remote resource to the worker machine and reads its contents. Use the `--remoteFile` parameter, e.g., to download this README:

```
```bash
nextflow run seqeralabs/nf-canary --remoteFile 'https://raw.githubusercontent.com/seqeralabs/nf-canary/main/README.md'
```

Use this parameter to point to a file that you wish to access when running
Use this parameter to specify a file to access during runtime.

### `TEST_PASS_FILE`

This process stages a file from the working directory to the worker node, copies it and stages it back to the working directory.
This process stages a file from the working directory to the worker node, copies it, and stages it back to the working directory.

### `TEST_PASS_FOLDER`

This process stages a folder from the working directory to the worker node, copies it and stages it back to the working directory.
This process stages a folder from the working directory to the worker node, copies it, and stages it back to the working directory.

### `TEST_PUBLISH_FILE`

This process creates a file on the worker machine, then writes that file to the publishDir directory. This is the by default written to an subfolder called `output` in the working directory, but this can be overridden using the parameter `outdir`. Use this to demonstrate you are able to publish to the relevant output directory.
This process creates a file on the worker machine and writes it to the publishDir directory. By default, this is written to a subfolder called `output` in the working directory, but it can be overridden using the `--outdir` parameter. Use this to demonstrate the ability to publish to the relevant output directory.

### `TEST_PUBLISH_FOLDER`

This process creates a folder on the worker machine, then writes that folder to the publishDir directory. This is the by default written to an subfolder called `output` in the working directory, but this can be overridden using the parameter `outdir`. Use this to demonstrate you are able to publish to the relevant output directory.
This process creates a folder on the worker machine and writes it to the publishDir directory. By default, this is written to a subfolder called `output` in the working directory, but it can be overridden using the `--outdir` parameter. Use this to demonstrate the ability to publish to the relevant output directory.

### `TEST_IGNORED_FAIL`

This process should fail immediately but be ignored using the default configuration.

### `TEST_MV_FILE`

Tests moving a file within the working directory
Tests moving a file within the working directory.

### `TEST_MV_FOLDER_CONTENTS`

Tests moving the contents of a folder to a new folder within the working directory.

```

```

0 comments on commit 03779fe

Please sign in to comment.