backend/spacewalk-backend.spec | 5 ++
backend/test/non-unit/server/rhnSQL/dbtests.py | 45 -------------------------
backend/test/runtests-postgresql.py | 42 +++++++++++++++++++++--
rel-eng/packages/spacewalk-backend | 2 -
4 files changed, 44 insertions(+), 50 deletions(-)
New commits:
commit ffb62fc9eb96ae75342c7872d1a2267644b214c8
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Oct 15 14:32:49 2013 +0200
Automatic commit of package [spacewalk-backend] release [2.1.28-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 1562ee7..a4bbd9a 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -11,7 +11,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 2.1.27
+Version: 2.1.28
Release: 1%{?dist}
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -627,6 +627,9 @@ rm -f %{rhnconf}/rhnSecret.py*
%{pythonrhnroot}/satellite_tools/exporter/xmlWriter.py*
%changelog
+* Tue Oct 15 2013 Michael Mraka <michael.mraka(a)redhat.com> 2.1.28-1
+- python pgsql tests: made easier Jenkins integration
+
* Wed Oct 09 2013 Michael Mraka <michael.mraka(a)redhat.com> 2.1.27-1
- cleaning up old svn Ids
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 18193f9..37e8bc2 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-2.1.27-1 backend/
+2.1.28-1 backend/
commit 9a4621630b54aea3c2822a65a50784363f9f4f9d
Author: Flavio Castelli <fcastelli(a)suse.com>
Date: Tue Oct 15 14:17:12 2013 +0200
python pgsql tests: made easier Jenkins integration
Made easier to run the pgsql tests using nosetests in conjunction with
the 'with-xunit'.
Invoking:
nosetests --with-xunit --xunit-file pgsql_tests.xml runtests-postgresql.py
will produce an xml file which can be parsed by Jenkins.
Invoking the script in the old way still works as expected.
diff --git a/backend/test/non-unit/server/rhnSQL/dbtests.py
b/backend/test/non-unit/server/rhnSQL/dbtests.py
index ff51148..0fa703a 100644
--- a/backend/test/non-unit/server/rhnSQL/dbtests.py
+++ b/backend/test/non-unit/server/rhnSQL/dbtests.py
@@ -201,44 +201,6 @@ class RhnSQLDatabaseTests(unittest.TestCase):
-class PostgreSQLDatabaseTests(RhnSQLDatabaseTests):
- QUERY_CREATE_TABLE = """
- CREATE TABLE %s(id INT, name TEXT, num NUMERIC(5,2))
- """
-
- SIMPLE_PROCEDURE = """
-CREATE OR REPLACE FUNCTION return_int(returnme INTEGER) RETURNS int AS $$
-DECLARE
- myInt int;
-BEGIN
- myInt := returnme;
- RETURN myInt;
-END
-$$ LANGUAGE 'plpgsql';
- """
-
- def setUp(self):
- self.set_temp_table()
- create_table_query = self.QUERY_CREATE_TABLE % self.temp_table
- cursor = rhnSQL.prepare(create_table_query)
- cursor.execute()
-
- RhnSQLDatabaseTests.setUp(self)
-
- cursor = rhnSQL.prepare(self.SIMPLE_PROCEDURE)
- cursor.execute()
-
- def tearDown(self):
- try:
- cursor = rhnSQL.prepare("DROP FUNCTION return_int(returnme
integer)")
- cursor.execute()
- except:
- pass
-
- RhnSQLDatabaseTests.tearDown(self)
-
-
-
class OracleDatabaseTests(RhnSQLDatabaseTests):
QUERY_CREATE_TABLE = """
CREATE TABLE %s(id NUMBER, name VARCHAR2(256), num NUMBER(5,2))
@@ -270,13 +232,6 @@ END;
RhnSQLDatabaseTests.tearDown(self)
-
-
-def postgresql_suite():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(PostgreSQLDatabaseTests))
- return suite
-
def oracle_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(OracleDatabaseTests))
diff --git a/backend/test/runtests-postgresql.py b/backend/test/runtests-postgresql.py
index 0a10ec7..f647331 100755
--- a/backend/test/runtests-postgresql.py
+++ b/backend/test/runtests-postgresql.py
@@ -48,11 +48,47 @@ rhnSQL.initDB(backend="postgresql", host=PG_HOST,
username=PG_USER,
rhnSQL.initDB(backend="postgresql", host=PG_HOST, username=PG_USER,
password=PG_PASSWORD, database=PG_DATABASE)
+class PostgreSQLDatabaseTests(dbtests.RhnSQLDatabaseTests):
+ QUERY_CREATE_TABLE = """
+ CREATE TABLE %s(id INT, name TEXT, num NUMERIC(5,2))
+ """
+
+ SIMPLE_PROCEDURE = """
+CREATE OR REPLACE FUNCTION return_int(returnme INTEGER) RETURNS int AS $$
+DECLARE
+ myInt int;
+BEGIN
+ myInt := returnme;
+ RETURN myInt;
+END
+$$ LANGUAGE 'plpgsql';
+ """
+
+ def setUp(self):
+ self.set_temp_table()
+ create_table_query = self.QUERY_CREATE_TABLE % self.temp_table
+ cursor = rhnSQL.prepare(create_table_query)
+ cursor.execute()
+
+ dbtests.RhnSQLDatabaseTests.setUp(self)
+
+ cursor = rhnSQL.prepare(self.SIMPLE_PROCEDURE)
+ cursor.execute()
+
+ def tearDown(self):
+ try:
+ cursor = rhnSQL.prepare("DROP FUNCTION return_int(returnme
integer)")
+ cursor.execute()
+ except:
+ pass
+
+ dbtests.RhnSQLDatabaseTests.tearDown(self)
+
def suite():
+ s = unittest.TestSuite()
+ s.addTest(unittest.makeSuite(PostgreSQLDatabaseTests))
# Append all test suites here:
- return unittest.TestSuite((
- dbtests.postgresql_suite(),
- ))
+ return unittest.TestSuite(s)
if __name__ == "__main__":
try: