-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from KnapsackPro/queue
Add support for knapsack_pro queue mode
- Loading branch information
Showing
42 changed files
with
1,074 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module KnapsackPro | ||
class BaseAllocatorBuilder | ||
def initialize(adapter_class) | ||
@adapter_class = adapter_class | ||
end | ||
|
||
def allocator | ||
raise NotImplementedError | ||
end | ||
|
||
def test_dir | ||
test_file_pattern.split('/').first | ||
end | ||
|
||
private | ||
|
||
attr_reader :adapter_class | ||
|
||
def env | ||
KnapsackPro::Config::Env | ||
end | ||
|
||
def repository_adapter | ||
KnapsackPro::RepositoryAdapterInitiator.call | ||
end | ||
|
||
def test_file_pattern | ||
TestFilePattern.call(adapter_class) | ||
end | ||
|
||
def test_files | ||
KnapsackPro::TestFileFinder.call(test_file_pattern) | ||
end | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module KnapsackPro | ||
module Client | ||
module API | ||
module V1 | ||
class Queues < Base | ||
class << self | ||
def queue(args) | ||
action_class.new( | ||
endpoint_path: '/v1/queues/queue', | ||
http_method: :post, | ||
request_hash: { | ||
:can_initialize_queue => args.fetch(:can_initialize_queue), | ||
:commit_hash => args.fetch(:commit_hash), | ||
:branch => args.fetch(:branch), | ||
:node_total => args.fetch(:node_total), | ||
:node_index => args.fetch(:node_index), | ||
:node_build_id => KnapsackPro::Config::Env.ci_node_build_id, | ||
:test_files => args.fetch(:test_files) | ||
} | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,9 @@ def node_total | |
def node_index | ||
end | ||
|
||
def node_build_id | ||
end | ||
|
||
def commit_hash | ||
end | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module KnapsackPro | ||
module Config | ||
class EnvGenerator | ||
class << self | ||
def set_queue_id | ||
if ENV['KNAPSACK_PRO_QUEUE_ID'] | ||
raise 'Queue ID already generated.' | ||
else | ||
ENV['KNAPSACK_PRO_QUEUE_ID'] = "#{Time.now.to_i}_#{SecureRandom.uuid}" | ||
end | ||
end | ||
|
||
def set_subset_queue_id | ||
ENV['KNAPSACK_PRO_SUBSET_QUEUE_ID'] = SecureRandom.uuid | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.