Add tests for Sidekiq top-level public API and Config#logger=#7037
Merged
Conversation
Four cohesive tests for top-level Sidekiq / Config public API contracts, naturally spanning two files since the contract spans the two: test/sidekiq_test.rb: - Sidekiq.testing!(:bogus) raises with 'Unknown testing mode: bogus' before requiring sidekiq/test_api (the mode-validation contract). - Sidekiq.strict_args! updates Sidekiq::Config::DEFAULTS[:on_complex_arguments] through false / :warn / :raise (the default), restoring the original value in ensure. - Sidekiq.pro? / .ent? / .server? are defined-checks: nil in OSS test suite; defining a stub Sidekiq::Pro makes .pro? truthy. test/config_test.rb: - Config#logger= nil keeps the existing logger instance but raises its level to FATAL (the documented 'silence the logger' contract).
32dca36 to
b25775d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four cohesive tests for top-level
Sidekiq/Configpublic API contracts, spanning two test files since the contract spans the two correspondinglibfiles:test/sidekiq_test.rb:Sidekiq.testing!(:bogus)raises with"Unknown testing mode: bogus"before requiringsidekiq/test_api(the mode-validation contract that gives users a useful error rather than a cryptic load failure).Sidekiq.strict_args!updatesSidekiq::Config::DEFAULTS[:on_complex_arguments]throughfalse/:warn/:raise(the default), restoring the original inensure.Sidekiq.pro?/.ent?/.server?aredefined?-checks:nilin the OSS test suite; defining a stubSidekiq::Promakes.pro?truthy.test/config_test.rb:Config#logger=withnilkeeps the existing logger instance but raises its level toFATAL— the documented "silence the logger" contract (socfg.logger = nildoesn't blow up downstream code that callslogger.info).Test-only, no
lib/changes.Testing
bundle exec rakeis green (standard + lint:herb + full suite).