Re: [Django] #33685: Tests crash when using only a service name on PostgreSQL.

2022-05-13 Thread Django
#33685: Tests crash when using only a service name on PostgreSQL.
---+
 Reporter:  Shane Ambler   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  4.0
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Hasan Ramezani):

 > however, my draft patch is quite complex and the risk of introducing
 regressions in a stable version is too great,

 Agree with you.

 > I'd document that service names cannot be currently used for testing
 purposes and treat this as a new feature request.

 Sound good to me.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070180be774b5b-0b0cbb36-fa94-4588-9cfa-c7bea7bd6c4a-00%40eu-central-1.amazonses.com.


Re: [Django] #33685: Tests crash when using only a service name on PostgreSQL.

2022-05-13 Thread Django
#33685: Tests crash when using only a service name on PostgreSQL.
---+
 Reporter:  Shane Ambler   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  4.0
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Mariusz Felisiak):

 * cc: Hasan Ramezani, Carlton Gibson (added)


Comment:

 I've tried to implement this but all mechanism related with
 creating/cloning test databases are based on the database name. It's
 feasible, however, my draft patch is quite complex and the risk of
 introducing regressions in a stable version is too great, IMO. I'd
 document that service names cannot be currently used for testing purposes
 and treat this as a new feature request.

 For example:
 {{{#!diff
 diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt
 index c270f56942..ca6362a7a6 100644
 --- a/docs/ref/databases.txt
 +++ b/docs/ref/databases.txt
 @@ -165,6 +165,11 @@ password from the `password file`_, you must specify
 them in the
  Support for connecting by a service name, and specifying a password
 file
  was added.

 +.. warning::
 +
 +Using a service name for testing purposes is not supported. This
 +:ticket:`may be implemented later <33685>`.
 +
  Optimizing PostgreSQL's configuration
  -


 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070180bd1f0b05-74f4d857-7c5e-49e5-90b7-699559fc6301-00%40eu-central-1.amazonses.com.


Re: [Django] #33685: Tests crash when using only a service name on PostgreSQL.

2022-05-10 Thread Django
#33685: Tests crash when using only a service name on PostgreSQL.
---+
 Reporter:  Shane Ambler   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  4.0
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Mariusz Felisiak):

 Replying to [comment:11 Shane Ambler]:
 > Just a suggestion for whoever looks into this :
 >
 > I expect that the service name is being passed to psycopg2, making
 altering the dbname awkward, in that case I think prepending 'test_' to
 the service name would be a viable solution. Then the docs would show two
 service entries to support testing in the example.

 Agreed, I was thinking about the same solution. Unfortunately it's quite
 tricky to implement this duality :|

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070180ad4634f6-acf75fb6-f24f-42d7-a8e1-5706baa47d14-00%40eu-central-1.amazonses.com.


Re: [Django] #33685: Tests crash when using only a service name on PostgreSQL.

2022-05-10 Thread Django
#33685: Tests crash when using only a service name on PostgreSQL.
---+
 Reporter:  Shane Ambler   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  4.0
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Shane Ambler):

 Just a suggestion for whoever looks into this :

 I expect that the service name is being passed to psycopg2, making
 altering the dbname awkward, in that case I think prepending 'test_' to
 the service name would be a viable solution. Then the docs would show two
 service entries to support testing in the example.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070180ad1a2f2b-6fe90ff3-9d4d-4f6c-8d02-996dbd406be6-00%40eu-central-1.amazonses.com.


Re: [Django] #33685: Tests crash when using only a service name on PostgreSQL.

2022-05-10 Thread Django
#33685: Tests crash when using only a service name on PostgreSQL.
---+
 Reporter:  Shane Ambler   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  4.0
 Severity:  Release blocker|   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Mariusz Felisiak):

 * severity:  Normal => Release blocker


Comment:

 > It looks like it has been available in "main" for a bit over a year, but
 it is still "new" as it has only been available in one public release.

 Right, good point, it's a new feature so this ticket should be marked as a
 release blocker.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070180acb3c11f-4237aef5-2404-4336-95f5-6a933fc649e8-00%40eu-central-1.amazonses.com.


Re: [Django] #33685: Tests crash when using only a service name on PostgreSQL.

2022-05-10 Thread Django
#33685: Tests crash when using only a service name on PostgreSQL.
---+
 Reporter:  Shane Ambler   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  4.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Shane Ambler):

 Replying to [comment:8 Mariusz Felisiak]:

 > Using `['OPTIONS']['service']` and `['OPTIONS']['passfile']` is not a
 "new" or only supported way for the `DATABASES`  settings.

 It looks like it has been available in "main" for a bit over a year, but
 it is still "new" as it has only been available in one public release.
 Yes, the old (or generic) method still works and will work properly if it
 is the only config docs that you find.

 Using `['DATABASE']['NAME']` and `['DATABASE']['USER']` will work for
 runserver as well as test and they will override any service file
 settings.

 We shouldn't need to duplicate login details in two places to get basic
 functionality.

 I see having tests fail on the first tutorial as a big entry barrier for
 new users.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070180acaa65b3-43a21ce8-8023-4f14-9fe8-cdbb8ff44719-00%40eu-central-1.amazonses.com.


Re: [Django] #33685: Tests crash when using only a service name on PostgreSQL. (was: Using new postgresql settings fails when running tests)

2022-05-09 Thread Django
#33685: Tests crash when using only a service name on PostgreSQL.
---+
 Reporter:  Shane Ambler   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  4.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Mariusz Felisiak):

 * stage:  Unreviewed => Accepted


Comment:

 > While you are maintaining both old and new config variations, all will
 continue to work for you.
 >
 > If you remove the old, no longer documented, settings of `HOST` `PORT`
 `NAME` `USER` then your setup will work for `runserver` but not `test`
 > The pg docs [https://docs.djangoproject.com/en/4.0/ref/databases
 /#postgresql-notes-1] only documents the new method of specifying
 `service` and `passfile` in the `OPTIONS` ...

 Using `['OPTIONS']['service']` and `['OPTIONS']['passfile']` is not a
 "new" or only supported way for the `DATABASES`  settings. It's a
 PostgreSQL-specific option that you may use that's why it's documented
 only in the ''"PostgreSQL notes"''. Using `HOST`, `PORT`, `NAME`, `USER`,
 and `PASSWORD` is still fully supported for PostgreSQL, see
 [https://docs.djangoproject.com/en/4.0/ref/settings/#databases docs].

 > ... this documented setup **does not support running tests** with
 postgresql databases.

 `NAME` is used in many places for test setup, including cloning a test
 database, that's why it doesn't work with only `service` specified.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070180ac5b18e9-55855f80-9410-466b-83a0-83c92cbd738b-00%40eu-central-1.amazonses.com.