[Pkg-mongodb-maintainers] [pkg-mongodb] 10/19: Refactor DEP-8 tests

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Thu Dec 15 10:44:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch master
in repository pkg-mongodb.

commit 3586b859bdf2e736fca734d8f3964fe508d3fbdd
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date:   Wed Dec 14 23:42:23 2016 +0200

    Refactor DEP-8 tests
    
     - Run all "basic" JS tests
     - Drop the dependency on netcat and nmap
---
 debian/tests/basic        | 29 +++++++++++++++++++++++++++++
 debian/tests/control      |  4 ++--
 debian/tests/mongo-client | 23 -----------------------
 3 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/debian/tests/basic b/debian/tests/basic
new file mode 100644
index 0000000..2a9e980
--- /dev/null
+++ b/debian/tests/basic
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+set -e
+
+TIMEOUT=120
+
+echo -n "Waiting for mongod to start: "
+count=0
+
+while ! echo 'db.version()' | mongo --quiet >/dev/null; do
+    echo -n "."
+    count=$((count+1))
+    if test $count -gt $TIMEOUT; then
+        echo "    mongod failed to start?"
+        pgrep mongod
+        exit 1
+    fi
+    sleep 1
+done
+
+for testfile in jstests/core/basic*.js; do
+    echo
+    echo " -> Running $testfile"
+    mongo --verbose "$testfile" 2>&1
+done
+
+echo
+echo "=================="
+echo "OK"
diff --git a/debian/tests/control b/debian/tests/control
index ebf1d4a..92be9ac 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,2 @@
-Tests: mongod mongo-client
-Depends: mongodb-server, mongodb-clients, nmap, netcat
+Tests: mongod basic
+Depends: mongodb-server, mongodb-clients
diff --git a/debian/tests/mongo-client b/debian/tests/mongo-client
deleted file mode 100644
index 8dbe885..0000000
--- a/debian/tests/mongo-client
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-set -e
-
-TIMEOUT=120
-
-echo -n "Waiting for mongod to start: "
-count=0
-while (! nc -z 127.0.0.1 27017); do
-    echo -n "."
-    count=$((count+1))
-    if test $count -gt $TIMEOUT; then
-        echo "mongod failed to start?"
-        pgrep mongod
-        exit 1
-    fi
-    sleep 1
-done
-echo "mongod listening"
-
-echo "Performing basic test using mongo client: "
-mongo --verbose jstests/core/basic1.js 2>&1
-echo "OK"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mongodb/pkg-mongodb.git



More information about the Pkg-mongodb-maintainers mailing list