- name: fastp test_fastp_single_end
  command: nextflow run ./tests/modules/fastp -entry test_fastp_single_end -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config
  tags:
    - fastp
  files:
    - path: output/fastp/test.fastp.html
      contains:
        - "Q20 bases:</td><td class='col2'>12.922000 K (92.984097%)"
        - "single end (151 cycles)"
    - path: output/fastp/test.fastp.log
      contains:
        - "Q20 bases: 12922(92.9841%)"
        - "reads passed filter: 99"
    - path: output/fastp/test.trim.fastq.gz
      md5sum: 4ce5c2b4db68a743cb0635ce7da3b9a4
    - path: output/fastp/test.fastp.json
      md5sum: a517ba37b17a342b5428f2c1f8fe3dd7

- name: fastp test_fastp_paired_end
  command: nextflow run ./tests/modules/fastp -entry test_fastp_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config
  tags:
    - fastp
  files:
    - path: output/fastp/test.fastp.html
      contains:
        - "Q20 bases:</td><td class='col2'>25.719000 K (93.033098%)"
        - "The input has little adapter percentage (~0.000000%), probably it's trimmed before."
    - path: output/fastp/test.fastp.log
      contains:
        - "No adapter detected for read1"
        - "Q30 bases: 12281(88.3716%)"
    - path: output/fastp/test.fastp.json
      contains:
        - '"passed_filter_reads": 198'
    - path: output/fastp/test_1.trim.fastq.gz
      md5sum: 4ce5c2b4db68a743cb0635ce7da3b9a4
    - path: output/fastp/test_2.trim.fastq.gz
      md5sum: 532b190fb4dc7b2277ee5cf1464e598c

- name: fastp test_fastp_single_end_trim_fail
  command: nextflow run ./tests/modules/fastp -entry test_fastp_single_end_trim_fail -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config
  tags:
    - fastp
  files:
    - path: output/fastp/test.fastp.html
      contains:
        - "Q20 bases:</td><td class='col2'>12.922000 K (92.984097%)"
        - "single end (151 cycles)"
    - path: output/fastp/test.fastp.log
      contains:
        - "Q20 bases: 12922(92.9841%)"
        - "reads passed filter: 99"
    - path: output/fastp/test.trim.fastq.gz
      md5sum: 4ce5c2b4db68a743cb0635ce7da3b9a4
    - path: output/fastp/test.fastp.json
      md5sum: 4be682c727942a45fc4c8600c28694a8
    - path: output/fastp/test.fail.fastq.gz
      md5sum: b57f2026eb259a0b0c0b3960c270258d

- name: fastp test_fastp_paired_end_trim_fail
  command: nextflow run ./tests/modules/fastp -entry test_fastp_paired_end_trim_fail -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config
  tags:
    - fastp
  files:
    - path: output/fastp/test.fastp.html
      contains:
        - "Q20 bases:</td><td class='col2'>25.719000 K (93.033098%)"
        - "The input has little adapter percentage (~0.000000%), probably it's trimmed before."
    - path: output/fastp/test.fastp.log
      contains:
        - "No adapter detected for read1"
        - "Q30 bases: 12281(88.3716%)"
    - path: output/fastp/test.fastp.json
      contains:
        - '"passed_filter_reads": 198'
    - path: output/fastp/test_1.trim.fastq.gz
      md5sum: 4ce5c2b4db68a743cb0635ce7da3b9a4
    - path: output/fastp/test_2.trim.fastq.gz
      md5sum: 532b190fb4dc7b2277ee5cf1464e598c
    - path: output/fastp/test_1.fail.fastq.gz
      md5sum: d41d8cd98f00b204e9800998ecf8427e
    - path: output/fastp/test_2.fail.fastq.gz
      md5sum: 72d0002841967676ac936d08746a9128

- name: fastp test_fastp_paired_end_merged
  command: nextflow run ./tests/modules/fastp -entry test_fastp_paired_end_merged -c ./tests/config/nextflow.config -c ./tests/modules/fastp/nextflow.config
  tags:
    - fastp
  files:
    - path: output/fastp/test.fastp.html
      contains:
        - "<div id='After_filtering__merged__quality'>"
    - path: output/fastp/test.fastp.json
      contains:
        - '"merged_and_filtered": {'
        - '"total_reads": 75'
        - '"total_bases": 13683'
    - path: output/fastp/test.fastp.log
      contains:
        - "Merged and filtered:"
        - "total reads: 75"
        - "total bases: 13683"
    - path: output/fastp/test.merged.fastq.gz
      md5sum: 4955ca2c899729b17bd526d2626a8d73
    - path: output/fastp/test_1.trim.fastq.gz
      md5sum: 4a03721ee252b7c6e81e007550e6ab63
    - path: output/fastp/test_2.trim.fastq.gz
      md5sum: 7a4ddf8485c147cd7aaf0d4f6cd57ace
