René's URL Explorer Experiment


Title: fix(generator): suppress test-framework autorun during schema generation by mortik · Pull Request #45 · openapi-ruby/openapi-ruby · GitHub

Open Graph Title: fix(generator): suppress test-framework autorun during schema generation by mortik · Pull Request #45 · openapi-ruby/openapi-ruby

X Title: fix(generator): suppress test-framework autorun during schema generation by mortik · Pull Request #45 · openapi-ruby/openapi-ruby

Description: The README says rake openapi_ruby:generate "loads spec/test files to collect API definitions and writes schemas without running any tests". In practice it runs the whole suite. Root cause Loading a test file is normally enough to run it. rails/test_help:11 requires active_support/testing/autorun, which calls Minitest.autorun and registers an at_exit hook; rspec/autorun does the equivalent. The generated script requires every file matching PATTERN, so the hook fires when the subprocess exits. Nothing in the gem suppressed it — OPENAPI_RUBY_GENERATING is only read by OpenapiRuby.schema_generating? (for consumers to guard on) and by the engine to skip middleware. Consequences: generation is as slow as a full test run, and it fails whenever any unrelated test fails, since the rake task aborts on a non-zero subprocess exit. Fix OpenapiRuby::Generator::AutorunSuppressor, installed by generate_script before any consumer file is required, in all three framework modes. Minitest.autorun becomes a no-op and RSpec::Core::Runner.disable_autorun! is called when RSpec is loaded. Overriding autorun rather than setting @@installed_at_exit keeps this off Minitest's internals. run is also stubbed as belt-and-braces in case a hook was registered before install. Verification Specs written first, then the fix reverted to confirm they catch it — 7 failures, including the new integration spec seeing 8 runs, 34 assertions leak out of generation against this repo's own dummy app (its test_helper requires minitest/autorun, mirroring how a Rails helper pulls it in transitively). With the fix: 312 examples, 0 failures, standardrb clean. Also verified against a real Rails 8.1 app (~120 tests, fixtures, Knapsack). Before: 120 tests ran during generation. After, with an unguarded test_helper and the full default glob: zero tests run, byte-identical schema, no consumer-side changes needed. Docs The unless OpenapiRuby.schema_generating? guard was documented as needed only during an RSpec↔Minitest migration. That scoping was wrong — it applied to any consumer whose helper required rails/test_help, which is why minitest-only apps ended up carrying it. With the suppressor it becomes a genuine optimization (keeps the DB, fixtures and maintain_test_schema! out of generation), and the README now frames it that way, including the caveat that skipping rails/test_help leaves fixtures undefined and needs a narrowed PATTERN. 🤖

Open Graph Description: The README says rake openapi_ruby:generate "loads spec/test files to collect API definitions and writes schemas without running any tests". In practice it runs the whole suite. Root cause...

X Description: The README says rake openapi_ruby:generate "loads spec/test files to collect API definitions and writes schemas without running any tests". In practice it runs the whole suite. Ro...

