public inbox for [email protected]
help / color / mirror / Atom feedFrom: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][patch] Use unique DB name in ERD API test cases
Date: Wed, 3 Feb 2021 16:00:54 +0530
Message-ID: <CAM9w-_n-NeOB7Z_FY7SaqJFJDfr9DPoS+3Ge_5=7A1yuqZ1=_w@mail.gmail.com> (raw)
Hi Hackers,
Attached is the patch to use unique DB names in ERD API test cases to avoid
conflict when running test cases in parallel.
Please review.
--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
<http://edbpostgres.com;
"Don't Complain about Heat, Plant a TREE"
Attachments:
[application/octet-stream] ERD.apitests.patch (5.4K, 3-ERD.apitests.patch)
download | inline diff:
diff --git a/web/pgadmin/tools/erd/tests/test_close.py b/web/pgadmin/tools/erd/tests/test_close.py
index ef7291522..e334bf92a 100644
--- a/web/pgadmin/tools/erd/tests/test_close.py
+++ b/web/pgadmin/tools/erd/tests/test_close.py
@@ -7,8 +7,7 @@
#
##########################################################################
-import json
-
+import uuid
from pgadmin.utils.route import BaseTestGenerator
from regression.python_test_utils import test_utils as utils
from regression import parent_node_dict
@@ -20,7 +19,7 @@ from pgadmin.browser.server_groups.servers.databases.tests import utils as \
class ERDClose(BaseTestGenerator):
def setUp(self):
- self.db_name = "erdtestdb"
+ self.db_name = "erdtestdb_{0}".format(str(uuid.uuid4())[1:8])
self.sid = parent_node_dict["server"][-1]["server_id"]
self.did = utils.create_database(self.server, self.db_name)
self.sgid = config_data["server_group"]
diff --git a/web/pgadmin/tools/erd/tests/test_initialize.py b/web/pgadmin/tools/erd/tests/test_initialize.py
index 323c009e9..bd6eb2c0c 100644
--- a/web/pgadmin/tools/erd/tests/test_initialize.py
+++ b/web/pgadmin/tools/erd/tests/test_initialize.py
@@ -8,7 +8,7 @@
##########################################################################
import json
-
+import uuid
from pgadmin.utils.route import BaseTestGenerator
from regression.python_test_utils import test_utils as utils
from regression import parent_node_dict
@@ -20,7 +20,7 @@ from pgadmin.browser.server_groups.servers.databases.tests import utils as \
class ERDInitialize(BaseTestGenerator):
def setUp(self):
- self.db_name = "erdtestdb"
+ self.db_name = "erdtestdb_{0}".format(str(uuid.uuid4())[1:8])
self.sid = parent_node_dict["server"][-1]["server_id"]
self.did = utils.create_database(self.server, self.db_name)
self.sgid = config_data["server_group"]
diff --git a/web/pgadmin/tools/erd/tests/test_panel.py b/web/pgadmin/tools/erd/tests/test_panel.py
index f04e432b4..63601cb3d 100644
--- a/web/pgadmin/tools/erd/tests/test_panel.py
+++ b/web/pgadmin/tools/erd/tests/test_panel.py
@@ -7,8 +7,7 @@
#
##########################################################################
-import json
-
+import uuid
from pgadmin.utils.route import BaseTestGenerator
from regression.python_test_utils import test_utils as utils
from regression import parent_node_dict
@@ -20,7 +19,7 @@ from pgadmin.browser.server_groups.servers.databases.tests import utils as \
class ERDPanel(BaseTestGenerator):
def setUp(self):
- self.db_name = "erdtestdb"
+ self.db_name = "erdtestdb_{0}".format(str(uuid.uuid4())[1:8])
self.sid = parent_node_dict["server"][-1]["server_id"]
self.did = utils.create_database(self.server, self.db_name)
self.sgid = config_data["server_group"]
diff --git a/web/pgadmin/tools/erd/tests/test_prequisite.py b/web/pgadmin/tools/erd/tests/test_prequisite.py
index 3cb922599..926280d41 100644
--- a/web/pgadmin/tools/erd/tests/test_prequisite.py
+++ b/web/pgadmin/tools/erd/tests/test_prequisite.py
@@ -8,7 +8,7 @@
##########################################################################
import json
-
+import uuid
from pgadmin.utils.route import BaseTestGenerator
from regression.python_test_utils import test_utils as utils
from regression import parent_node_dict
@@ -20,7 +20,7 @@ from pgadmin.browser.server_groups.servers.databases.tests import utils as \
class ERDPrequisite(BaseTestGenerator):
def setUp(self):
- self.db_name = "erdtestdb"
+ self.db_name = "erdtestdb_{0}".format(str(uuid.uuid4())[1:8])
self.sid = parent_node_dict["server"][-1]["server_id"]
self.did = utils.create_database(self.server, self.db_name)
self.sgid = config_data["server_group"]
diff --git a/web/pgadmin/tools/erd/tests/test_sql.py b/web/pgadmin/tools/erd/tests/test_sql.py
index 49e630a78..8240397f3 100644
--- a/web/pgadmin/tools/erd/tests/test_sql.py
+++ b/web/pgadmin/tools/erd/tests/test_sql.py
@@ -8,7 +8,7 @@
##########################################################################
import json
-
+import uuid
from pgadmin.utils.route import BaseTestGenerator
from regression.python_test_utils import test_utils as utils
from regression import parent_node_dict
@@ -23,7 +23,7 @@ from os import path
class ERDSql(BaseTestGenerator):
def setUp(self):
- self.db_name = "erdtestdb"
+ self.db_name = "erdtestdb_{0}".format(str(uuid.uuid4())[1:8])
self.sid = parent_node_dict["server"][-1]["server_id"]
self.did = utils.create_database(self.server, self.db_name)
self.sgid = config_data["server_group"]
diff --git a/web/pgadmin/tools/erd/tests/test_tables.py b/web/pgadmin/tools/erd/tests/test_tables.py
index 3c5fcf0e7..8c3794eaf 100644
--- a/web/pgadmin/tools/erd/tests/test_tables.py
+++ b/web/pgadmin/tools/erd/tests/test_tables.py
@@ -9,7 +9,6 @@
import json
import uuid
-
from pgadmin.utils.route import BaseTestGenerator
from regression.python_test_utils import test_utils as utils
from regression import parent_node_dict
@@ -33,7 +32,7 @@ class ERDTables(BaseTestGenerator):
utils.drop_database(connection, self.db_name)
def setUp(self):
- self.db_name = "erdtestdb"
+ self.db_name = "erdtestdb_{0}".format(str(uuid.uuid4())[1:8])
self.sid = parent_node_dict["server"][-1]["server_id"]
self.did = utils.create_database(self.server, self.db_name)
view thread (4+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [pgAdmin][patch] Use unique DB name in ERD API test cases
In-Reply-To: <CAM9w-_n-NeOB7Z_FY7SaqJFJDfr9DPoS+3Ge_5=7A1yuqZ1=_w@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox