propelorm / Propel2

Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP
http://propelorm.org/
MIT License
1.26k stars 393 forks source link

setup postres tests without password prompt #1916

Closed mringler closed 1 year ago

mringler commented 1 year ago

While playing around with the postgres tests, I stumbled over having to enter the database password three times every time I ran the setup script, even though I provided the password in the designated DB_PW variable.

This can be remedied by registering connection in a .pgpass file or setting the PGPASSWORD variable, but having to change the system to run tests seamlessly should not be necessary. Fortunately, the issue can easily be addressed in the setup script. All we need to do is setting postgres' PGPASSWORD variable to the password in DB_PW before running dropdb, createdb and psql. I do that in a subshell, so the value of PGPASSWORD in the actual shell is not altered.

That's it, no more triple password prompt.

The gitlab workflows used the DB_PW+PGPASSWORD approach, let's see how it does without PGPASSWORD

codecov-commenter commented 1 year ago

Codecov Report

Base: 87.59% // Head: 88.41% // Increases project coverage by +0.81% :tada:

Coverage data is based on head (3205909) compared to base (fa19b97). Patch has no changes to coverable lines.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1916 +/- ## ============================================ + Coverage 87.59% 88.41% +0.81% - Complexity 7832 7849 +17 ============================================ Files 227 224 -3 Lines 21161 20981 -180 ============================================ + Hits 18537 18551 +14 + Misses 2624 2430 -194 ``` | Flag | Coverage Δ | | |---|---|---| | 5-max | `88.41% <ø> (+0.81%)` | :arrow_up: | | 7.4 | `88.41% <ø> (+0.81%)` | :arrow_up: | | agnostic | `67.28% <ø> (+0.35%)` | :arrow_up: | | mysql | `69.10% <ø> (+0.34%)` | :arrow_up: | | pgsql | `69.08% <ø> (+0.30%)` | :arrow_up: | | sqlite | `66.94% <ø> (+0.33%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/propelorm/Propel2/pull/1916?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm) | Coverage Δ | | |---|---|---| | [src/Propel/Runtime/Adapter/Pdo/SqliteAdapter.php](https://codecov.io/gh/propelorm/Propel2/pull/1916/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9SdW50aW1lL0FkYXB0ZXIvUGRvL1NxbGl0ZUFkYXB0ZXIucGhw) | `60.86% <0.00%> (-1.04%)` | :arrow_down: | | [...time/ServiceContainer/StandardServiceContainer.php](https://codecov.io/gh/propelorm/Propel2/pull/1916/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9SdW50aW1lL1NlcnZpY2VDb250YWluZXIvU3RhbmRhcmRTZXJ2aWNlQ29udGFpbmVyLnBocA==) | `83.00% <0.00%> (-0.66%)` | :arrow_down: | | [src/Propel/Common/Config/ConfigurationManager.php](https://codecov.io/gh/propelorm/Propel2/pull/1916/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9Db21tb24vQ29uZmlnL0NvbmZpZ3VyYXRpb25NYW5hZ2VyLnBocA==) | `97.82% <0.00%> (-0.03%)` | :arrow_down: | | [src/Propel/Runtime/ActiveQuery/ModelCriteria.php](https://codecov.io/gh/propelorm/Propel2/pull/1916/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9SdW50aW1lL0FjdGl2ZVF1ZXJ5L01vZGVsQ3JpdGVyaWEucGhw) | `96.29% <0.00%> (-0.01%)` | :arrow_down: | | [src/Propel/Generator/Application.php](https://codecov.io/gh/propelorm/Propel2/pull/1916/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9HZW5lcmF0b3IvQXBwbGljYXRpb24ucGhw) | `0.00% <0.00%> (ø)` | | | [src/Propel/Generator/Platform/DefaultPlatform.php](https://codecov.io/gh/propelorm/Propel2/pull/1916/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9HZW5lcmF0b3IvUGxhdGZvcm0vRGVmYXVsdFBsYXRmb3JtLnBocA==) | `94.10% <0.00%> (ø)` | | | [...c/Propel/Runtime/ActiveQuery/InstancePoolTrait.php](https://codecov.io/gh/propelorm/Propel2/pull/1916/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9SdW50aW1lL0FjdGl2ZVF1ZXJ5L0luc3RhbmNlUG9vbFRyYWl0LnBocA==) | `100.00% <0.00%> (ø)` | | | [...l/Runtime/Connection/ProfilerConnectionWrapper.php](https://codecov.io/gh/propelorm/Propel2/pull/1916/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9SdW50aW1lL0Nvbm5lY3Rpb24vUHJvZmlsZXJDb25uZWN0aW9uV3JhcHBlci5waHA=) | `0.00% <0.00%> (ø)` | | | [...nable/VersionableBehaviorObjectBuilderModifier.php](https://codecov.io/gh/propelorm/Propel2/pull/1916/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9HZW5lcmF0b3IvQmVoYXZpb3IvVmVyc2lvbmFibGUvVmVyc2lvbmFibGVCZWhhdmlvck9iamVjdEJ1aWxkZXJNb2RpZmllci5waHA=) | `0.00% <0.00%> (ø)` | | | [...ime/ServiceContainer/ServiceContainerInterface.php](https://codecov.io/gh/propelorm/Propel2/pull/1916/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9SdW50aW1lL1NlcnZpY2VDb250YWluZXIvU2VydmljZUNvbnRhaW5lckludGVyZmFjZS5waHA=) | | | | ... and [64 more](https://codecov.io/gh/propelorm/Propel2/pull/1916/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.