[med-svn] [Git][med-team/cat-bat][master] 3 commits: Added autopkgtest

Israel Komolehin (@Komolehin) gitlab at salsa.debian.org
Wed Jan 10 19:38:44 GMT 2024



Israel Komolehin pushed to branch master at Debian Med / cat-bat


Commits:
702df8a9 by Komolehin Israel Timilehin at 2024-01-10T19:18:14+00:00
Added autopkgtest

- - - - -
8c7277da by Komolehin Israel Timilehin at 2024-01-10T19:20:48+00:00
Added Control

- - - - -
446fb2f7 by Komolehin Israel Timilehin at 2024-01-10T19:25:29+00:00
Updated changelog

- - - - -


4 changed files:

- debian/changelog
- + debian/tests/control
- + debian/tests/run-bat-unit-test
- + debian/tests/run-cat-unit-test


Changes:

=====================================
debian/changelog
=====================================
@@ -1,8 +1,12 @@
 cat-bat (5.3-2) UNRELEASED; urgency=medium
 
+  [ Andreas Tille ]
   * Prevent Salsa CI from building under i386 which is prevented by
     Build-Depends
 
+  [ Komolehin Israel Timilehin ]
+  * Added autopkgtest
+
  -- Andreas Tille <tille at debian.org>  Mon, 27 Nov 2023 12:06:16 +0100
 
 cat-bat (5.3-1) unstable; urgency=medium


=====================================
debian/tests/control
=====================================
@@ -0,0 +1,3 @@
+Tests: run-bat-unit-test, run-cat-unit-test
+Depends: cat-bat
+Restrictions: allow-stderr
\ No newline at end of file


=====================================
debian/tests/run-bat-unit-test
=====================================
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+CUR_DIR=`pwd`
+
+if [ "$AUTOPKGTEST_TMP" = "" ]; then
+
+	AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXX`
+	trap "rm -rf $AUTOPKG_TMP" 0 INT QUIT ABRT PIPE TERM
+
+fi
+
+mkdir -p "$AUTOPKGTEST_TMP"/data
+
+# Copy tests data
+cp -a "${CUR_DIR}"/tests/data/* "$AUTOPKGTEST_TMP"/data
+
+# Change directory into data
+cd "$AUTOPKGTEST_TMP"/data/
+
+# Extract fasta
+gunzip prepare/small.fa.gz
+
+# Prepare CAT database
+CAT prepare \
+    --db_fasta ./prepare/small.fa \
+    --names ./prepare/names.dmp \
+    --nodes ./prepare/nodes.dmp \
+    --acc2tax ./prepare/prot2acc.txt \
+    --db_dir ./output_db
+
+# Run BAT on single MAG
+CAT bins -b prepare/small.fa \
+         -d output_db/db \
+         -t output_db/tax 
+
+# Check final classification files (output files)
+if [ -f "out.BAT.ORF2LCA.txt" ] && [ -f "out.BAT.bin2classification.txt" ]; then
+    echo "Final Classification Files Generated"
+    rm -rf *
+else
+    echo "One or both classification files not generated"
+    rm -rf *
+    exit 1
+fi
\ No newline at end of file


=====================================
debian/tests/run-cat-unit-test
=====================================
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+CUR_DIR=`pwd`
+
+if [ "$AUTOPKGTEST_TMP" = "" ]; then
+
+	AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXX`
+	trap "rm -rf $AUTOPKG_TMP" 0 INT QUIT ABRT PIPE TERM
+
+fi
+
+mkdir -p "$AUTOPKGTEST_TMP"/data
+
+# Copy tests data
+cp -a "${CUR_DIR}"/tests/data/* "$AUTOPKGTEST_TMP"/data
+
+# Change directory into data
+cd "$AUTOPKGTEST_TMP"/data/
+
+# Extract fasta
+gunzip prepare/small.fa.gz
+
+# Prepare CAT database
+CAT prepare \
+    --db_fasta ./prepare/small.fa \
+    --names ./prepare/names.dmp \
+    --nodes ./prepare/nodes.dmp \
+    --acc2tax ./prepare/prot2acc.txt \
+    --db_dir ./output_db
+
+# Annotate contig set
+CAT contigs \
+    -c ./prepare/small.fa \
+    -d ./output_db/db \
+    -t ./output_db/tax
+
+# Check final classification files (output files)
+if [ -f "out.CAT.ORF2LCA.txt" ] && [ -f "out.CAT.contig2classification.txt" ]; then
+    echo "Final Classification Files Generated"
+    rm -rf *
+else
+    echo "One or both classification files not generated"
+    rm -rf *
+    exit 1
+fi
\ No newline at end of file



View it on GitLab: https://salsa.debian.org/med-team/cat-bat/-/compare/276e43983d8cdcd21da92e64d7d416b296aca1f9...446fb2f7966393f2e3a6346921fcb95960ab8fe1

-- 
View it on GitLab: https://salsa.debian.org/med-team/cat-bat/-/compare/276e43983d8cdcd21da92e64d7d416b296aca1f9...446fb2f7966393f2e3a6346921fcb95960ab8fe1
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/20240110/f06fa343/attachment-0001.htm>


More information about the debian-med-commit mailing list