kettle-test 1.0.10 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,191 @@
1
+ #!/usr/bin/env bash
2
+ # exe/kettle-test — Run specs and emit a structured highlight summary.
3
+ #
4
+ # Provided by the kettle-test gem.
5
+ #
6
+ # Usage:
7
+ # bundle exec kettle-test [SPEC_ARGS...]
8
+ #
9
+ # By default this runs `bundle exec turbo_tests2`, so projects get parallel
10
+ # RSpec execution with the same command used by CI and Rake tasks. Set
11
+ # KETTLE_TEST_RUNNER=rspec to force direct `bundle exec rspec`.
12
+ #
13
+ # All arguments are forwarded to the selected runner.
14
+ # Output is captured, written to tmp/kettle-test/rspec-TIMESTAMP.log,
15
+ # and then key sections are printed to STDOUT in a compact summary block.
16
+ #
17
+ # Exit code mirrors RSpec's exit code (including coverage hard-failure).
18
+ #
19
+ # Environment variables (from kettle-soup-cover):
20
+ # K_SOUP_COV_DO - set to "true" to enable coverage (default: off locally)
21
+ # K_SOUP_COV_MIN_HARD - set to "true" to hard-fail on coverage (default: CI only)
22
+ # KETTLE_TEST_RUNNER - turbo_tests2 (default) or rspec
23
+ # KETTLE_TEST_TURBO_PROCESSES - passed to turbo_tests2 -n
24
+ # KETTLE_TEST_TURBO_RUNTIME_LOG - passed to turbo_tests2 --runtime-log
25
+ # KETTLE_TEST_TURBO_NICE - set true to pass turbo_tests2 --nice
26
+ #
27
+ # Examples:
28
+ # bundle exec kettle-test
29
+ # bundle exec kettle-test spec/my_spec.rb
30
+ # K_SOUP_COV_DO=true bundle exec kettle-test
31
+ #
32
+ set -euo pipefail
33
+
34
+ # ── Helpers ──────────────────────────────────────────────────────────────────
35
+
36
+ RED='\033[0;31m'
37
+ GREEN='\033[0;32m'
38
+ YELLOW='\033[1;33m'
39
+ CYAN='\033[0;36m'
40
+ BOLD='\033[1m'
41
+ RESET='\033[0m'
42
+
43
+ hr() { printf '%s\n' "────────────────────────────────────────────────────────────────"; }
44
+
45
+ # ── Project root ──────────────────────────────────────────────────────────────
46
+ # When run via `bundle exec`, BUNDLE_GEMFILE points to the project's Gemfile.
47
+ # Fall back to the current working directory.
48
+
49
+ if [ -n "${BUNDLE_GEMFILE:-}" ]; then
50
+ PROJECT_ROOT="$(cd "$(dirname "$BUNDLE_GEMFILE")" && pwd)"
51
+ else
52
+ PROJECT_ROOT="$(pwd)"
53
+ fi
54
+
55
+ LOG_DIR="$PROJECT_ROOT/tmp/kettle-test"
56
+ mkdir -p "$LOG_DIR"
57
+ TIMESTAMP="$(date -u +%Y%m%d-%H%M%S)"
58
+ RUNNER="${KETTLE_TEST_RUNNER:-turbo_tests2}"
59
+ LOG_FILE="$LOG_DIR/${RUNNER}-${TIMESTAMP}-$$.log"
60
+
61
+ # ── Run specs ─────────────────────────────────────────────────────────────────
62
+ # Run via Bundler so the project's own Gemfile is always used.
63
+ # We tee to the log so the full output is preserved even if the user interrupts.
64
+
65
+ rspec_exit=0
66
+ cd "$PROJECT_ROOT"
67
+
68
+ case "$RUNNER" in
69
+ turbo|turbo_tests2)
70
+ export PARALLEL_TEST_FIRST_IS_1="${PARALLEL_TEST_FIRST_IS_1:-true}"
71
+ command=(bundle exec turbo_tests2)
72
+ if [ -n "${KETTLE_TEST_TURBO_PROCESSES:-}" ]; then
73
+ command+=(-n "$KETTLE_TEST_TURBO_PROCESSES")
74
+ fi
75
+ if [ -n "${KETTLE_TEST_TURBO_RUNTIME_LOG:-}" ]; then
76
+ command+=(--runtime-log "$KETTLE_TEST_TURBO_RUNTIME_LOG")
77
+ fi
78
+ if [ "${KETTLE_TEST_TURBO_NICE:-false}" = "true" ]; then
79
+ command+=(--nice)
80
+ fi
81
+ command+=("$@")
82
+ ;;
83
+ rspec)
84
+ command=(bundle exec rspec "$@")
85
+ ;;
86
+ *)
87
+ printf 'Unknown KETTLE_TEST_RUNNER: %s\n' "$RUNNER" >&2
88
+ printf 'Supported values: turbo_tests2, turbo, rspec\n' >&2
89
+ exit 64
90
+ ;;
91
+ esac
92
+
93
+ "${command[@]}" 2>&1 | tee "$LOG_FILE" || rspec_exit=$?
94
+
95
+ # ── Parse output ──────────────────────────────────────────────────────────────
96
+
97
+ LOG="$LOG_FILE"
98
+
99
+ # Strip ANSI escape codes for parsing
100
+ clean_log() { sed 's/\x1b\[[0-9;]*[mK]//g' "$LOG"; }
101
+
102
+ # Summary line: "N examples, N failures" or "N examples, N failures, N pending"
103
+ summary_line=$(clean_log | grep -E '^[0-9]+ example' | tail -1 || true)
104
+
105
+ # Finished timing line
106
+ finished_line=$(clean_log | grep -E '^Finished in' | tail -1 || true)
107
+
108
+ # Seed line
109
+ seed_line=$(clean_log | grep -E '^Randomized with seed' | tail -1 || true)
110
+
111
+ # Failed examples block (rspec ./path:N # description)
112
+ failed_block=$(clean_log | grep -E '^rspec \./.*#' || true)
113
+ failed_count=$(printf '%s\n' "$failed_block" | grep -c 'rspec \.' || true)
114
+ failed_count=${failed_count:-0}
115
+
116
+ # Coverage lines (simplecov-console output)
117
+ cov_line=$(clean_log | grep -E '^Line Coverage:' | tail -1 || true)
118
+ cov_branch=$(clean_log | grep -E '^Branch Coverage:' | tail -1 || true)
119
+ cov_summary=$(clean_log | grep -E '^(COVERAGE|BRANCH COVERAGE):' || true)
120
+ cov_hard_fail=$(clean_log | grep -iE '(minimum coverage|coverage requirement|failed.*coverage)' | tail -3 || true)
121
+
122
+ # ── Emit summary ──────────────────────────────────────────────────────────────
123
+
124
+ echo
125
+ hr
126
+ printf '%b\n' "${BOLD}[rspec_summary] Spec Run Highlights${RESET}"
127
+ hr
128
+
129
+ # Timing
130
+ if [ -n "$finished_line" ]; then
131
+ printf '%b\n' "${CYAN}⏱ ${finished_line}${RESET}"
132
+ fi
133
+
134
+ # Seed
135
+ if [ -n "$seed_line" ]; then
136
+ printf '%b\n' "${CYAN}🎲 ${seed_line}${RESET}"
137
+ fi
138
+
139
+ # Examples / failures / pending
140
+ if [ -n "$summary_line" ]; then
141
+ if echo "$summary_line" | grep -qE ',\s*[1-9][0-9]* failure'; then
142
+ printf '%b\n' "${RED}❌ ${summary_line}${RESET}"
143
+ else
144
+ printf '%b\n' "${GREEN}✅ ${summary_line}${RESET}"
145
+ fi
146
+ else
147
+ printf '%b\n' "${YELLOW}⚠️ No summary line found — check log: ${LOG_FILE}${RESET}"
148
+ fi
149
+
150
+ # Failed examples
151
+ if [ "$failed_count" -gt 0 ] 2>/dev/null; then
152
+ echo
153
+ printf '%b\n' "${RED}${BOLD}Failed examples (${failed_count}):${RESET}"
154
+ echo "$failed_block" | while IFS= read -r line; do
155
+ [ -n "$line" ] && printf ' %b\n' "${RED}${line}${RESET}"
156
+ done
157
+ fi
158
+
159
+ # Coverage
160
+ if [ -n "$cov_line" ] || [ -n "$cov_summary" ]; then
161
+ echo
162
+ printf '%b\n' "${BOLD}Coverage:${RESET}"
163
+ [ -n "$cov_line" ] && printf ' %b\n' "${cov_line}"
164
+ [ -n "$cov_branch" ] && printf ' %b\n' "${cov_branch}"
165
+ if [ -n "$cov_summary" ]; then
166
+ echo "$cov_summary" | while IFS= read -r line; do
167
+ [ -n "$line" ] && printf ' %b\n' "${CYAN}${line}${RESET}"
168
+ done
169
+ fi
170
+ if [ -n "$cov_hard_fail" ]; then
171
+ echo
172
+ printf '%b\n' "${RED}${BOLD}Coverage hard-failure:${RESET}"
173
+ echo "$cov_hard_fail" | while IFS= read -r line; do
174
+ [ -n "$line" ] && printf ' %b\n' "${RED}${line}${RESET}"
175
+ done
176
+ fi
177
+ fi
178
+
179
+ # Exit code
180
+ echo
181
+ if [ "$rspec_exit" -eq 0 ]; then
182
+ printf '%b\n' "${GREEN}${BOLD}Exit: 0 (PASSED)${RESET}"
183
+ else
184
+ printf '%b\n' "${RED}${BOLD}Exit: ${rspec_exit} (FAILED)${RESET}"
185
+ fi
186
+
187
+ printf '%b\n' "${CYAN}📄 Full log: ${LOG_FILE}${RESET}"
188
+ hr
189
+ echo
190
+
191
+ exit "$rspec_exit"
@@ -4,6 +4,14 @@ require_relative "external"
4
4
  # Requires external helpers, this library, then wires internal configuration.
