Commit f51c315e authored by Shayan Doust's avatar Shayan Doust
Browse files

Autopkgtest for simka and simkamin

Simkamin hits a trouble of the test failing at the end to which awaiting for upstream to intervene
parent 3ea7cc6e
Loading
Loading
Loading
Loading
+75 −16
Original line number Diff line number Diff line
@@ -5,14 +5,47 @@ Last-Update: 2019-09-13

Index: simka/tests/simkaMin/test_simkaMin.py
===================================================================
--- simka.orig/tests/simkaMin/test_simkaMin.py	2019-09-13 08:06:40.164613706 +0100
+++ simka/tests/simkaMin/test_simkaMin.py	2019-09-13 08:06:40.160613722 +0100
--- simka.orig/tests/simkaMin/test_simkaMin.py	2019-09-13 10:16:10.865442411 +0100
+++ simka/tests/simkaMin/test_simkaMin.py	2019-09-13 10:16:10.861442427 +0100
@@ -16,28 +16,28 @@
 
 def create_command(scriptFilename, outputPrefix, k, filter, nb_reads, nb_kmers, nb_cores, input_filename):
     outputDir = "k" + str(k) + "_" + filter.replace("-", "") + "_" + str(nb_reads) + "-" + str(nb_kmers) + "_n" + str(nb_cores)
-    command = "python  " + scriptFilename
+    command =scriptFilename
     command += " -in " + input_filename
     command += " -out " + outputPrefix + "/" + outputDir
     command += " -nb-cores " + str(nb_cores)
     command += " -max-memory 100 "
     command += " -kmer-size " + str(k)
     command += " -nb-kmers " + str(nb_kmers)
-    command += " -bin ../../build/bin/simkaMinCore "
+    command += " -bin simkaMinCore "
     command += " -max-reads " + str(nb_reads)
     command += " " + filter + " "
     return command, outputDir
 
 def create_command_update(scriptFilename, outputPrefix, k, filter, nb_reads, nb_kmers, nb_cores, input_filename):
     outputDir = "k" + str(k) + "_" + filter.replace("-", "") + "_" + str(nb_reads) + "-" + str(nb_kmers) + "_n" + str(nb_cores)
-    command = "python  " + scriptFilename
+    command = scriptFilename
     command += " -in " + input_filename
     command += " -in-to-update " + outputPrefix + "/" + outputDir
     command += " -nb-cores " + str(nb_cores)
     command += " -max-memory 100 "
     #command += " -kmer-size " + str(k)
     #command += " -nb-kmers " + str(nb_kmers)
-    command += " -bin ../../build/bin/simkaMinCore "
+    command += " -bin simkaMinCore "
     command += " -max-reads " + str(nb_reads)
     command += " " + filter + " "
     return command, outputDir
@@ -48,7 +48,7 @@
             for nb_reads in NB_READS:
                 for nb_kmers in NB_KMERS:
                     for nb_cores in NB_CORES:
-                        command, outputDir = create_command("../../simkaMin/simkaMin.py", "truth_simkaMin", k, filter, nb_reads, nb_kmers, nb_cores, " ../../example/simka_input.txt ")
+                        command, outputDir = create_command("simkaMin", "truth_simkaMin", k, filter, nb_reads, nb_kmers, nb_cores, " ../../example/simka_input.txt ")
+                        command, outputDir = create_command("simkaMin", "truth_simkaMin", k, filter, nb_reads, nb_kmers, nb_cores, " ../simka_input.txt ")
                         print (command)
                         ret = os.system(command)
                         if ret != 0: exit(1)
@@ -21,11 +54,24 @@ Index: simka/tests/simkaMin/test_simkaMin.py
                 for nb_kmers in NB_KMERS:
                     for nb_cores in NB_CORES:
-                        command, outputDir = create_command("../../simkaMin/simkaMin.py", dir, k, filter, nb_reads, nb_kmers, nb_cores, " ../../example/simka_input.txt ")
+                        command, outputDir = create_command("simkaMin", dir, k, filter, nb_reads, nb_kmers, nb_cores, " ../../example/simka_input.txt ")
+                        command, outputDir = create_command("simkaMin", dir, k, filter, nb_reads, nb_kmers, nb_cores, " ../simka_input.txt ")
                         print (command)
                         ret = os.system(command + suffix)
                         if ret != 0: exit(1)
@@ -179,14 +179,14 @@
@@ -168,25 +168,25 @@
     os.mkdir(out_dir)
 
     merged_sketch_filename = os.path.join(out_dir, "merged_sketch.bin")
-    filename = "../../example/simka_input.txt"
+    filename = "../simka_input.txt"
     for line in open(filename):
         line = line.strip()
         if len(line) == 0: continue
 
-        filename_temp = os.path.join("../../example/test_simkaMin_input_temp.txt")
+        filename_temp = os.path.join("../test_simkaMin_input_temp.txt")
         f = open(filename_temp, "w")
         f.write(line)
         f.close()
 
         sketch_filename = os.path.join(out_dir, "sketch.bin")
@@ -57,7 +103,20 @@ Index: simka/tests/simkaMin/test_simkaMin.py
     print(command)
     ret = os.system(command + suffix)
     if ret != 0: exit(1)
@@ -237,12 +237,12 @@
@@ -226,23 +226,23 @@
     os.mkdir(out_dir)
 
     init = False
-    filename = "../../example/simka_input.txt"
+    filename = "../simka_input.txt"
     for line in open(filename):
         line = line.strip()
         if len(line) == 0: continue
 
