Re: pgAdmin IV : Unittest modular patch

From: Dave Page <dave(dot)page(at)enterprisedb(dot)com>
To: Navnath Gadakh <navnath(dot)gadakh(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>, Kanchan Mohitey <kanchan(dot)mohitey(at)enterprisedb(dot)com>
Subject: Re: pgAdmin IV : Unittest modular patch
Date: 2016-08-03 09:15:46
Message-ID: CA+OCxoy2kSbeBDCYaXGKOvEZAtpEO7uviL5cPakNf0FM=C=dzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Navnath

On Tue, Aug 2, 2016 at 3:58 PM, Navnath Gadakh
<navnath(dot)gadakh(at)enterprisedb(dot)com> wrote:
> Hi Dave,
> Please find the attached patch.
> This patch includes:
> 1. API test cases for Roles & Tablespaces node(Completed nodes: server
> groups, servers, databases)
> You can run test-suite using following command
> for roles node
> python regression/runtests.py --pkg
> browser.server_groups.servers.roles
> for tablespaces node
> python regression/runtests.py --pkg
> browser.server_groups.servers.tablespaces
> for all nodes
> python regression/runtests.py
> You can also test with multiple servers.
> 2. Delete database code in some of the missed test files.
> 3. Added advanced configurations in test_advanced_config.json.in for roles &
> tablespaces. So, accordingly you need change the file
> test_advanced_config.json
> 4. Added one test user credentials in test_config.json.in to test the ‘valid
> password’ test case which is present in
> browser/tests/test_change_password.py
> Why test user credentials in test_config.json.in?
> Currently, I am getting ‘UnicodeDecodeError’ when I run
> test-suite(runtests.py) with existing code. I already explained the detail
> about this error in RM(#1521). I am creating test user to test the ‘valid
> password’ test case.

The tablespace test is one that I think is going to cause us problems
- we really can't have a hard-coded path in the config;

- It might need to be different for each server being tested

- It is very likely to be different for each user

I think what we need to do is:

- Skip the tests if the server is not connected via a Unix domain
socket (hostname starts with /), 127.0.0.1 or ::1.

- Add per-server configuration options for the tablespace path and
service account under which the database server runs. These values
should default to /tmp and postgres for a PostgreSQL server, and edb
for PPAS.

- Otherwise; assume the server is on the local machine, and:
- Create /$tblspace_path/<random_string>/
- chown $service_account /$tblspace_path/<random_string>/
- Run the tests

Thoughts?

I'd also suggest another couple of changes:

- Remove the test_ prefix from the values in the config files. It
doesn't really help in the code as there you'll always have the data
in a variable anyway, e.g. adv_config_data["spc_location"] instead of
adv_config_data["test_spc_location"].

- I think we should fall back to using test_advanced_config.json.in if
the user hasn't made their own copy, e.g.

try:
with open(CURRENT_PATH + '/test_advanced_config.json') as data_file:
advanced_config_data = json.load(data_file)
except:
with open(CURRENT_PATH + '/test_advanced_config.json.in') as data_file:
advanced_config_data = json.load(data_file)

--
Dave Page
VP, Chief Architect, Tools & Installers
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2016-08-03 09:25:12 pgAdmin 4 commit: Ignore the pickle.
Previous Message Harshal Dhumal 2016-08-03 06:36:43 Patch for RM1500 other issues [pgAdmin4]