5
5
  require "kettle/test"
6
6
 
7
+ module Kettle
8
+ module Test
9
+ # Namespace for the RSpec integration entrypoint.
10
+ module RSpec
11
+ end
12
+ end
13
+ end
14
+
7
15
  require_relative "internal"
8
16
 
9
17
  # A gem's test harness should do require "rake" if it is their dependency,
@@ -2,12 +2,9 @@
2
2
 
3
3
  module Kettle
4
4
  module Test
5
- # Version namespace
6
5
  module Version
7
- # The current version of kettle-test.
8
- # @return [String]
9
- VERSION = "1.0.10"
6
+ VERSION = "2.0.0"
10
7
  end
11
- VERSION = Version::VERSION # Traditional constant at module level
8
+ VERSION = Version::VERSION # Traditional Constant Location
12
9
  end
13
10
  end
data/lib/kettle/test.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "date"
4
+ require "version_gem"
3
5
  require_relative "test/version"
4
6
 
5
7
  # Kettle namespace for the kettle-rb ecosystem of gems.
@@ -17,7 +19,7 @@ module Kettle
17
19
 
18
20
  # String#casecmp? was added in Ruby 2.4, so fallback to String#casecmp
19
21
  # @return [Boolean] whether debug mode is enabled (disables silencing)
