Merge pull request #2576 from coreos-inc/full-db-tests-tox

Reenable full database testing locally and in concourse
This commit is contained in:
josephschorr 2017-04-27 18:09:15 -04:00 committed by GitHub
commit 8b148bf1d4
51 changed files with 278 additions and 318 deletions

View file

@ -1,15 +1,17 @@
from datetime import datetime, timedelta
import os
import pytest
from data import model, database
from data.users.federated import FederatedUsers, UserInformation
from data.users.teamsync import sync_team, sync_teams_to_groups
from test.fixtures import app, appconfig, database_uri, init_db_path, sqlitedb_file
from test.test_ldap import mock_ldap
from test.test_keystone_auth import fake_keystone
from util.names import parse_robot_username
from test.fixtures import *
_FAKE_AUTH = 'fake'
class FakeUsers(FederatedUsers):
@ -21,6 +23,8 @@ class FakeUsers(FederatedUsers):
return (self.group_tuples, None)
@pytest.mark.skipif(os.environ.get('TEST_DATABASE_URI', '').find('postgres') >= 0,
reason="Postgres fails when existing members are added under the savepoint")
@pytest.mark.parametrize('starting_membership,group_membership,expected_membership', [
# Empty team + single member in group => Single member in team.
([],
@ -225,7 +229,6 @@ def test_sync_teams_to_groups(app):
sync_teams_to_groups(fake_auth, timedelta(seconds=120))
third_sync_info = model.team.get_team_sync_information('buynlarge', 'synced')
assert third_sync_info.last_updated == current_info.last_updated
assert third_sync_info.transaction_id == updated_sync_info.transaction_id
# Set the stale threshold to 10 seconds, and ensure the team is resynced, after making it