[med-svn] [Git][med-team/graphbin][master] Write autopkgtest

Shayan Doust gitlab at salsa.debian.org
Thu Jul 16 17:20:53 BST 2020



Shayan Doust pushed to branch master at Debian Med / graphbin


Commits:
bfb95d8e by Shayan Doust at 2020-07-16T17:20:38+01:00
Write autopkgtest

- - - - -


1 changed file:

- debian/tests/run-unit-test


Changes:

=====================================
debian/tests/run-unit-test
=====================================
@@ -1,8 +1,6 @@
 #!/bin/bash
 set -e
 
-pkg=#PACKAGENAME#
-
 export LC_ALL=C.UTF-8
 if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
   AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
@@ -12,8 +10,44 @@ if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
   trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
 fi
 
-cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"
+BINNED_RESULTS="results/graphbin_output.csv"
+UNBINNED_CONTIGS="results/graphbin_unbinned.csv"
+
+cp -a test_data/ "${AUTOPKGTEST_TMP}"
+
+# Test graphbin with megahit assembler
+cd "${AUTOPKGTEST_TMP}"/test_data/ESC_MEGAHIT/
+graphbin --assembler megahit --graph final.gfa --binned maxbin_contig_bins.csv --output results/
+
+# Run basic check to see if output and unbinned files exist and are of non-zero byte size
+if [ -s "$BINNED_RESULTS" ] && [ -s "$UNBINNED_CONTIGS" ]
+then
+	echo "[1] PASS"
+else
+	echo "[1] FAIL: neither binned results, unbinned contigs or both exist!"
+	exit 1
+fi
 
-cd "${AUTOPKGTEST_TMP}"
+# Test graphbin with sga assembler
+cd "${AUTOPKGTEST_TMP}"/test_data/ESC_SGA/
+graphbin --assembler sga --graph default-graph.asqg --binned maxbin_contig_bins.csv --output results/
 
-#do_stuff_to_test_package#
+if [ -s "$BINNED_RESULTS" ] && [ -s "$UNBINNED_CONTIGS" ]
+then
+	echo "[2] PASS"
+else
+	echo "[2] FAIL: neither binned results, unbinned contigs or both exist!"
+	exit 1
+fi
+
+# Test graphbin with spades assembler
+cd "${AUTOPKGTEST_TMP}"/test_data/ESC_metaSPAdes/
+graphbin --assembler spades --graph assembly_graph_with_scaffolds.gfa --paths contigs.paths --binned maxbin_contig_bins.csv --output results/
+
+if [ -s "$BINNED_RESULTS" ] && [ -s "$UNBINNED_CONTIGS" ]
+then
+	echo "[3] PASS"
+else
+	echo "[3] FAIL: neither binned results, unbinned contigs or both exist!"
+	exit 1
+fi



View it on GitLab: https://salsa.debian.org/med-team/graphbin/-/commit/bfb95d8eabd3285ffbaf4ba33a87060dd769cd12

-- 
View it on GitLab: https://salsa.debian.org/med-team/graphbin/-/commit/bfb95d8eabd3285ffbaf4ba33a87060dd769cd12
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/20200716/b24b7c6d/attachment-0001.html>


More information about the debian-med-commit mailing list