-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Tests fail after the first run #109
Comments
Yeah, that does seem like a problem. 100% line coverage isn't incredibly important, but most code paths should probably be. Here's a coverage report I just ran on my
There's definitely room for improvement, especially with those 0% covered files... |
I noticed this yesterday, I thought it was my own fault as I had added some features and was searching for bugs. I happened to run docker-compose down and then up and they all passed again. |
Looking a bit further into it, the issue should be fixed by #107 and this change needed in @@ -36,8 +36,8 @@ def authentication_token_from_email(email):
if not user:
user_in = UserCreate(username=email, email=email, password=password)
user = crud.user.create(db_session=db_session, obj_in=user_in)
else:
user_in = UserUpdate(password=password)
- user = crud.user.update(db_session, obj_in=user, db_obj=user_in)
+ user = crud.user.update(db_session, obj_in=user_in, db_obj=user)
return user_authentication_headers(get_server_api(), email, password) |
Hey there! It seems this was solved in #106 , right?
|
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues. |
Bumps [pulumi/actions](https://github.com/pulumi/actions) from 3 to 5. - [Release notes](https://github.com/pulumi/actions/releases) - [Changelog](https://github.com/pulumi/actions/blob/main/CHANGELOG.md) - [Commits](pulumi/actions@v3...v5) --- updated-dependencies: - dependency-name: pulumi/actions dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
I got very confused by the tests that were always passing in CI, but failing in my local dev environment.
After trying a variety of ideas, it turns out that the first test run after pruning all docker images and containers passes, but subsequent ones fail with:
in two tests:
test_get_users_normal_user_me
andtest_create_user_by_normal_user
.To reproduce, simply run the tests twice in a row from a fresh install. The first run will pass, the second one will fail.
To "reset" the tests,
docker-compose exec db psql -U postgres
and\c app
thendelete from public.user where id>1;
and the tests will pass again.I suspect this might have to do with some dependency that changed its api at some point, and the change didn't get caught in CI because this code path is not actually tested.
The text was updated successfully, but these errors were encountered: