Conversation
This was referenced Oct 31, 2024
shadre
reviewed
Oct 31, 2024
…ting by test cases" This reverts commit 9a477df.
2 tasks
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.
Story
TODO: link to the internal story
Related
Description
Relate to the RSpec split by examples feature:
https://docs.knapsackpro.com/ruby/split-by-test-examples/
If a user skips some test files, for example, using the RSpec
--tagoption, then RSpec might still load a file but not run it or only run some of the test examples from it.If a lot of test files are skipped, then the actual average CI node execution time would be much smaller than the estimated time (Knapsack Pro does not know how many test files are filtered out by
--tag). This can lead to not determining enough test files as slow, which examples should split. As a result, CI build is unbalanced.To solve that problem, we added a new environment variable (
KNAPSACK_PRO_SLOW_TEST_FILE_THRESHOLD). You define a threshold (a number of seconds) for slow test files. Any test file above the threshold would be split by test examples.For example, you expect your CI node to run no longer than 3 minutes, then set
KNAPSACK_PRO_SLOW_TEST_FILE_THRESHOLD=180(180 seconds == 3 minutes)changes
KNAPSACK_PRO_SLOW_TEST_FILE_THRESHOLDoptionChecklist reminder
UNRELEASEDsection of theCHANGELOG.md, including the needed bump (ie, patch, minor, major)lib/knapsack_pro/pure/queue/rspec_pure.rbcontains pure functions that are unit tested.lib/knapsack_pro/extensions/rspec_extension.rbencapsulates calls to RSpec internals and is integration and e2e tested.lib/knapsack_pro/runners/queue/rspec_runner.rbinvokes the pure code and the extension to produce side effects, which are integration and e2e tested.