fedora-infra / fas

Fedora Account System
https://admin.fedoraproject.org/accounts
GNU General Public License v2.0
40 stars 50 forks source link

[FAS3] Discussion - How to handle postgres only testsuite #215

Closed skrzepto closed 3 years ago

skrzepto commented 7 years ago

Just wanted to start up a conversation to figure out the best way to do a postgres only test suite. I have a functional test suite but its sqlite only at the moment and some tests need to be updated to reflect the most recent changes in fas3. Reason for postgres only test suite can be found in #212

Here are some options I'm proposing

[1] https://github.com/tk0miya/testing.postgresql

But I had issues with inserting data, this might of changed since the last time i tried it. (https://github.com/tk0miya/testing.postgresql/issues/12). Also this introduces another dependency.

[2] Create a script that initializes the postgres db locally and have the unittests connect to it. Then use transactions to roll back the db to a predefined state for each test. Inspiration taken from (http://alextechrants.blogspot.com/2013/08/unit-testing-sqlalchemy-apps.html)

[3] Post other suggestions below.

pypingou commented 7 years ago

There is also http://faitout.fedorainfracloud.org/ which we could use, I still have on my list to make it a docker container so it's easier to run locally

skrzepto commented 7 years ago

Sweet I think I'll look into faitout for now but I think a local instance would be nice because unittests then won't have to be dependent on network connectivity.

Any preference on running the tests in various db? for example would something like a cmd argument be beneficial like --db=faitout or --db=pgsql?

ryanlerch commented 3 years ago

Closing this issue as the FAS project is now archived, not actively developed, and unmaintained.

FAS was replaced in March 2021 by Fedora Accounts (https://accounts.fedoraproject.org).

If this issue is a Feature Request that you forsee might be beneficial to Fedora Accounts, please refile it against Noggin