20
- DEBUG = ENV.fetch("KETTLE_TEST_DEBUG", ENV.fetch("DEBUG", "false")).casecmp("true").zero?
22
+ DEBUG = ENV.fetch("KETTLE_TEST_DEBUG", ENV.fetch("KETTLE_DEV_DEBUG", "false")).casecmp("true").zero?
21
23
  # @return [Boolean] whether running in a CI environment (CI=true)
22
24
  IS_CI = ENV.fetch("CI", "").casecmp("true").zero?
23
25
  # @return [Boolean] when true, enables full backtraces in RSpec
@@ -0,0 +1,9 @@
1
+ module Kettle
2
+ module Test
3
+ module Version
4
+ VERSION: String
5
+ end
6
+ VERSION: String
7
+ end
8
+ end
9
+
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kettle-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -37,26 +37,6 @@ cert_chain:
37
37
  -----END CERTIFICATE-----
38
38
  date: 1980-01-02 00:00:00.000000000 Z
39
39
  dependencies:
40
- - !ruby/object:Gem::Dependency
41
- name: version_gem
42
- requirement: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '1.1'
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: 1.1.9
50
- type: :runtime
51
- prerelease: false
52
- version_requirements: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - "~>"
55
- - !ruby/object:Gem::Version
56
- version: '1.1'
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- version: 1.1.9
60
40
  - !ruby/object:Gem::Dependency
