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

Enable multitenancy in test (CI) #989

Merged
merged 5 commits into from May 3, 2017

Conversation

atz
Copy link
Contributor

@atz atz commented Apr 25, 2017

No description provided.

@atz atz changed the title Enable multitenancy in test (CI) [WIP] Enable multitenancy in test (CI) Apr 25, 2017
@atz atz force-pushed the mutlitenancy_in_test branch 8 times, most recently from 146db52 to 8681179 Compare May 1, 2017 23:37
@atz atz changed the title [WIP] Enable multitenancy in test (CI) Enable multitenancy in test (CI) May 1, 2017
allow(Settings.multitenancy).to receive(:admin_host).and_return('localhost')
end

context 'with multitenancy', multitenant: true do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove multitenant?


# There are 3 optional flags available to a test block. Only ONE will be active
# at any given time. They are (with areas of likely use):
# :multitenant - general case default, only needs to be explicit for types described below
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we collapse this to a single setting? tenancy: :single, tenancy: :multi, tenancy: :fake?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I felt like there were going to be more modes added regularly, I would. That doesn't seem likely.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern is that one could set both :multitenant and :singletenant and the behavior would be undefined.

@jcoyne
Copy link
Member

jcoyne commented May 2, 2017

Should this all be squashed to a single commit?

@atz
Copy link
Contributor Author

atz commented May 2, 2017

I did a ton of squashing already. There are distinct changes, in particular chronicling enabling the basic setting and then correcting components along the way. It could be any number of commits, but the fewest I would do would be 5.

atz added 5 commits May 2, 2017 15:17
This will break, but we should push through to make this the default.
These would only affect Travis.
**:singletenant**

This is effectively the reverse of `:multitenant`.  It is the cheapest
way to fix existing tests that would fail under multitenant default.

Singletenant tests

- Feature test default singletenant
- riiif specs are singletenant
- appearances_controller_spec.rb
- groups_controller_spec.rb

That's how all these were written.

**faketenant**

Specifically tests that don't care about single or multi-tenancy, they
just want there to seem like there is a consistent real tenant.

Give all controller tests faketenant unlesss otherwise specified
Because the tenant is going to be required for basic routing.
@atz
Copy link
Contributor Author

atz commented May 2, 2017

@jcoyne squashed down to 5 logically distinct commits.

@mjgiarlo
Copy link
Member

mjgiarlo commented May 2, 2017

@jcoyne re-review?


# There are 3 optional flags available to a test block. Only ONE will be active
# at any given time. They are (with areas of likely use):
# :multitenant - general case default, only needs to be explicit for types described below
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern is that one could set both :multitenant and :singletenant and the behavior would be undefined.

@atz
Copy link
Contributor Author

atz commented May 3, 2017

@jcoyne No, the result IS defined, by the conditional. Multitenant would "win".

@atz
Copy link
Contributor Author

atz commented May 3, 2017

Unless anybody wants to concur w/ Justin that reorganizing the flags to be values of single flag is worth blocking this over (I agree w/ him in principle, I just don't think it is worth blocking over), then with due respect, I would proceed on basis of Mike's approval.

@mjgiarlo
Copy link
Member

mjgiarlo commented May 3, 2017

@atz :shipit:

@atz atz merged commit 97c8a43 into account_creation_validation May 3, 2017
@atz atz deleted the mutlitenancy_in_test branch May 3, 2017 21:23
@atz atz removed the in progress label May 3, 2017
@atz atz restored the mutlitenancy_in_test branch May 11, 2017 23:05
@atz atz mentioned this pull request May 11, 2017
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.

None yet

3 participants