Skip to content

RoF#325

Open
3v0k4 wants to merge 36 commits intomainfrom
fails
Open

RoF#325
3v0k4 wants to merge 36 commits intomainfrom
fails

Conversation

@3v0k4
Copy link
Copy Markdown
Contributor

@3v0k4 3v0k4 commented Jan 21, 2026

Description

See https://github.com/KnapsackPro/knapsack-pro-api/pull/1455

Checks

  • I added the changes to the UNRELEASED section of the CHANGELOG.md, including the needed bump (i.e., patch, minor, major)
  • I followed the architecture outlined below for RSpec in Queue Mode:
    • Pure: lib/knapsack_pro/pure/queue/rspec_pure.rb contains pure functions that are unit tested.
    • Extension: lib/knapsack_pro/extensions/rspec_extension.rb encapsulates calls to RSpec internals and is integration and E2E tested.
    • Runner: lib/knapsack_pro/runners/queue/rspec_runner.rb invokes the pure code and the extension to produce side effects, which are integration and E2E tested.

Copy link
Copy Markdown
Member

@ArturT ArturT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@3v0k4 3v0k4 force-pushed the fails branch 4 times, most recently from 9c545d5 to a37fb15 Compare February 13, 2026 08:16
@3v0k4 3v0k4 force-pushed the fails branch 2 times, most recently from fa6ceda to c28d5c4 Compare February 19, 2026 10:16
@3v0k4 3v0k4 force-pushed the fails branch 4 times, most recently from c600953 to 17d9434 Compare April 9, 2026 08:00
@3v0k4 3v0k4 force-pushed the fails branch 15 times, most recently from 423d8b9 to 908b68d Compare April 9, 2026 09:18
end
end

def fixed_queue_split_?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question

What's the purpose of this method here? Is it to avoid using the fixed_queue_split method that could print logger info a few times when KNAPSACK_PRO_FIXED_QUEUE_SPLIT is not set? If @fixed_queue_split ||= false then it would evaluate the begin block each time you call the fixed_queue_split method.

Perhaps changing def fixed_queue_split to the following would be enough and then we don't need fixed_queue_split_?:

def fixed_queue_split
  return @fixed_queue_split if defined?(@fixed_queue_split)

  @fixed_queue_split = begin
    env_name = 'KNAPSACK_PRO_FIXED_QUEUE_SPLIT'
    computed = env_for(env_name, :fixed_queue_split).to_s

    if !ENV.key?(env_name)
      KnapsackPro.logger.info("#{env_name} is not set. Using default value: #{computed}. Learn more at #{KnapsackPro::Urls::FIXED_QUEUE_SPLIT}")
    end

    computed
  end
end

if test_files.empty?
KnapsackPro.logger.warn("No test files were executed on this CI node.")
KnapsackPro.logger.debug("This CI node likely started work late after the test files were already executed by other CI nodes consuming the queue.")
KnapsackPro.logger.info("No tests were executed because the test queue is empty.")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion

Why is the test queue empty? Let's make it clear to the user.

Suggested change
KnapsackPro.logger.info("No tests were executed because the test queue is empty.")
KnapsackPro.logger.info("No tests were executed because the test queue has already been consumed.")

end

it do
# expect(described_class).to receive(:new).with(test_files).and_return(encryptor)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps comments could be removed here and in L70?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants