1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/test/config
Chris LaRose 64c0153cd0
Remove use of json gem (#2479)
* Add basic JSON serializer

For now, it only handles Arrays of Integers, but we'll extend it to
support all of the common types

* Serialize Strings

* Escape quotes in Strings

* Escape backslashes in Strings

* Serialize Hashes with String keys

* Extract method for serializing Strings

* Add test coverage for non-Hash non-Array JSON serialization

* Add test for unexpected key types

* Serialize Hashes with Symbol keys

* Raise on unexpected value types

* Serialize boolean values

* Serialize Floats

* Add module comment to Puma::JSON

* Update integration test to use fully-qualfied JSON module reference

* Remove json gem dependency from /stats status server response

Fixes a bug where requesting `/stats` from the status server would cause
subsequent phased restarts to fail when upgrading/downgrading the json
gem.

* Run gc_stats tests on JRuby

These were disabled at some point on JRuby, but they seem to run fine.
Importantly, this test ensures that a call to `/gc-stats` returns
well-formed JSON on JRuby, where the value of `GC.stat` contains nested
structures.

* Remove json gem dependency from /gc-stats status server response

Fixes a bug where requesting `/gc-stats` from the status server would cause
subsequent phased restarts to fail when upgrading/downgrading the json
gem.

* Remove json gem from /thread-backtraces status server response

Fixes a bug where requesting `/thread-backtraces` from the status server
would cause subsequent phased restarts to fail when
upgrading/downgrading the json gem.

* Remove json gem dependency from Puma.stats

Fixes a bug where accessing `Puma.stats` would cause subsequent phased
restarts to fail when upgrading/downgrading the json gem.

* Fix test name in json test

Co-authored-by: rmacklin <1863540+rmacklin@users.noreply.github.com>

* Add History entry

* Add test for exceptions on values of unexpected types

* Update test name for additional clarity

* Reorder cases to match order in ECMA-404

* Allow all serializable inputs in Puma::JSON::serialize

The pervious implementation was based on and older JSON standard which
defined JSON texts to be either objects or arrays. Modern JSON standands
allow all JSON values to be valid JSON texts.

* Update JSON tests to test value types directly

* Reorder tests to roughly match source order

* Add test for serializing integers as JSON

* Serialize nil as null

* Use block form of gsub instead of hash form

* Escape control characters as required by ECMA-404

* Collapse handling of Symbol and String into one case

* Extract constants used in string serialization

* Remove superflous else case

* Use stringio for incremental JSON construction

* Extract test helper for testing JSON serialization

* Assert that strings generated by Puma::JSON roundtrip when using ::JSON

* Use a recent version of the json gem in tests

`::JSON.parse` doesn't handle JSON texts other than objects and arrays
in old versions

* Handle default expected_roundtrip more explicitly for clarity

Co-authored-by: rmacklin <1863540+rmacklin@users.noreply.github.com>
2020-11-10 10:16:42 -07:00
..
ab_rs.rb sort configs/rackups/tests (#1268) 2017-04-11 14:08:18 -07:00
app.rb
control_no_token.rb Fixes the bug that wouldn't allow no_token be set to true (#1803) 2019-05-28 09:37:34 -04:00
cpu_spin.rb Inject small delay to improve requests distribution 2020-05-05 17:06:28 +02:00
custom_log_formatter.rb Allow to define a custom formatter for logs (#1816) 2019-08-01 12:21:23 -07:00
plugin1.rb PluginRegistry#fire_background - fix up per issue 1972 (#1973) 2019-09-18 15:53:29 +02:00
prune_bundler_print_json_defined.rb Remove use of json gem (#2479) 2020-11-10 10:16:42 -07:00
prune_bundler_with_deps.rb Fix Bundler::GemNotFound errors for nio4r gem (#2427) 2020-10-20 07:31:23 -06:00
prune_bundler_with_multiple_workers.rb Fix recursive prune_bundler 2020-07-27 15:02:11 +03:00
settings.rb Specified parameters should overwrite loaded config files 2017-01-30 20:29:19 -08:00
ssl_config.rb Allow mutual TLS CA to be set using ssl_bind DSL 2019-02-20 14:27:00 -06:00
state_file_testing_config.rb Let's use Rubocop! (#1325) 2017-06-04 13:21:05 -07:00
suppress_exception.rb add tests 2019-02-21 21:31:35 +01:00
t1_conf.rb [changelog skip] Move integration logging test to main test suite (#2240) 2020-04-29 15:06:11 +09:00
t2_conf.rb removed rackup from conf 2020-08-27 16:55:34 +05:30
t3_conf.rb [changelog skip] Move integration logging test to main test suite 2020-08-28 13:34:55 +05:30
with_float_convert.rb Revert "Revert "Adds configuration option to set max_fast_inline (#2406)"" 2020-10-26 15:59:30 -06:00
with_integer_convert.rb worker_timeout, worker_boot_timeout, worker_shutdown_timeout fix integer convert (#1450) 2018-03-19 15:05:15 -06:00
with_rackup_from_dsl.rb Prefer rackup file specified by CLI (#2236) 2020-04-28 08:15:33 +09:00
worker_shutdown_timeout_2.rb Update test_integration files per PR #1956 (#1965) 2019-09-19 19:37:53 +02:00