[med-svn] [Git][med-team/bitseq][master] add autopkgtests

harish chavre (@Harish1) gitlab at salsa.debian.org
Wed Apr 16 21:16:13 BST 2025



harish chavre pushed to branch master at Debian Med / bitseq


Commits:
5a654048 by Harish at 2025-04-16T20:04:20+00:00
add autopkgtests

- - - - -


7 changed files:

- + debian/tests/Data/Reads.fastq
- + debian/tests/Data/Ref.fasta
- debian/tests/control
- − debian/tests/pytest
- + debian/tests/run-unit-test
- − debian/tests/simple-commands-run
- − debian/tests/test_bitseq.py


Changes:

=====================================
debian/tests/Data/Reads.fastq
=====================================
@@ -0,0 +1,8 @@
+ at read1
+ACGTACGTACGT
++
+IIIIIIIIIIII
+ at read2
+ACGTACGTACGT
++
+JJJJJJJJJJJJ


=====================================
debian/tests/Data/Ref.fasta
=====================================
@@ -0,0 +1,2 @@
+>ref
+ATGCTAGCATACGACTACAGCATACAGCATCAGACTACGACATCAGACTACAGCATACAGCAATACGACTACAGCATACGACTACAGCATCAGATGCTACGCAGACTACGACATCAGACTACAGCATACGACATCAGACTACTACAGACACAGACACGACGACGACGACTACGACACGACGACTACATCAGACGACGACAGCAGCAGCGACAGCAGACGACATACGACAGCATACGACGACAGACATCAGACGACGACGACGACGACGACGACGACCAGACGCATCAGCAGACACGACGAAAAAAAGGAGCATCAGCA


=====================================
debian/tests/control
=====================================
@@ -1,14 +1,3 @@
-Tests: pytest
-Depends: @, 
-         gcc,
-         git,
-         python3-all,
-         python3-all-dev,
-         python3-pytest,
-         python3-venv,
-         bitseq
-Restrictions: allow-stderr, needs-root
-
-Tests: simple-commands-run
-Depends: @, bitseq
-Restrictions: allow-stderr, needs-root
+Tests: run-unit-test
+Depends: @, bowtie
+Restrictions: allow-stderr


=====================================
debian/tests/pytest deleted
=====================================
@@ -1,15 +0,0 @@
-#!/bin/sh
-set -e
-
-echo "Running BitSeq Python script tests..."
-
-for script in checkTR.py parseAlignment.py getCounts.py extractTranscriptInfo.py; do
-    if [ -f "/usr/bin/$script" ]; then
-        echo "Testing $script..."
-        python3 "/usr/bin/$script" --help || echo "Warning: $script may not have a --help option"
-    else
-        echo "Warning: $script not found in /usr/bin"
-    fi
-done
-
-echo "All script tests completed."


=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,18 @@
+set -e
+
+pkg=bitseq
+
+export LC_ALL=C.UTF-8
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a "$(dirname "$0")/Data/"* "${AUTOPKGTEST_TMP}/"
+
+cd "${AUTOPKGTEST_TMP}"
+
+bowtie-build -f Ref.fasta index
+bowtie -q -v 3 --all -m 100 --sam index Reads.fastq  -S out.sam
+
+[ -s out.sam ] && echo "Test passed!" || { echo "Output missing or empty"; exit 1; }


=====================================
debian/tests/simple-commands-run deleted
=====================================
@@ -1,20 +0,0 @@
-#!/bin/sh
-set -efu
-
-# List of BitSeq commands to test
-commands="convertSamples estimateDE getGeneExpression parseAlignment getCounts"
-
-# Loop through and check if each command exists and runs
-for cmd in $commands; do
-    if ! command -v "$cmd" >/dev/null; then
-        echo "Error: Command $cmd is not installed or not in PATH"
-        exit 1
-    fi
-    echo "Running: $cmd --help"
-    $cmd --help >/dev/null || {
-        echo "Error: $cmd command failed"
-        exit 1
-    }
-done
-
-echo "Simple commands run test passed!"


=====================================
debian/tests/test_bitseq.py deleted
=====================================
@@ -1,25 +0,0 @@
-import os
-import subprocess
-
-# Get the absolute path to the bitseq-0.7.5+dfsg directory
-BITSEQ_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
-
-def test_checkTR():
-    script_path = os.path.join(BITSEQ_DIR, "checkTR.py")
-    result = subprocess.run(["python3", script_path], capture_output=True, text=True)
-    assert result.returncode in [0, 1]
-
-def test_parseAlignment():
-    script_path = os.path.join(BITSEQ_DIR, "parseAlignment.py")
-    result = subprocess.run(["python3", script_path], capture_output=True, text=True)
-    assert result.returncode in [0, 1]
-
-def test_getCounts():
-    script_path = os.path.join(BITSEQ_DIR, "getCounts.py")
-    result = subprocess.run(["python3", script_path], capture_output=True, text=True)
-    assert result.returncode in [0, 1]
-
-def test_extractTranscriptInfo():
-    script_path = os.path.join(BITSEQ_DIR, "extractTranscriptInfo.py")
-    result = subprocess.run(["python3", script_path], capture_output=True, text=True)
-    assert result.returncode in [0, 1]



View it on GitLab: https://salsa.debian.org/med-team/bitseq/-/commit/5a6540485860677f7069bdf82c89ce6c4c56645f

-- 
View it on GitLab: https://salsa.debian.org/med-team/bitseq/-/commit/5a6540485860677f7069bdf82c89ce6c4c56645f
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20250416/888f9a25/attachment-0001.htm>


More information about the debian-med-commit mailing list