-        filename_temp = os.path.join("../../example/test_simkaMin_input_temp.txt")
+        filename_temp = os.path.join("../test_simkaMin_input_temp.txt")
         f = open(filename_temp, "w")
         f.write(line)
         f.close()
 
         if init:
@@ -74,14 +133,14 @@ Index: simka/tests/simkaMin/test_simkaMin.py
             if ret != 0: exit(1)
Index: simka/tests/simple_test.py
===================================================================
--- simka.orig/tests/simple_test.py	2019-09-13 08:06:40.164613706 +0100
+++ simka/tests/simple_test.py	2019-09-13 08:06:40.160613722 +0100
--- simka.orig/tests/simple_test.py	2019-09-13 10:16:10.865442411 +0100
+++ simka/tests/simple_test.py	2019-09-13 10:16:58.213252568 +0100
@@ -91,7 +91,7 @@
 #test k=31 t=0
 clear()
 print("TESTING k=31 t=0")
-command = "../build/bin/simka -in ../example/simka_input.txt -out ./__results__/results_k31_t0 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 31 -abundance-min 0 -verbose 0"
+command = "/usr/bin/simka -in simka_input.txt -out ./__results__/results_k31_t0 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 31 -abundance-min 0 -verbose 0"
+command = "simka -in simka_input.txt -out ./__results__/results_k31_t0 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 31 -abundance-min 0 -verbose 0"
 print(command)
 os.system(command + suffix)
 test_dists("results_k31_t0")
@@ -90,7 +149,7 @@ Index: simka/tests/simple_test.py
 clear()
 print("TESTING k=21 t=0")
-command = "../build/bin/simka -in ../example/simka_input.txt -out ./__results__/results_k21_t0 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -verbose 0"
+command = "/usr/bin/simka -in simka_input.txt -out ./__results__/results_k21_t0 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -verbose 0"
+command = "simka -in simka_input.txt -out ./__results__/results_k21_t0 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -verbose 0"
 print(command)
 os.system(command + suffix)
 test_dists("results_k21_t0")
@@ -99,7 +158,7 @@ Index: simka/tests/simple_test.py
 clear()
 print("TESTING k=31 t=2")
-command = "../build/bin/simka -in ../example/simka_input.txt -out ./__results__/results_k31_t2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 31 -abundance-min 2 -verbose 0"
+command = "/usr/bin/simka -in simka_input.txt -out ./__results__/results_k31_t2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 31 -abundance-min 2 -verbose 0"
+command = "simka -in simka_input.txt -out ./__results__/results_k31_t2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 31 -abundance-min 2 -verbose 0"
 print(command)
 os.system(command + suffix)
 test_dists("results_k31_t2")
@@ -108,7 +167,7 @@ Index: simka/tests/simple_test.py
 clear()
 print("TESTING k=21 t=2")
-command = "../build/bin/simka -in ../example/simka_input.txt -out ./__results__/results_k21_t2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 2 -verbose 0"
+command = "/usr/bin/simka -in simka_input.txt -out ./__results__/results_k21_t2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 2 -verbose 0"
+command = "simka -in simka_input.txt -out ./__results__/results_k21_t2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 2 -verbose 0"
 print(command)
 os.system(command + suffix)
 test_dists("results_k21_t2")
@@ -117,17 +176,17 @@ Index: simka/tests/simple_test.py
 clear()
 print("TESTING parallelization")
-command = "../build/bin/simka -in ../example/simka_input.txt -out ./__results__/results_resources1 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -nb-cores 20 -max-memory 4000  -verbose 0"
+command = "/usr/bin/simka -in simka_input.txt -out ./__results__/results_resources1 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -nb-cores 20 -max-memory 4000  -verbose 0"
+command = "simka -in simka_input.txt -out ./__results__/results_resources1 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -nb-cores 20 -max-memory 4000  -verbose 0"
 os.system(command + suffix)
-command = "../build/bin/simka -in ../example/simka_input.txt -out ./__results__/results_resources2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -nb-cores 2 -max-memory 2000  -verbose 0"
+command = "/usr/bin/simka -in simka_input.txt -out ./__results__/results_resources2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -nb-cores 2 -max-memory 2000  -verbose 0"
+command = "simka -in simka_input.txt -out ./__results__/results_resources2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -nb-cores 2 -max-memory 2000  -verbose 0"
 os.system(command + suffix)
 test_parallelization()
 
Index: simka/example/simple_test.sh
===================================================================
--- simka.orig/example/simple_test.sh	2019-09-13 08:06:40.164613706 +0100
+++ simka/example/simple_test.sh	2019-09-13 08:07:06.216509113 +0100
--- simka.orig/example/simple_test.sh	2019-09-13 10:16:10.865442411 +0100
+++ simka/example/simple_test.sh	2019-09-13 10:16:10.861442427 +0100
@@ -3,19 +3,19 @@
 
 # look for simka binary. In devel mode, it's in ../build/bin directory.
+4 −2
Original line number Diff line number Diff line
@@ -13,9 +13,11 @@ cp -a /usr/share/doc/${pkg}/example/* "${AUTOPKGTEST_TMP}"
cp -a /usr/share/doc/${pkg}min/example/* "${AUTOPKGTEST_TMP}"

cd "${AUTOPKGTEST_TMP}"
gunzip *.gz
find . -name "*.gz" -exec gunzip \{\} \;
ls && ls simkaMin

echo "Testing simka"
bash simple_test.sh
echo "Testing simkaMin"
python3 simple_test.py
echo "Testing simkaMin"
python3 simkaMin/test_simkaMin.py