Opengraph URL: https://github.com/openapi-ruby/openapi-ruby/pull/45

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ba4896cd-ed58-2a2a-d45f-620e86312f9d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE5FA:EA06E:1E5C387:26B1592:6B014B7D
html-safe-noncef61509770c4302b3d90a2f30b33f36b202be239b2af5c3121daf9873287580a0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUZBOkVBMDZFOjFFNUMzODc6MjZCMTU5Mjo2QjAxNEI3RCIsInZpc2l0b3JfaWQiOiI3Nzk4NTkyMTk5NTYxNjYxMzEwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac460d62bfb4151834ca598889c4e79df99be88ba80082f1c910aeb867e73d71e2
hovercard-subject-tagpull_request:4238376960
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/openapi-ruby/openapi-ruby/pull/45/files
twitter:imagehttps://avatars.githubusercontent.com/u/517703?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/517703?s=400&v=4
og:image:altThe README says rake openapi_ruby:generate "loads spec/test files to collect API definitions and writes schemas without running any tests". In practice it runs the whole suite. Root cause...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/openapi-ruby/openapi-ruby git https://github.com/openapi-ruby/openapi-ruby.git
octolytics-dimension-user_id276587259
octolytics-dimension-user_loginopenapi-ruby
octolytics-dimension-repository_id1211860664
octolytics-dimension-repository_nwoopenapi-ruby/openapi-ruby
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1211860664
octolytics-dimension-repository_network_root_nwoopenapi-ruby/openapi-ruby
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/openapi-ruby/openapi-ruby/pull/45/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenapi-ruby%2Fopenapi-ruby%2Fpull%2F45%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenapi-ruby%2Fopenapi-ruby%2Fpull%2F45%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=openapi-ruby%2Fopenapi-ruby
Reloadhttps://github.com/openapi-ruby/openapi-ruby/pull/45/files
Reloadhttps://github.com/openapi-ruby/openapi-ruby/pull/45/files
Reloadhttps://github.com/openapi-ruby/openapi-ruby/pull/45/files
openapi-rubyhttps://github.com/openapi-ruby
openapi-rubyhttps://github.com/openapi-ruby/openapi-ruby
Codehttps://github.com/openapi-ruby/openapi-ruby
Issues1 (1)https://github.com/openapi-ruby/openapi-ruby/issues
Pull requests2 (2)https://github.com/openapi-ruby/openapi-ruby/pulls
Actionshttps://github.com/openapi-ruby/openapi-ruby/actions
Projectshttps://github.com/openapi-ruby/openapi-ruby/projects
Security and qualityhttps://github.com/openapi-ruby/openapi-ruby/security
Insightshttps://github.com/openapi-ruby/openapi-ruby/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fopenapi-ruby%2Fopenapi-ruby%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fopenapi-ruby%2Fopenapi-ruby%2Fissues%2Fnew%2Fchoose
mortikhttps://github.com/mortik
mainhttps://github.com/openapi-ruby/openapi-ruby/tree/main
fix/suppress-test-framework-autorunhttps://github.com/openapi-ruby/openapi-ruby/tree/fix/suppress-test-framework-autorun
Conversation 0 https://github.com/openapi-ruby/openapi-ruby/pull/45
Commits 2 https://github.com/openapi-ruby/openapi-ruby/pull/45/commits
Checks 12 https://github.com/openapi-ruby/openapi-ruby/pull/45/checks
Files changed https://github.com/openapi-ruby/openapi-ruby/pull/45/files
Please reload this pagehttps://github.com/openapi-ruby/openapi-ruby/pull/45/files
fix(generator): suppress test-framework autorun during schema generation https://github.com/openapi-ruby/openapi-ruby/pull/45/files#top
Show all changes 2 commits https://github.com/openapi-ruby/openapi-ruby/pull/45/files
a5fc600 fix(generator): suppress test-framework autorun during schema generation mortik Aug 9, 2026 https://github.com/openapi-ruby/openapi-ruby/pull/45/commits/a5fc600ffa87687d74696dc04a42ce4537cb48ec
b5be1d4 docs(readme): explain autorun suppression, rescope the helper guard mortik Aug 9, 2026 https://github.com/openapi-ruby/openapi-ruby/pull/45/commits/b5be1d4d7ecb80d4f0ea97cefb1bb716f624d765
Clear filters https://github.com/openapi-ruby/openapi-ruby/pull/45/files
Please reload this pagehttps://github.com/openapi-ruby/openapi-ruby/pull/45/files
Please reload this pagehttps://github.com/openapi-ruby/openapi-ruby/pull/45/files
README.md https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
autorun_suppressor.rb https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-0005aa4e8a8b3ae2851f83ac65ad43747996ba94a043d76b5600f120428343ba
rake_task_support.rb https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-34fd677c2d3771efe70fb05a92c0f9d117f33396f2a03009214214d1c0850bb7
generation_does_not_run_tests_spec.rb https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-6627cee7b1f0dcdc276a03e65f279a7c9e3e1431d351ce45cc3737dd0a5f3865
hybrid_generation_spec.rb https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-4e969ec99be64ab69df1809392d4d25a82e0da6774716fcaf82169c115425581
autorun_suppressor_spec.rb https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-b01e5c22b9d1504bcbdec7067f846e09c9a6d9f311069c54bf143d20929fef0e
README.mdhttps://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
View file https://github.com/openapi-ruby/openapi-ruby/blob/b5be1d4d7ecb80d4f0ea97cefb1bb716f624d765/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-ruby/openapi-ruby/pull/45/{{ revealButtonHref }}
https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
lib/openapi_ruby/generator/autorun_suppressor.rbhttps://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-0005aa4e8a8b3ae2851f83ac65ad43747996ba94a043d76b5600f120428343ba
View file https://github.com/openapi-ruby/openapi-ruby/blob/b5be1d4d7ecb80d4f0ea97cefb1bb716f624d765/lib/openapi_ruby/generator/autorun_suppressor.rb
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-ruby/openapi-ruby/pull/45/{{ revealButtonHref }}
lib/openapi_ruby/generator/rake_task_support.rbhttps://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-34fd677c2d3771efe70fb05a92c0f9d117f33396f2a03009214214d1c0850bb7
View file https://github.com/openapi-ruby/openapi-ruby/blob/b5be1d4d7ecb80d4f0ea97cefb1bb716f624d765/lib/openapi_ruby/generator/rake_task_support.rb
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-ruby/openapi-ruby/pull/45/{{ revealButtonHref }}
https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-34fd677c2d3771efe70fb05a92c0f9d117f33396f2a03009214214d1c0850bb7
https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-34fd677c2d3771efe70fb05a92c0f9d117f33396f2a03009214214d1c0850bb7
https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-34fd677c2d3771efe70fb05a92c0f9d117f33396f2a03009214214d1c0850bb7
https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-34fd677c2d3771efe70fb05a92c0f9d117f33396f2a03009214214d1c0850bb7
https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-34fd677c2d3771efe70fb05a92c0f9d117f33396f2a03009214214d1c0850bb7
spec/integration/generation_does_not_run_tests_spec.rbhttps://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-6627cee7b1f0dcdc276a03e65f279a7c9e3e1431d351ce45cc3737dd0a5f3865
View file https://github.com/openapi-ruby/openapi-ruby/blob/b5be1d4d7ecb80d4f0ea97cefb1bb716f624d765/spec/integration/generation_does_not_run_tests_spec.rb
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-ruby/openapi-ruby/pull/45/{{ revealButtonHref }}
spec/integration/hybrid_generation_spec.rbhttps://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-4e969ec99be64ab69df1809392d4d25a82e0da6774716fcaf82169c115425581
View file https://github.com/openapi-ruby/openapi-ruby/blob/b5be1d4d7ecb80d4f0ea97cefb1bb716f624d765/spec/integration/hybrid_generation_spec.rb
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-ruby/openapi-ruby/pull/45/{{ revealButtonHref }}
https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-4e969ec99be64ab69df1809392d4d25a82e0da6774716fcaf82169c115425581
https://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-4e969ec99be64ab69df1809392d4d25a82e0da6774716fcaf82169c115425581
spec/openapi_ruby/generator/autorun_suppressor_spec.rbhttps://github.com/openapi-ruby/openapi-ruby/pull/45/files#diff-b01e5c22b9d1504bcbdec7067f846e09c9a6d9f311069c54bf143d20929fef0e
View file https://github.com/openapi-ruby/openapi-ruby/blob/b5be1d4d7ecb80d4f0ea97cefb1bb716f624d765/spec/openapi_ruby/generator/autorun_suppressor_spec.rb
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-ruby/openapi-ruby/pull/45/{{ revealButtonHref }}
Please reload this pagehttps://github.com/openapi-ruby/openapi-ruby/pull/45/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.