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
Order independent tests #4805
Order independent tests #4805
Conversation
@@ -19,6 +19,10 @@ def add(resource) | |||
end | |||
end | |||
|
|||
def delete(resource) | |||
@collection.reject! { |k| k == resource.resource_name } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely!
However, this is the only change affecting the actual code in lib
and it's not really in the scope of this PR. I only added it while debugging some failures but it's not really necessary. So I'd say it's best to just remove it.
764be57
to
91f0ec0
Compare
Ok, the specs now seem to be consistently passing with random order enabled. Tentatively removing the WIP (until Travis proves me wrong 😄). |
Found one more failure locally, restoring WIP. |
91f0ec0
to
9111497
Compare
Ok, it should be fixed now, let's wait for CI. |
.travis.yml
Outdated
branches: | ||
only: | ||
- master | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ae1cbbe
to
f2e3d86
Compare
CI hurt, that's good. Will fix the remaining issues it surfaced as soon as possible. |
@deivid-rodriguez , looks like this almost finished, 👍 , few bugs to go |
f3b0e70
to
0958ec0
Compare
Did another pass. Now it's really really close to green. |
Two more fixes pushed... This time it might pass. |
Travis passed! Yay! Codecov is failing but it's unrelated to this PR. My guess is that the last commit was pushed directly to master, codecov didn't generate a report for it, and now it can't find a base report to compare this against. If that's the case, one more reason to not commit directly to master! 😉 Anyways, sorry for the length of the PR, but this was a big project. Anyone up for reviewing? |
good job 👍 |
8089df6
to
08cf60d
Compare
Pushed an extra tiny fix. Travis will have one last opportunity to surface more issues :) |
end | ||
it "should fallback to edit" do | ||
expect(auto_link(post)).to \ | ||
match(%r{<a href="/admin/posts/\d+/edit">Hello World</a>}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deivid-rodriguez , are you sure we can completely remove locale=en
?
this was reasonable introduced here #4766
please take a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I accidentally removed that while refactoring. The test description was not related to locales, so I forgot to re-add it. I think those tests should be separate from the "normal case" because otherwise we don't test the "normal case". So I added be2d300, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deivid-rodriguez , sure
spec/unit/auto_link_spec.rb
Outdated
expect(self).to receive(:url_for) { |url| url } | ||
expect(self).to receive(:link_to).with "Hello World", url_path | ||
auto_link(post) | ||
expect(auto_link(post)).to \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reproducible with ``` rspec \ ./spec/unit/pretty_format_spec.rb[1:7:2:2:1] \ ./spec/unit/view_helpers/display_helper_spec.rb[1:2:10] \ --seed 1234 ```
Fixes ``` rspec ./spec/unit/resource_registration_spec.rb[1:1:2] ```
Fixes ``` rspec ./spec/unit/authorization/index_overriding_spec.rb[1:1] ```
Prefer symbols.
For example ``` ./spec/unit/auto_link_spec.rb:4:in `block in <top (required)>': uninitialized constant ActiveAdmin::ViewHelpers::ActiveAdminApplicationHelper (NameError) ``` or ``` ./lib/active_admin/views/components/paginated_collection.rb:118:in `<class:PaginatedCollection>': uninitialized constant ActiveAdmin::ViewHelpers::DownloadFormatLinksHelper (NameError) ```
Fixes ``` rspec \ ./spec/unit/authorization/index_overriding_spec.rb[1:1] \ ./spec/unit/resource/routes_spec.rb[1:1:3] \ --seed 50491 ```
Fixes ``` rspec \ ./spec/unit/belongs_to_spec.rb[1:4:1] \ ./spec/unit/namespace/register_resource_spec.rb[1:5:4:1:1] \ --seed 43047 ```
They lead to leaking state very easily.
Fixes ``` rspec \ ./spec/unit/belongs_to_spec.rb[1:2:2:1] \ ./spec/unit/resource/routes_spec.rb[1:6:1:1] \ --seed 60387 ```
And properly include it.
Extend it instead. Fixes ``` rspec \ ./spec/unit/authorization/controller_authorization_spec.rb[1:2] \ ./spec/unit/views/components/index_list_spec.rb[1:1:1:1] \ --seed 42890 ```
Fixes ``` rspec \ ./spec/unit/auto_link_spec.rb[1:1:1] \ ./spec/unit/dsl_spec.rb[1:4:2] \ --seed 11315 ```
Fixes ``` rspec \ ./spec/unit/auto_link_spec.rb[1:1:1] \ ./spec/unit/resource_controller/data_access_spec.rb[1:5:1] \ --seed 12654 ```
Fixes ``` rspec \ ./spec/unit/auto_link_spec.rb[1:1:1] \ ./spec/unit/resource_controller_spec.rb[1:2:2] \ --seed 45595 ```
be2d300
to
45a51da
Compare
@timoschilling , looks like ready to merge |
@Fivell Yes, I did that work locally but tests wouldn't pass. I'll check again after merging this, hopefully this fixes that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Good work 🎉 |
Thanks!! :) |
Just a WIP for now.