Fix tests in local environment#1416
Merged
josepjaume merged 4 commits intodecidim:masterfrom May 31, 2017
deivid-rodriguez:fix_tests_in_local_environment
Merged
Fix tests in local environment#1416josepjaume merged 4 commits intodecidim:masterfrom deivid-rodriguez:fix_tests_in_local_environment
josepjaume merged 4 commits intodecidim:masterfrom
deivid-rodriguez:fix_tests_in_local_environment
Conversation
Otherwise a nil asset is registered and causes precompilation to fail with this error: ``` Failure/Error: <%= stylesheet_link_tag 'application', media: 'all' %> ActionView::Template::Error: unknown filter type: nil ``` It didn't happen previously because assets were precompiled _before_ tests, and thus before the dummy feature with missing icon was registered. That's also why it doesn't happen in CI.
Since assets are now precompiled on first access, the first test might actually timeout. Let's make sure that doesn't happen.
Codecov Report
@@ Coverage Diff @@
## master #1416 +/- ##
=======================================
Coverage 95.42% 95.42%
=======================================
Files 428 428
Lines 7365 7365
=======================================
Hits 7028 7028
Misses 337 337 |
Contributor
|
Nice work @deivid-rodriguez! |
oriolgual
approved these changes
May 31, 2017
Contributor
|
@deivid-rodriguez I'm so sorry, didn't see this happening on my local environment. Thanks again, sorry I caused this :( |
josepjaume
approved these changes
May 31, 2017
Contributor
Author
|
No problem! :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎩 What? Why?
After #1392 I started getting a bunch of failures like the following when running the tests:
I investigated and the reason is that since assets are now pre-compiled on first access, by that time the dummy feature has already been registered. And since it doesn't provide an icon, a
nilasset is added for precompilation here, and things blow up.I fixed this by adding an icon to the dummy feature in f17035c.
After fixing it, I started getting the following failure on the first test being run:
This is because asset precompilation takes a while and poltergeist times out. I fixed that by specifying a high timeout to give asset precompilation time enough to happen successfully (e4b8763).
I also removed asset precompilation in CI before tests since I didn't see any reason to have tests behave differently depending on the environment (2dae166).
📌 Related Issues
None.
📋 Subtasks
None.
📷 Screenshots (optional)
None.
👻 GIF