61
41
  name: appraisal2
62
42
  requirement: !ruby/object:Gem::Requirement
@@ -219,34 +199,68 @@ dependencies:
219
199
  - - ">="
220
200
  - !ruby/object:Gem::Version
221
201
  version: 1.0.3
202
+ - !ruby/object:Gem::Dependency
203
+ name: turbo_tests2
204
+ requirement: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '3.0'
209
+ type: :runtime
210
+ prerelease: false
211
+ version_requirements: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '3.0'
216
+ - !ruby/object:Gem::Dependency
217
+ name: version_gem
218
+ requirement: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '1.1'
223
+ - - ">="
224
+ - !ruby/object:Gem::Version
225
+ version: 1.1.9
226
+ type: :runtime
227
+ prerelease: false
228
+ version_requirements: !ruby/object:Gem::Requirement
229
+ requirements:
230
+ - - "~>"
231
+ - !ruby/object:Gem::Version
232
+ version: '1.1'
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ version: 1.1.9
222
236
  - !ruby/object:Gem::Dependency
223
237
  name: kettle-dev
224
238
  requirement: !ruby/object:Gem::Requirement
225
239
  requirements:
226
240
  - - "~>"
227
241
  - !ruby/object:Gem::Version
228
- version: 1.2.4
242
+ version: '2.0'
229
243
  type: :development
230
244
  prerelease: false
231
245
  version_requirements: !ruby/object:Gem::Requirement
232
246
  requirements:
233
247
  - - "~>"
234
248
  - !ruby/object:Gem::Version
235
- version: 1.2.4
249
+ version: '2.0'
236
250
  - !ruby/object:Gem::Dependency
237
251
  name: bundler-audit
238
252
  requirement: !ruby/object:Gem::Requirement
239
253
  requirements:
240
254
  - - "~>"
241
255
  - !ruby/object:Gem::Version
242
- version: 0.9.2
256
+ version: 0.9.3
243
257
  type: :development
244
258
  prerelease: false
245
259
  version_requirements: !ruby/object:Gem::Requirement
246
260
  requirements:
247
261
  - - "~>"
248
262
  - !ruby/object:Gem::Version
249
- version: 0.9.2
263
+ version: 0.9.3
250
264
  - !ruby/object:Gem::Dependency
251
265
  name: rake
252
266
  requirement: !ruby/object:Gem::Requirement
@@ -281,6 +295,26 @@ dependencies:
281
295
  - - ">="
282
296
  - !ruby/object:Gem::Version
283
297
  version: 1.0.4
298
+ - !ruby/object:Gem::Dependency
299
+ name: appraisal2
300
+ requirement: !ruby/object:Gem::Requirement
301
+ requirements:
302
+ - - "~>"
303
+ - !ruby/object:Gem::Version
304
+ version: '3.0'
305
+ - - ">="
306
+ - !ruby/object:Gem::Version
307
+ version: 3.0.6
308
+ type: :development
309
+ prerelease: false
310
+ version_requirements: !ruby/object:Gem::Requirement
311
+ requirements:
312
+ - - "~>"
313
+ - !ruby/object:Gem::Version
314
+ version: '3.0'
315
+ - - ">="
316
+ - !ruby/object:Gem::Version
317
+ version: 3.0.6
284
318
  - !ruby/object:Gem::Dependency
285
319
  name: ruby-progressbar
286
320
  requirement: !ruby/object:Gem::Requirement
@@ -304,7 +338,7 @@ dependencies:
304
338
  version: '1.0'
305
339
  - - ">="
306
340
  - !ruby/object:Gem::Version
307
- version: 1.0.2
341
+ version: 1.0.3
308
342
  type: :development
309
343
  prerelease: false
310
344
  version_requirements: !ruby/object:Gem::Requirement
@@ -314,7 +348,7 @@ dependencies:
314
348
  version: '1.0'
315
349
  - - ">="
316
350
  - !ruby/object:Gem::Version
