Skip to content
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

Wait for migrations #267

Merged
merged 3 commits into from
Apr 1, 2020
Merged

Wait for migrations #267

merged 3 commits into from
Apr 1, 2020

Conversation

OtisRed
Copy link
Contributor

@OtisRed OtisRed commented Mar 25, 2020

For some time now we've been talking about the problem with migrations when backend containter stands up quicker than db container. @magul suggested how it should go and...

original

... seems to work :D

@OtisRed
Copy link
Contributor Author

OtisRed commented Mar 25, 2020

@w1stler maybe you would know what happened here? It worked locally

=================================== FAILURES ===================================
____________________________ test_populate_database ____________________________
script = <flask.cli.ScriptInfo object at 0x7f436d976d30>
    def test_populate_database(script):
        """Test populate_database command."""
        runner = CliRunner()
        result = runner.invoke(populate_database, obj=script)
        app = script._loaded_app
>       assert result.exit_code == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = <Result IntegrityError('(sqlite3.IntegrityError) UNIQUE constraint failed: user.username')>.exit_code
tests/test_commands.py:24: AssertionError
----------------------------- Captured stderr call -----------------------------

@magul
Copy link
Member

magul commented Mar 31, 2020

Where did you encounter this error @OtisRed ? Is this pull request blocked by this question?

@magul
Copy link
Member

magul commented Mar 31, 2020

(BTW, as that's not a scope of this pull request - shouldn't we remove flask db migrate from here? as it's responsible for creating new migrations and probably creating them explicitly could be considered beneficial. What do you think @stanislawK ?)

@OtisRed
Copy link
Contributor Author

OtisRed commented Apr 1, 2020

@magul in reference to the first question it was the built error in travis. I forgot to delete it, as re-run resolved it. Sometimes factoryboy generates the same values in fields with unique constraint and then travis fails, while testing.

@magul magul merged commit 275611d into CodeForPoznan:master Apr 1, 2020
@OtisRed OtisRed mentioned this pull request May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants