1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Removes debug info from tests by default (#2948)

* Removes debug info from tests by default

Much quieter/less confusing test output for newbies

Keeps it on in CI

* PUMA_DEBUG -> PUMA_TEST_DEBUG

Co-authored-by: MSP-Greg <Greg.mpls@gmail.com>
This commit is contained in:
Nate Berkopec 2022-09-11 14:33:04 +09:00 committed by GitHub
parent 1576f9bf71
commit 528912e9eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 5 deletions

View file

@ -16,6 +16,7 @@ jobs:
env:
CI: true
TESTOPTS: -v
PUMA_TEST_DEBUG: true
PUMA_NO_RUBOCOP: true
PUMA_CI_RACK_2: true

View file

@ -17,6 +17,7 @@ jobs:
ragel ${{ matrix.os }} ${{ matrix.ruby }}
env:
PUMA_NO_RUBOCOP: true
PUMA_TEST_DEBUG: true
runs-on: ${{ matrix.os }}
if: |

View file

@ -28,6 +28,7 @@ jobs:
needs: rubocop
env:
CI: true
PUMA_TEST_DEBUG: true
TESTOPTS: -v
PUMA_NO_RUBOCOP: true

View file

@ -97,9 +97,15 @@ See the [Bundler docs](https://bundler.io/man/gemfile.5.html#PATH) for more deta
## Running tests
To run the entire test suite:
To run rubocop + tests:
```sh
bundle exec rake test:all
bundle exec rake
```
To run the test suite only:
```sh
bundle exec rake test
```
To run a single test file:
@ -122,6 +128,12 @@ To run a single test with 5 seconds as the test case timeout:
TEST_CASE_TIMEOUT=5 bundle exec m test/test_binder.rb:37
```
If you would like more information about extension building, SSL versions, your local Ruby version, and more, use the PUMA_TEST_DEBUG env variable:
```sh
PUMA_TEST_DEBUG=1 bundle exec rake test
```
#### File limits
Puma's test suite opens up a lot of sockets. This may exceed the default limit of your operating system. If your file limits are low, you may experience "too many open file" errors when running the Puma test suite.

View file

@ -16,6 +16,7 @@ end
gemspec = Gem::Specification.load("puma.gemspec")
Gem::PackageTask.new(gemspec).define
Rake::FileUtilsExt.verbose_flag = !!ENV['PUMA_TEST_DEBUG']
# generate extension code using Ragel (C and Java)
desc "Generate extension code (C and Java) using Ragel"
task :ragel

View file

@ -192,7 +192,7 @@ end
Minitest.after_run do
# needed for TestCLI#test_control_clustered
unless $debugging_hold
if !$debugging_hold && ENV['PUMA_TEST_DEBUG']
out = $debugging_info.strip
unless out.empty?
dash = "\u2500"

View file

@ -4,7 +4,7 @@
# loaded so HAS_SSL is defined
require_relative "helper"
if ::Puma::HAS_SSL
if ::Puma::HAS_SSL && ENV['PUMA_TEST_DEBUG']
require "puma/minissl"
require "net/http"