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

Capture app warnings on test run #972

Merged
merged 1 commit into from
Jul 31, 2015

Conversation

bf4
Copy link
Member

@bf4 bf4 commented Jun 26, 2015

Once we fix the warnings we can easily flip the bit and make them fail the tests

MiniTest doesn't appear to have a before/after suite like RSpec does

I've set @capture_warnings = CaptureWarnings.new(fail_build = false). So, it'll just print 'em out. Once we smite them, we can set @capture_warnings = CaptureWarnings.new(fail_build = true)

Here's warnings copied from one of the Travis builds.

------------------------------ app warnings: ------------------------------
/home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer.rb:244: warning: private attribute?
/home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/fieldset.rb:21: warning: private attribute?
/home/travis/build/rails-api/active_model_serializers/test/fixtures/poro.rb:96: warning: method redefined; discarding old blog
/home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer.rb:105: warning: previous definition of blog was here
/home/travis/build/rails-api/active_model_serializers/test/fixtures/poro.rb:139: warning: method redefined; discarding old slug
/home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer.rb:41: warning: previous definition of slug was here
/home/travis/build/rails-api/active_model_serializers/test/fixtures/poro.rb:158: warning: method redefined; discarding old place
/home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer.rb:105: warning: previous definition of place was here
/home/travis/build/rails-api/active_model_serializers/test/fixtures/poro.rb:245: warning: method redefined; discarding old reviews
/home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer.rb:105: warning: previous definition of reviews was here
/home/travis/build/rails-api/active_model_serializers/test/fixtures/poro.rb:248: warning: method redefined; discarding old maker
/home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer.rb:105: warning: previous definition of maker was here
/home/travis/build/rails-api/active_model_serializers/test/action_controller/serialization_scope_name_test.rb:7: warning: method redefined; discarding old admin?
/home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer.rb:41: warning: previous definition of admin? was here
/home/travis/build/rails-api/active_model_serializers/test/action_controller/serialization_scope_name_test.rb:37: warning: method redefined; discarding old admin?
/home/travis/build/rails-api/active_model_serializers/test/action_controller/serialization_test.rb:111: warning: assigned but unused variable - author
/home/travis/build/rails-api/active_model_serializers/test/action_controller/serialization_test.rb:176: warning: (...) interpreted as grouped expression
/home/travis/build/rails-api/active_model_serializers/test/action_controller/serialization_test.rb:183: warning: (...) interpreted as grouped expression
/home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/adapter.rb:57: warning: mismatched indentations at 'end' with 'def' at 45
/home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/adapter/fragment_cache.rb:3: warning: loading in progress, circular require considered harmful - /home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/adapter.rb
    from /home/travis/build/rails-api/active_model_serializers/test/adapter/fragment_cache_test.rb:2:in `<top (required)>'
    from /home/travis/build/rails-api/active_model_serializers/test/adapter/fragment_cache_test.rb:3:in `<module:ActiveModel>'
    from /home/travis/build/rails-api/active_model_serializers/test/adapter/fragment_cache_test.rb:4:in `<class:Serializer>'
    from /home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/adapter.rb:1:in `<top (required)>'
    from /home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/adapter/fragment_cache.rb:1:in `<top (required)>'
    from /home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/adapter/fragment_cache.rb:2:in `<module:ActiveModel>'
    from /home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/adapter/fragment_cache.rb:3:in `<class:Serializer>'
/home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/adapter/json/fragment_cache.rb:4: warning: loading in progress, circular require considered harmful - /home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/adapter/json.rb
    from /home/travis/build/rails-api/active_model_serializers/test/adapter/json/belongs_to_test.rb:3:in `<top (required)>'
    from /home/travis/build/rails-api/active_model_serializers/test/adapter/json/belongs_to_test.rb:4:in `<module:ActiveModel>'
    from /home/travis/build/rails-api/active_model_serializers/test/adapter/json/belongs_to_test.rb:5:in `<class:Serializer>'
    from /home/travis/build/rails-api/active_model_serializers/test/adapter/json/belongs_to_test.rb:6:in `<class:Adapter>'
    from /home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/adapter/json.rb:1:in `<top (required)>'
    from /home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/adapter/json/fragment_cache.rb:1:in `<top (required)>'
    from /home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/adapter/json/fragment_cache.rb:2:in `<module:ActiveModel>'
    from /home/travis/build/rails-api/active_model_serializers/lib/active_model/serializer/adapter/json/fragment_cache.rb:3:in `<class:Serializer>'
    from /home/travis/build/rails-api/active_model_serializers/lib/active_model/seri
---------------------------------------------------------------------------

@bf4 bf4 force-pushed the capture_app_warnings branch from 5f22c66 to 6570fbf Compare July 14, 2015 01:52
@bf4 bf4 changed the title Capture app warnings on test run; fail if any Capture app warnings on test run Jul 14, 2015
Configure not to fail the test, for now
@bf4 bf4 force-pushed the capture_app_warnings branch from 6570fbf to e7174a7 Compare July 14, 2015 06:05
@bf4
Copy link
Member Author

bf4 commented Jul 23, 2015

@joaomdmoura Any thoughts on this?

@joaomdmoura
Copy link
Member

Hey @bf4, I haven't noticed this issue before. I didn't quite got the context with #789 😄
I understand the motivation on this, but is there any warnings happen right now?
I'm just jumping into a lot of different issues and comments, is hard to keep all contexts 😅 would be cool if you could explain more what we want to achieve with this :)

@bf4
Copy link
Member Author

bf4 commented Jul 30, 2015

Yes, there are warnings, which is why I've set @capture_warnings = CaptureWarnings.new(fail_build = false). So, it'll just print 'em out. Once we smite them, we can set @capture_warnings = CaptureWarnings.new(fail_build = true). (No relation to the previously linked issue. I've removed that, now.)

@joaomdmoura
Copy link
Member

awesome @bf4! Now I got it, totally agree, I'm merging it.

joaomdmoura added a commit that referenced this pull request Jul 31, 2015
Capture app warnings on test run
@joaomdmoura joaomdmoura merged commit 7bc1666 into rails-api:master Jul 31, 2015
@bf4 bf4 deleted the capture_app_warnings branch July 31, 2015 21:11
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.

2 participants