317
- version: 1.0.2
351
+ version: 1.0.3
318
352
  - !ruby/object:Gem::Dependency
319
353
  name: gitmoji-regex
320
354
  requirement: !ruby/object:Gem::Requirement
@@ -343,7 +377,8 @@ description: "\U0001F372 Kettle::Test is a meta tool from kettle-rb to streamlin
343
377
  Fund overlooked open source projects - bottom of stack, dev/test dependencies: floss-funding.dev"
344
378
  email:
345
379
  - floss@galtzo.com
346
- executables: []
380
+ executables:
381
+ - kettle-test
347
382
  extensions: []
348
383
  extra_rdoc_files:
349
384
  - CHANGELOG.md
@@ -351,9 +386,8 @@ extra_rdoc_files:
351
386
  - CODE_OF_CONDUCT.md
352
387
  - CONTRIBUTING.md
353
388
  - FUNDING.md
354
- - LICENSE.txt
389
+ - LICENSE.md
355
390
  - README.md
356
- - REEK
357
391
  - RUBOCOP.md
358
392
  - SECURITY.md
359
393
  files:
@@ -362,11 +396,13 @@ files:
362
396
  - CODE_OF_CONDUCT.md
363
397
  - CONTRIBUTING.md
364
398
  - FUNDING.md
365
- - LICENSE.txt
399
+ - LICENSE.md
366
400
  - README.md
367
- - REEK
368
401
  - RUBOCOP.md
369
402
  - SECURITY.md
403
+ - certs/pboling.pem
404
+ - exe/kettle-test
405
+ - exe/kettle-test.sh
370
406
  - lib/kettle/test.rb
371
407
  - lib/kettle/test/config/ext/backports.rb
372
408
  - lib/kettle/test/config/ext/rspec/rspec_stubbed_env.rb
@@ -385,15 +421,17 @@ files:
385
421
  - lib/kettle/test/support/shared_contexts/with_rake.rb
386
422
  - lib/kettle/test/version.rb
387
423
  - sig/kettle/test.rbs
424
+ - sig/kettle/test/version.rbs
388
425
  homepage: https://github.com/kettle-rb/kettle-test
389
426
  licenses:
390
- - MIT
427
+ - AGPL-3.0-only
428
+ - PolyForm-Small-Business-1.0.0
391
429
  metadata:
392
- homepage_uri: https://kettle-test.galtzo.com/
393
- source_code_uri: https://github.com/kettle-rb/kettle-test/tree/v1.0.10
394
- changelog_uri: https://github.com/kettle-rb/kettle-test/blob/v1.0.10/CHANGELOG.md
430
+ homepage_uri: https://kettle-test.galtzo.com
431
+ source_code_uri: https://github.com/kettle-rb/kettle-test/tree/v2.0.0
432
+ changelog_uri: https://github.com/kettle-rb/kettle-test/blob/v2.0.0/CHANGELOG.md
395
433
  bug_tracker_uri: https://github.com/kettle-rb/kettle-test/issues
396
- documentation_uri: https://www.rubydoc.info/gems/kettle-test/1.0.10
434
+ documentation_uri: https://www.rubydoc.info/gems/kettle-test/2.0.0
397
435
  funding_uri: https://github.com/sponsors/pboling
398
436
  wiki_uri: https://github.com/kettle-rb/kettle-test/wiki
399
437
  news_uri: https://www.railsbling.com/tags/kettle-test
@@ -415,14 +453,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
415
453
  requirements:
416
454
  - - ">="
417
455
  - !ruby/object:Gem::Version
418
- version: 2.3.0
456
+ version: 2.4.0
419
457
  required_rubygems_version: !ruby/object:Gem::Requirement
420
458
  requirements:
421
459
  - - ">="
422
460
  - !ruby/object:Gem::Version
423
461
  version: '0'
424
462
  requirements: []
425
- rubygems_version: 4.0.5
463
+ rubygems_version: 4.0.11
426
464
  specification_version: 4
427
465
  summary: "\U0001F372 A kettle-rb meta tool to streamline testing"
428
466
  test_files: []
metadata.gz.sig CHANGED
Binary file
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2023, 2025 Peter Boling
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/REEK DELETED
File without changes