Commit Graph

32 Commits

Author SHA1 Message Date
L. Preston Sego III
6ed499f38e added active record benchmark (#1919)
* added active record benchmark

* address bf4's feedbock

* fix spacing
2016-09-24 16:39:29 -04:00
Lee Richmond
07dab5a054 Add helpful testing gems
Addresses https://github.com/rails-api/active_model_serializers/pull/1911#discussion_r77548416
2016-09-05 18:27:58 -04:00
Ben Mills
d900b09f8d
Upgrade to rubocop ~> 0.40.0 2016-06-01 09:21:29 -06:00
Ben Mills
446c2d486c
Pin rubocop to 0.39.0 2016-05-10 18:25:01 -06:00
Ben Mills
89e0a39fbb Drop support for Rails 4.0 and Ruby 2.0.0 2016-04-04 11:41:35 -06:00
Benjamin Fleischer
21b2eff2ab Improvements from Rails plugin template 2016-04-01 05:39:03 -05:00
Benjamin Fleischer
4cc454d49b Setup benchmarking structure
- Setup dummy app files in `test/dummy`
- Setup dummy test server `bin/serve_dummy
  - Note:  Serializer caching can be completely disabled by passing in
  `CACHE_ON=off bin/serve_dummy start` since Serializer#_cache is only
  set at boot.
- run with
  - ./bin/bench
  - `bin/bench` etc adapted from ruby-bench-suite
  - target files are `test/dummy/bm_*.rb`. Just add another to run it.
  - benchmark cache/no cache
  - remove rake dependency that loads unnecessary files
- remove git gem dependency
  - Running over revisions to be added in subsequent PR
2016-03-09 12:42:25 -06:00
João Moura
952ab0438f AMS Benchmark tests #832
Adding a benchmak test structure to help contributors to keep track
of how their PR will impact overall performance.

It enables developers to create test inside of tests/benchmark.

This implementation adds a rake task: ```rake benchmark``` that checkout
one commit before, run the test of  tests/benchmark, then mover back to
the last commit and run it again. By comparing the benchmark results between
both commits the contributor will notice if and how much  his contribution
will impact overall performance.
2016-03-09 12:42:25 -06:00
Benjamin Fleischer
ec36ab7f60 Update Rubocop 2016-03-08 22:32:34 +01:00
Benjamin Fleischer
7b98cf3e36 Update SimpleCov; remove compatibility patch
Also, SimpleCov.start already called
   SimpleCov.pid = Process.pid
So, no need for that
2016-02-09 20:59:31 -06:00
Benjamin Fleischer
3b87cb3593 Patch ActionController::TestCase#assigns for Rails5 2015-11-25 21:56:01 -06:00
Benjamin Fleischer
7d707aabdc Update Gemfile/gemspec dependencies for Rails 5/master 2015-11-25 21:56:01 -06:00
Lucas Hosseini
29c3448922 Better reporter for tests. 2015-10-06 02:15:29 +02:00
Benjamin Fleischer
bd80c1942b Simplify Windows platform identification
Platforms map available at https://github.com/bundler/bundler/blob/master/lib/bundler/dependency.rb
2015-09-24 00:31:21 +02:00
Benjamin Fleischer
d9e76c29d5 Make Adapters registerable so they are not namespace-constrained
Changes:

- Introduce Adapter::get for use by Serializer.adapter
- Move Adapter-finding logic from Adapter::adapter_class into Adapter::get

Introduced interfaces:

- non-inherited methods
```ruby
ActiveModel::Serializer::Adapter.adapter_map     # a Hash<adapter_name, adapter_class>
ActiveModel::Serializer::Adapter.adapters        # an Array<adapter_name>
ActiveModel::Serializer::Adapter.register(name, klass) # adds an adapter to the adapter_map
ActiveModel::Serializer::Adapter.get(name_or_klass)    # raises Argument error when adapter not found
```

- Automatically register adapters when subclassing

```ruby
      def self.inherited(subclass)
        ActiveModel::Serializer::Adapter.register(subclass.to_s.demodulize, subclass)
      end
```

- Preserves subclass method `::adapter_class(adapter)`

```ruby
      def self.adapter_class(adapter)
        ActiveModel::Serializer::Adapter.get(adapter)
      end
```

- Serializer.adapter now uses `Adapter.get(config.adapter)` rather than have duplicate logic
2015-09-08 22:59:36 -05:00
Eric Guo
70702f0af3 Add windows platform to loading sqlite3 to make testing suite pass, which caused by #1105 2015-09-07 14:19:57 +08:00
Benjamin Fleischer
c401722c10 Add codeclimate test reporter (CI only)
requires repo admin to add
CODECLIMATE_REPO_TOKEN
to the CI env
2015-09-06 09:19:07 -05:00
Benjamin Fleischer
94469be1ca Add test coverage; account for no artifacts on CI
Drop coverage a bit for JRuby and Rubinius because they
don't generate the same Coverage as CRuby
2015-09-06 09:19:07 -05:00
Benjamin Fleischer
09c97de90d Add Style enforcer (via Rubocop)
It will fail the build, but as it is currently,
most of the cops are 'todos'. Great for new contributors.. :)
2015-09-03 20:50:45 -05:00
Lucas Hosseini
83f11acd66 Add Gemfile dependencies to ActiveRecord and sqlite3. 2015-08-31 06:19:16 +02:00
Benjamin Fleischer
e3d3d92201 Clarify AMS dependencies 2015-08-30 22:26:25 -05:00
Eric Guo
30463f88fa Make testing suite running and pass in Windows
thanks @bf4 give many help and suggestion, original PR https://github.com/rails-api/active_model_serializers/pull/1014
2015-08-21 21:07:52 +08:00
Tony Ta
b224d50005 removes test env for incompatible Rails 3.2 and adds Rails 4.2
gemspec requires "rails" and "activemodel, ">= 4.0", so testing
on 3.2 will always fail to resolve dependencies.

adds and defaults to Rails 4.2 when RAILS_VERSION is not specified
2015-04-26 18:16:07 -07:00
Steve Klabnik
ed5499e318 UUUUGH.
This versioning situation sucks.
2014-07-09 17:06:00 -04:00
Steve Klabnik
4cc2060ea4 Depend on minitest 5 2014-07-09 16:53:26 -04:00
Steve Klabnik
a45b5eeda3 Fix link to arel.
ugh.
2014-07-05 13:17:31 -04:00
Steve Klabnik
38ba3cfd0b Add extra declaration on arel because Rails is silly.
https://github.com/rails/rails/issues/16063#issuecomment-48090125
2014-07-05 12:37:59 -04:00
Steve Klabnik
0a81984ab5 Default to Rails 4.1 2014-07-05 12:20:14 -04:00
Steve Klabnik
b08b3c4caa 😅
Rails ~>4.0 is 4.1. :grimace:
2014-07-05 12:10:03 -04:00
Steve Klabnik
a5107b32e2 Set up the test helper and Gemfile.
Now Travis will build across all the Rails-es.
2014-07-05 12:03:48 -04:00
Steve Klabnik
99e3d0f70b Set up minitest 2014-07-05 11:55:45 -04:00
Steve Klabnik
c718915075 Generate a basic gem 2014-07-05 00:53:48 -04:00