-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixtures: reana-db objects for session/engine #60
Merged
diegodelemos
merged 2 commits into
reanahub:master
from
diegodelemos:33-session-is-not-unique
Apr 30, 2020
Merged
fixtures: reana-db objects for session/engine #60
diegodelemos
merged 2 commits into
reanahub:master
from
diegodelemos:33-session-is-not-unique
Apr 30, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diegodelemos
pushed a commit
to mvidalgarcia/reana-server
that referenced
this pull request
Apr 29, 2020
2 tasks
diegodelemos
pushed a commit
to mvidalgarcia/reana-server
that referenced
this pull request
Apr 30, 2020
* Stops using `console_script` to define `reana-admin` commands as this was creating a new Flask application with its own db session, which makes testing difficult. * Depends on reanahub/pytest-reana#60 which avoids duplicating the session object. * REANA_SQLALCHEMY_DATABASE_URI is now defined in `run_tests.sh` because it needs to be setted before the Python modules are loaded, and this is because it is a module level defined variable (REANA-DB is not Flask aware, therefore we cannot dinamically change its value). This was not happening before because we had a duplicated session which would be created as pytest fixture with the Flask config `SQLALCHEMY_DATABASE_URI`, however this solution created more problems leading to inconsistencies in tests (double session).
diegodelemos
force-pushed
the
33-session-is-not-unique
branch
from
April 30, 2020 14:05
fc0b0a6
to
c3950f7
Compare
mvidalgarcia
approved these changes
Apr 30, 2020
mvidalgarcia
added a commit
to mvidalgarcia/reana-db
that referenced
this pull request
Apr 30, 2020
- Prevent creating a new UserToken when granting token to a user that had requested it (setter). - UserToken token can be None, in fact it's None when is 'requested'. - Adapt tests to reanahub/pytest-reana#60
mvidalgarcia
added a commit
to mvidalgarcia/reana-db
that referenced
this pull request
Apr 30, 2020
- Prevent creating a new UserToken when granting token to a user that had requested it (setter). - UserToken token can be None, in fact it's None when is 'requested'. - Adapt tests to reanahub/pytest-reana#60
mvidalgarcia
added a commit
to mvidalgarcia/reana-db
that referenced
this pull request
Apr 30, 2020
- Prevent creating a new UserToken when granting token to a user that had requested it (setter). - UserToken token can be None, in fact it's None when is 'requested'. - Adapt tests to reanahub/pytest-reana#60
mvidalgarcia
added a commit
to mvidalgarcia/reana-server
that referenced
this pull request
Apr 30, 2020
Co-authored-by: Diego Rodriguez <diego.rodriguez@cern.ch> tests: provide correct config to test flask app * Stops using `console_script` to define `reana-admin` commands as this was creating a new Flask application with its own db session, which makes testing difficult. * Depends on reanahub/pytest-reana#60 which avoids duplicating the session object. * REANA_SQLALCHEMY_DATABASE_URI is now defined in `run_tests.sh` because it needs to be setted before the Python modules are loaded, and this is because it is a module level defined variable (REANA-DB is not Flask aware, therefore we cannot dinamically change its value). This was not happening before because we had a duplicated session which would be created as pytest fixture with the Flask config `SQLALCHEMY_DATABASE_URI`, however this solution created more problems leading to inconsistencies in tests (double session).
mvidalgarcia
added a commit
to mvidalgarcia/reana-server
that referenced
this pull request
Apr 30, 2020
Co-authored-by: Diego Rodriguez <diego.rodriguez@cern.ch> tests: provide correct config to test flask app * Stops using `console_script` to define `reana-admin` commands as this was creating a new Flask application with its own db session, which makes testing difficult. * Depends on reanahub/pytest-reana#60 which avoids duplicating the session object. * REANA_SQLALCHEMY_DATABASE_URI is now defined in `run_tests.sh` because it needs to be setted before the Python modules are loaded, and this is because it is a module level defined variable (REANA-DB is not Flask aware, therefore we cannot dinamically change its value). This was not happening before because we had a duplicated session which would be created as pytest fixture with the Flask config `SQLALCHEMY_DATABASE_URI`, however this solution created more problems leading to inconsistencies in tests (double session).
mvidalgarcia
added a commit
to mvidalgarcia/reana-server
that referenced
this pull request
Apr 30, 2020
tests: provide correct config to test flask app * Stops using `console_script` to define `reana-admin` commands as this was creating a new Flask application with its own db session, which makes testing difficult. * Depends on reanahub/pytest-reana#60 which avoids duplicating the session object. * REANA_SQLALCHEMY_DATABASE_URI is now defined in `run_tests.sh` because it needs to be setted before the Python modules are loaded, and this is because it is a module level defined variable (REANA-DB is not Flask aware, therefore we cannot dinamically change its value). This was not happening before because we had a duplicated session which would be created as pytest fixture with the Flask config `SQLALCHEMY_DATABASE_URI`, however this solution created more problems leading to inconsistencies in tests (double session). Co-authored-by: Diego Rodriguez <diego.rodriguez@cern.ch>
mvidalgarcia
added a commit
to mvidalgarcia/reana-server
that referenced
this pull request
Apr 30, 2020
tests: provide correct config to test flask app * Stops using `console_script` to define `reana-admin` commands as this was creating a new Flask application with its own db session, which makes testing difficult. * Depends on reanahub/pytest-reana#60 which avoids duplicating the session object. * REANA_SQLALCHEMY_DATABASE_URI is now defined in `run_tests.sh` because it needs to be setted before the Python modules are loaded, and this is because it is a module level defined variable (REANA-DB is not Flask aware, therefore we cannot dinamically change its value). This was not happening before because we had a duplicated session which would be created as pytest fixture with the Flask config `SQLALCHEMY_DATABASE_URI`, however this solution created more problems leading to inconsistencies in tests (double session). Co-authored-by: Diego Rodriguez <diego.rodriguez@cern.ch>
mvidalgarcia
added a commit
to mvidalgarcia/reana-server
that referenced
this pull request
May 1, 2020
tests: provide correct config to test flask app * Stops using `console_script` to define `reana-admin` commands as this was creating a new Flask application with its own db session, which makes testing difficult. * Depends on reanahub/pytest-reana#60 which avoids duplicating the session object. * REANA_SQLALCHEMY_DATABASE_URI is now defined in `run_tests.sh` because it needs to be setted before the Python modules are loaded, and this is because it is a module level defined variable (REANA-DB is not Flask aware, therefore we cannot dinamically change its value). This was not happening before because we had a duplicated session which would be created as pytest fixture with the Flask config `SQLALCHEMY_DATABASE_URI`, however this solution created more problems leading to inconsistencies in tests (double session). Co-authored-by: Diego Rodriguez <diego.rodriguez@cern.ch>
mvidalgarcia
added a commit
to mvidalgarcia/reana-server
that referenced
this pull request
May 1, 2020
tests: provide correct config to test flask app * Stops using `console_script` to define `reana-admin` commands as this was creating a new Flask application with its own db session, which makes testing difficult. * Depends on reanahub/pytest-reana#60 which avoids duplicating the session object. * REANA_SQLALCHEMY_DATABASE_URI is now defined in `run_tests.sh` because it needs to be setted before the Python modules are loaded, and this is because it is a module level defined variable (REANA-DB is not Flask aware, therefore we cannot dinamically change its value). This was not happening before because we had a duplicated session which would be created as pytest fixture with the Flask config `SQLALCHEMY_DATABASE_URI`, however this solution created more problems leading to inconsistencies in tests (double session). Co-authored-by: Diego Rodriguez <diego.rodriguez@cern.ch>
mvidalgarcia
added a commit
to mvidalgarcia/reana-db
that referenced
this pull request
May 1, 2020
- Prevent creating a new UserToken when granting token to a user that had requested it (setter). - UserToken token can be None, in fact it's None when is 'requested'. - Adapt tests to reanahub/pytest-reana#60
mvidalgarcia
added a commit
to mvidalgarcia/reana-server
that referenced
this pull request
May 1, 2020
tests: provide correct config to test flask app * Stops using `console_script` to define `reana-admin` commands as this was creating a new Flask application with its own db session, which makes testing difficult. * Depends on reanahub/pytest-reana#60 which avoids duplicating the session object. * REANA_SQLALCHEMY_DATABASE_URI is now defined in `run_tests.sh` because it needs to be setted before the Python modules are loaded, and this is because it is a module level defined variable (REANA-DB is not Flask aware, therefore we cannot dinamically change its value). This was not happening before because we had a duplicated session which would be created as pytest fixture with the Flask config `SQLALCHEMY_DATABASE_URI`, however this solution created more problems leading to inconsistencies in tests (double session). Co-authored-by: Diego Rodriguez <diego.rodriguez@cern.ch>
mvidalgarcia
added a commit
to mvidalgarcia/reana-server
that referenced
this pull request
May 1, 2020
tests: provide correct config to test flask app * Stops using `console_script` to define `reana-admin` commands as this was creating a new Flask application with its own db session, which makes testing difficult. * Depends on reanahub/pytest-reana#60 which avoids duplicating the session object. * REANA_SQLALCHEMY_DATABASE_URI is now defined in `run_tests.sh` because it needs to be setted before the Python modules are loaded, and this is because it is a module level defined variable (REANA-DB is not Flask aware, therefore we cannot dinamically change its value). This was not happening before because we had a duplicated session which would be created as pytest fixture with the Flask config `SQLALCHEMY_DATABASE_URI`, however this solution created more problems leading to inconsistencies in tests (double session). Co-authored-by: Diego Rodriguez <diego.rodriguez@cern.ch>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #33.