-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TestTimeRecord #113
Add TestTimeRecord #113
Conversation
383c948
to
fb752e5
Compare
def key_to_list_all_test_names | ||
"build:#{config.build_id}:list_of_test_names".force_encoding(Encoding::BINARY) | ||
end | ||
|
||
def test_time_key(test_name) | ||
"build:#{config.build_id}:#{test_name}".force_encoding(Encoding::BINARY) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method names test_time_key
and key_to_list_all_test_names
are somewhat inconsistent.
redis = Redis.new(url: redis_url) | ||
redis.flushdb | ||
|
||
config ||= CI::Queue::Configuration.new( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we use ||=
here?
redis_url = "redis://#{ENV.fetch('REDIS_HOST', 'localhost')}/7" | ||
redis = Redis.new(url: redis_url) | ||
redis.flushdb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: this same pattern is used in multiple places, it would be nice to move this into a test helper module that any test can include if it needs a local Redis instance (more DRY). Feel free to ignore this for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, I'll add it in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create an issue for that and add it to the kanban board, so that this doesn't get lost?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, issue created: #114
Adding the class to store the run time of individual test during a grind in Redis.
Related https://github.com/Shopify/test-infra/issues/36
You can see the entire change at https://github.com/Shopify/ci-queue/pull/112/files