Обсуждение: Patch for setting preferences with user id

Поиск
Список
Период
Сортировка

Patch for setting preferences with user id

От
Usman Muzaffar
Дата:
Hi Hackers,

Please find here attached patch for following

"modified the function test_utils/set_preference to accommodate user_id."

It will help setting preferences in case user_id is other than 1(depending on the user which has been logged in).

FYI - the patch is dependent on the patch shared by Murtaza with subject line "[pgAdmin4][Patch]: Code refactoring"
--


Thanks,

Usman Muzaffar
QA Team
EnterpriseDB Corporation
Вложения

Re: Patch for setting preferences with user id

От
Dave Page
Дата:
Hi
On Mon, Oct 8, 2018 at 9:08 AM Usman Muzaffar <usman.muzaffar@enterprisedb.com> wrote:
Hi Hackers,

Please find here attached patch for following

"modified the function test_utils/set_preference to accommodate user_id."

It will help setting preferences in case user_id is other than 1(depending on the user which has been logged in).

How would that ever happen? When running the tests, we initialise a new settings database, so we're guaranteed that the user ID will be 1. If it isn't, something is wrong. 

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Patch for setting preferences with user id

От
Khushboo Vashi
Дата:


On Mon, Oct 8, 2018 at 4:18 PM Dave Page <dpage@pgadmin.org> wrote:
Hi
On Mon, Oct 8, 2018 at 9:08 AM Usman Muzaffar <usman.muzaffar@enterprisedb.com> wrote:
Hi Hackers,

Please find here attached patch for following

"modified the function test_utils/set_preference to accommodate user_id."

It will help setting preferences in case user_id is other than 1(depending on the user which has been logged in).

How would that ever happen? When running the tests, we initialise a new settings database, so we're guaranteed that the user ID will be 1. If it isn't, something is wrong. 

This is true for pgAdmin but not for PEM. 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Patch for setting preferences with user id

От
Dave Page
Дата:


On Mon, Oct 8, 2018 at 12:55 PM Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:


On Mon, Oct 8, 2018 at 4:18 PM Dave Page <dpage@pgadmin.org> wrote:
Hi
On Mon, Oct 8, 2018 at 9:08 AM Usman Muzaffar <usman.muzaffar@enterprisedb.com> wrote:
Hi Hackers,

Please find here attached patch for following

"modified the function test_utils/set_preference to accommodate user_id."

It will help setting preferences in case user_id is other than 1(depending on the user which has been logged in).

How would that ever happen? When running the tests, we initialise a new settings database, so we're guaranteed that the user ID will be 1. If it isn't, something is wrong. 

This is true for pgAdmin but not for PEM. 

And this is the pgAdmin project, not PEM :-)

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Patch for setting preferences with user id

От
Ashesh Vashi
Дата:
On Mon, Oct 8, 2018 at 5:25 PM Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:


On Mon, Oct 8, 2018 at 4:18 PM Dave Page <dpage@pgadmin.org> wrote:
Hi
On Mon, Oct 8, 2018 at 9:08 AM Usman Muzaffar <usman.muzaffar@enterprisedb.com> wrote:
Hi Hackers,

Please find here attached patch for following

"modified the function test_utils/set_preference to accommodate user_id."

It will help setting preferences in case user_id is other than 1(depending on the user which has been logged in).

How would that ever happen? When running the tests, we initialise a new settings database, so we're guaranteed that the user ID will be 1. If it isn't, something is wrong. 

This is true for pgAdmin but not for PEM. 
Currently - feature tests are running as the desktop (runtime) mode.
Tomorrow - if we want to enable the feature tests for the server mode, then - this approach could be useful.

FYI - I've not yet reviewed the patch though.

-- Thanks, Ashesh 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Patch for setting preferences with user id

От
Dave Page
Дата:


On Mon, Oct 8, 2018 at 1:00 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Mon, Oct 8, 2018 at 5:25 PM Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:


On Mon, Oct 8, 2018 at 4:18 PM Dave Page <dpage@pgadmin.org> wrote:
Hi
On Mon, Oct 8, 2018 at 9:08 AM Usman Muzaffar <usman.muzaffar@enterprisedb.com> wrote:
Hi Hackers,

Please find here attached patch for following

"modified the function test_utils/set_preference to accommodate user_id."

It will help setting preferences in case user_id is other than 1(depending on the user which has been logged in).

How would that ever happen? When running the tests, we initialise a new settings database, so we're guaranteed that the user ID will be 1. If it isn't, something is wrong. 

This is true for pgAdmin but not for PEM. 
Currently - feature tests are running as the desktop (runtime) mode.
Tomorrow - if we want to enable the feature tests for the server mode, then - this approach could be useful.

The tests can run in either mode.
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Patch for setting preferences with user id

От
Ashesh Vashi
Дата:
On Mon, Oct 8, 2018 at 5:36 PM Dave Page <dpage@pgadmin.org> wrote:


On Mon, Oct 8, 2018 at 1:00 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Mon, Oct 8, 2018 at 5:25 PM Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:


On Mon, Oct 8, 2018 at 4:18 PM Dave Page <dpage@pgadmin.org> wrote:
Hi
On Mon, Oct 8, 2018 at 9:08 AM Usman Muzaffar <usman.muzaffar@enterprisedb.com> wrote:
Hi Hackers,

Please find here attached patch for following

"modified the function test_utils/set_preference to accommodate user_id."

It will help setting preferences in case user_id is other than 1(depending on the user which has been logged in).

How would that ever happen? When running the tests, we initialise a new settings database, so we're guaranteed that the user ID will be 1. If it isn't, something is wrong. 

This is true for pgAdmin but not for PEM. 
Currently - feature tests are running as the desktop (runtime) mode.
Tomorrow - if we want to enable the feature tests for the server mode, then - this approach could be useful.

The tests can run in either mode.
No - currently it is running in the runtime mode only. :-)

-- Thanks, Ashesh 
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Patch for setting preferences with user id

От
Dave Page
Дата:


On Mon, Oct 8, 2018 at 1:08 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Mon, Oct 8, 2018 at 5:36 PM Dave Page <dpage@pgadmin.org> wrote:


On Mon, Oct 8, 2018 at 1:00 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Mon, Oct 8, 2018 at 5:25 PM Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:


On Mon, Oct 8, 2018 at 4:18 PM Dave Page <dpage@pgadmin.org> wrote:
Hi
On Mon, Oct 8, 2018 at 9:08 AM Usman Muzaffar <usman.muzaffar@enterprisedb.com> wrote:
Hi Hackers,

Please find here attached patch for following

"modified the function test_utils/set_preference to accommodate user_id."

It will help setting preferences in case user_id is other than 1(depending on the user which has been logged in).

How would that ever happen? When running the tests, we initialise a new settings database, so we're guaranteed that the user ID will be 1. If it isn't, something is wrong. 

This is true for pgAdmin but not for PEM. 
Currently - feature tests are running as the desktop (runtime) mode.
Tomorrow - if we want to enable the feature tests for the server mode, then - this approach could be useful.

The tests can run in either mode.
No - currently it is running in the runtime mode only. :-)

We have some tests that *only* run in server mode, such as the password change/recovery tests.
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Patch for setting preferences with user id

От
Ashesh Vashi
Дата:
On Mon, Oct 8, 2018 at 5:43 PM Dave Page <dpage@pgadmin.org> wrote:


On Mon, Oct 8, 2018 at 1:08 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Mon, Oct 8, 2018 at 5:36 PM Dave Page <dpage@pgadmin.org> wrote:


On Mon, Oct 8, 2018 at 1:00 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Mon, Oct 8, 2018 at 5:25 PM Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:


On Mon, Oct 8, 2018 at 4:18 PM Dave Page <dpage@pgadmin.org> wrote:
Hi
On Mon, Oct 8, 2018 at 9:08 AM Usman Muzaffar <usman.muzaffar@enterprisedb.com> wrote:
Hi Hackers,

Please find here attached patch for following

"modified the function test_utils/set_preference to accommodate user_id."

It will help setting preferences in case user_id is other than 1(depending on the user which has been logged in).

How would that ever happen? When running the tests, we initialise a new settings database, so we're guaranteed that the user ID will be 1. If it isn't, something is wrong. 

This is true for pgAdmin but not for PEM. 
Currently - feature tests are running as the desktop (runtime) mode.
Tomorrow - if we want to enable the feature tests for the server mode, then - this approach could be useful.

The tests can run in either mode.
No - currently it is running in the runtime mode only. :-)

We have some tests that *only* run in server mode, such as the password change/recovery tests.
Not the feature tests (only very few API test cases are for the server mode).

-- Thanks, Ashesh 
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Patch for setting preferences with user id

От
Dave Page
Дата:


On Mon, Oct 8, 2018 at 1:14 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Mon, Oct 8, 2018 at 5:43 PM Dave Page <dpage@pgadmin.org> wrote:


On Mon, Oct 8, 2018 at 1:08 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Mon, Oct 8, 2018 at 5:36 PM Dave Page <dpage@pgadmin.org> wrote:


On Mon, Oct 8, 2018 at 1:00 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Mon, Oct 8, 2018 at 5:25 PM Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:


On Mon, Oct 8, 2018 at 4:18 PM Dave Page <dpage@pgadmin.org> wrote:
Hi
On Mon, Oct 8, 2018 at 9:08 AM Usman Muzaffar <usman.muzaffar@enterprisedb.com> wrote:
Hi Hackers,

Please find here attached patch for following

"modified the function test_utils/set_preference to accommodate user_id."

It will help setting preferences in case user_id is other than 1(depending on the user which has been logged in).

How would that ever happen? When running the tests, we initialise a new settings database, so we're guaranteed that the user ID will be 1. If it isn't, something is wrong. 

This is true for pgAdmin but not for PEM. 
Currently - feature tests are running as the desktop (runtime) mode.
Tomorrow - if we want to enable the feature tests for the server mode, then - this approach could be useful.

The tests can run in either mode.
No - currently it is running in the runtime mode only. :-)

We have some tests that *only* run in server mode, such as the password change/recovery tests.
Not the feature tests (only very few API test cases are for the server mode).

Most of the test cases will run in server mode (though, yes the feature tests are excluded) - in fact we run 378 Python API tests in that mode against PG10; more with EPAS. However, my point stands; we don't need this patch in pgAdmin to run the tests in server mode. If PEM needs it, then it can go in PEM. We do not add code to pgAdmin unless it benefits pgAdmin.
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Patch for setting preferences with user id

От
Ashesh Vashi
Дата:
On Mon, Oct 8, 2018 at 5:53 PM Dave Page <dpage@pgadmin.org> wrote:


On Mon, Oct 8, 2018 at 1:14 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Mon, Oct 8, 2018 at 5:43 PM Dave Page <dpage@pgadmin.org> wrote:


On Mon, Oct 8, 2018 at 1:08 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Mon, Oct 8, 2018 at 5:36 PM Dave Page <dpage@pgadmin.org> wrote:


On Mon, Oct 8, 2018 at 1:00 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Mon, Oct 8, 2018 at 5:25 PM Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:


On Mon, Oct 8, 2018 at 4:18 PM Dave Page <dpage@pgadmin.org> wrote:
Hi
On Mon, Oct 8, 2018 at 9:08 AM Usman Muzaffar <usman.muzaffar@enterprisedb.com> wrote:
Hi Hackers,

Please find here attached patch for following

"modified the function test_utils/set_preference to accommodate user_id."

It will help setting preferences in case user_id is other than 1(depending on the user which has been logged in).

How would that ever happen? When running the tests, we initialise a new settings database, so we're guaranteed that the user ID will be 1. If it isn't, something is wrong. 

This is true for pgAdmin but not for PEM. 
Currently - feature tests are running as the desktop (runtime) mode.
Tomorrow - if we want to enable the feature tests for the server mode, then - this approach could be useful.

The tests can run in either mode.
No - currently it is running in the runtime mode only. :-)

We have some tests that *only* run in server mode, such as the password change/recovery tests.
Not the feature tests (only very few API test cases are for the server mode).

Most of the test cases will run in server mode (though, yes the feature tests are excluded) - in fact we run 378 Python API tests in that mode against PG10; more with EPAS. However, my point stands; we don't need this patch in pgAdmin to run the tests in server mode. If PEM needs it, then it can go in PEM. We do not add code to pgAdmin unless it benefits pgAdmin.
I am not saying whether this is really required for pgAdmin, or not.
I am only advocating in what situation it may required.

-- Thanks, Ashesh
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company