knapsack_pro 5.4.1 → 5.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +5 -1
  3. data/CHANGELOG.md +20 -0
  4. data/lib/knapsack_pro/adapters/base_adapter.rb +2 -0
  5. data/lib/knapsack_pro/adapters/cucumber_adapter.rb +2 -0
  6. data/lib/knapsack_pro/adapters/minitest_adapter.rb +2 -0
  7. data/lib/knapsack_pro/adapters/rspec_adapter.rb +2 -0
  8. data/lib/knapsack_pro/adapters/spinach_adapter.rb +2 -0
  9. data/lib/knapsack_pro/adapters/test_unit_adapter.rb +2 -0
  10. data/lib/knapsack_pro/allocator.rb +2 -0
  11. data/lib/knapsack_pro/allocator_builder.rb +2 -0
  12. data/lib/knapsack_pro/base_allocator_builder.rb +2 -0
  13. data/lib/knapsack_pro/build_distribution_fetcher.rb +2 -0
  14. data/lib/knapsack_pro/client/api/action.rb +2 -0
  15. data/lib/knapsack_pro/client/api/v1/base.rb +2 -0
  16. data/lib/knapsack_pro/client/api/v1/build_distributions.rb +2 -0
  17. data/lib/knapsack_pro/client/api/v1/build_subsets.rb +2 -0
  18. data/lib/knapsack_pro/client/api/v1/queues.rb +2 -0
  19. data/lib/knapsack_pro/client/connection.rb +2 -0
  20. data/lib/knapsack_pro/config/ci/app_veyor.rb +6 -0
  21. data/lib/knapsack_pro/config/ci/base.rb +2 -0
  22. data/lib/knapsack_pro/config/ci/buildkite.rb +2 -0
  23. data/lib/knapsack_pro/config/ci/circle.rb +2 -0
  24. data/lib/knapsack_pro/config/ci/cirrus_ci.rb +6 -0
  25. data/lib/knapsack_pro/config/ci/codefresh.rb +6 -0
  26. data/lib/knapsack_pro/config/ci/codeship.rb +6 -0
  27. data/lib/knapsack_pro/config/ci/github_actions.rb +2 -0
  28. data/lib/knapsack_pro/config/ci/gitlab_ci.rb +2 -0
  29. data/lib/knapsack_pro/config/ci/heroku.rb +6 -0
  30. data/lib/knapsack_pro/config/ci/semaphore.rb +4 -0
  31. data/lib/knapsack_pro/config/ci/semaphore2.rb +6 -0
  32. data/lib/knapsack_pro/config/ci/travis.rb +6 -0
  33. data/lib/knapsack_pro/config/env.rb +2 -0
  34. data/lib/knapsack_pro/config/env_generator.rb +2 -0
  35. data/lib/knapsack_pro/config/temp_files.rb +8 -4
  36. data/lib/knapsack_pro/crypto/branch_encryptor.rb +2 -0
  37. data/lib/knapsack_pro/crypto/decryptor.rb +2 -0
  38. data/lib/knapsack_pro/crypto/digestor.rb +2 -0
  39. data/lib/knapsack_pro/crypto/encryptor.rb +2 -0
  40. data/lib/knapsack_pro/extensions/time.rb +2 -0
  41. data/lib/knapsack_pro/formatters/rspec_json_formatter.rb +2 -0
  42. data/lib/knapsack_pro/formatters/rspec_queue_profile_formatter_extension.rb +2 -0
  43. data/lib/knapsack_pro/formatters/rspec_queue_summary_formatter.rb +2 -0
  44. data/lib/knapsack_pro/hooks/queue.rb +2 -0
  45. data/lib/knapsack_pro/logger_wrapper.rb +2 -0
  46. data/lib/knapsack_pro/mask_string.rb +2 -0
  47. data/lib/knapsack_pro/presenter.rb +2 -0
  48. data/lib/knapsack_pro/queue_allocator.rb +2 -0
  49. data/lib/knapsack_pro/queue_allocator_builder.rb +2 -0
  50. data/lib/knapsack_pro/railtie.rb +2 -0
  51. data/lib/knapsack_pro/report.rb +2 -0
  52. data/lib/knapsack_pro/repository_adapter_initiator.rb +2 -0
  53. data/lib/knapsack_pro/repository_adapters/base_adapter.rb +2 -0
  54. data/lib/knapsack_pro/repository_adapters/env_adapter.rb +2 -0
  55. data/lib/knapsack_pro/repository_adapters/git_adapter.rb +2 -0
  56. data/lib/knapsack_pro/runners/base_runner.rb +2 -0
  57. data/lib/knapsack_pro/runners/cucumber_runner.rb +2 -0
  58. data/lib/knapsack_pro/runners/minitest_runner.rb +2 -0
  59. data/lib/knapsack_pro/runners/queue/base_runner.rb +2 -0
  60. data/lib/knapsack_pro/runners/queue/cucumber_runner.rb +2 -0
  61. data/lib/knapsack_pro/runners/queue/minitest_runner.rb +2 -0
  62. data/lib/knapsack_pro/runners/queue/rspec_runner.rb +2 -0
  63. data/lib/knapsack_pro/runners/rspec_runner.rb +2 -0
  64. data/lib/knapsack_pro/runners/spinach_runner.rb +2 -0
  65. data/lib/knapsack_pro/runners/test_unit_runner.rb +2 -0
  66. data/lib/knapsack_pro/slow_test_file_determiner.rb +2 -0
  67. data/lib/knapsack_pro/slow_test_file_finder.rb +2 -0
  68. data/lib/knapsack_pro/task_loader.rb +2 -0
  69. data/lib/knapsack_pro/test_case_detectors/rspec_test_example_detector.rb +2 -0
  70. data/lib/knapsack_pro/test_case_mergers/base_merger.rb +2 -0
  71. data/lib/knapsack_pro/test_case_mergers/rspec_merger.rb +2 -0
  72. data/lib/knapsack_pro/test_file_cleaner.rb +2 -0
  73. data/lib/knapsack_pro/test_file_finder.rb +2 -0
  74. data/lib/knapsack_pro/test_file_pattern.rb +2 -0
  75. data/lib/knapsack_pro/test_file_presenter.rb +2 -0
  76. data/lib/knapsack_pro/test_files_with_test_cases_composer.rb +2 -0
  77. data/lib/knapsack_pro/test_flat_distributor.rb +2 -0
  78. data/lib/knapsack_pro/tracker.rb +2 -0
  79. data/lib/knapsack_pro/utils.rb +2 -0
  80. data/lib/knapsack_pro/version.rb +3 -1
  81. data/lib/knapsack_pro.rb +2 -0
  82. data/lib/tasks/cucumber.rake +2 -0
  83. data/lib/tasks/encrypted_branch_names.rake +2 -0
  84. data/lib/tasks/encrypted_test_file_names.rake +2 -0
  85. data/lib/tasks/minitest.rake +2 -0
  86. data/lib/tasks/queue/cucumber.rake +2 -0
  87. data/lib/tasks/queue/minitest.rake +2 -0
  88. data/lib/tasks/queue/rspec.rake +2 -0
  89. data/lib/tasks/rspec.rake +2 -0
  90. data/lib/tasks/salt.rake +2 -0
  91. data/lib/tasks/spinach.rake +2 -0
  92. data/lib/tasks/test_unit.rake +2 -0
  93. data/spec/knapsack_pro/config/ci/app_veyor_spec.rb +14 -0
  94. data/spec/knapsack_pro/config/ci/codefresh_spec.rb +15 -0
  95. data/spec/knapsack_pro/config/ci/codeship_spec.rb +14 -0
  96. data/spec/knapsack_pro/config/env_spec.rb +1 -1
  97. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e62965afc4edc8d9b00b2a2706499f2013b7e17df08d1864ba8bd6e25aae29ab
4
- data.tar.gz: 2b5c2d0a48780c1f71fa8d99dcae03d23d1001cabcd9a7dbe6a243b32e152e75
3
+ metadata.gz: fa2ae33f8d962bbd8d5f1639e050f2a43e9ad28bf655d637d43ca2c23bc1d7d3
4
+ data.tar.gz: 70e747f428235b65bba04ed2f748221170a6971e8982e0ab0fbbdb60177d9a94
5
5
  SHA512:
6
- metadata.gz: 4a4d493dc1b46234b78f231567d7bfc7c1a6cf356dc0e02306f7a7c3261afd600b72be07c389c051ed96e09e491abc95f8d703c1432a22d1ed97d875b8d1fdf6
7
- data.tar.gz: d406b157ef48520309ac3fb043738515105612f89389753a153ed074398f9b7f5bf5f6766f3c57a3407c25eb0982d81b5bc8109f8f8a4ac09911847a2c512c16
6
+ metadata.gz: ed58c0b63af2f3301e7233c142da4165a9c2c9a4f31987d465a803d3b4fdab590137d2ef71bbf6b80b9abc95f513cea605091b5caa7fcd0598620790977cc29b
7
+ data.tar.gz: 607af355f302481ca595f577428ea49565e711a790c284d7fb595f0f15106070a99e85acf4ebd5cf0e073e672ee37f9d851eb2b464c372dca550bf5c878c8050
data/.circleci/config.yml CHANGED
@@ -30,10 +30,14 @@ jobs:
30
30
  command: |
31
31
  bundle install --jobs=4 --retry=3 --path vendor/bundle
32
32
 
33
+ - run: gem install rubocop
34
+
33
35
  - save_cache:
34
36
  paths:
35
37
  - ./vendor/bundle
36
38
  key: v2-dependencies-bundler-{{ checksum "knapsack_pro.gemspec" }}
37
39
 
38
- # run tests!
40
+ # enforce `frozen_string_literal: true` in the gem files
41
+ - run: rubocop -A --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment lib/
42
+
39
43
  - run: bundle exec rspec spec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ### 5.6.0
4
+
5
+ * Use `frozen_string_literal: true` to reduce memory usage
6
+
7
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/220
8
+
9
+ * Enforce `frozen_string_literal: true` in the gem files with Rubocop
10
+
11
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/222
12
+
13
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.5.0...v5.6.0
14
+
15
+ ### 5.5.0
16
+
17
+ * Detect user seats for AppVeyor, Codefresh, Codeship
18
+
19
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/221
20
+
21
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.4.1...v5.5.0
22
+
3
23
  ### 5.4.1
4
24
 
5
25
  * Fixes RSpec conflict (see https://github.com/KnapsackPro/knapsack_pro-ruby/issues/217)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Adapters
3
5
  class BaseAdapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Adapters
3
5
  class CucumberAdapter < BaseAdapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Adapters
3
5
  class MinitestAdapter < BaseAdapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Adapters
3
5
  class RSpecAdapter < BaseAdapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Adapters
3
5
  class SpinachAdapter < BaseAdapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Adapters
3
5
  class TestUnitAdapter < BaseAdapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class Allocator
3
5
  def initialize(args)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class AllocatorBuilder < BaseAllocatorBuilder
3
5
  def allocator
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class BaseAllocatorBuilder
3
5
  TEST_RUNNER_MAP = {
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class BuildDistributionFetcher
3
5
  class BuildDistributionEntity
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Client
3
5
  module API
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Client
3
5
  module API
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Client
3
5
  module API
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Client
3
5
  module API
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Client
3
5
  module API
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Client
3
5
  class Connection
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # https://www.appveyor.com/docs/environment-variables/
2
4
  module KnapsackPro
3
5
  module Config
@@ -27,6 +29,10 @@ module KnapsackPro
27
29
  ENV['APPVEYOR_BUILD_FOLDER']
28
30
  end
29
31
 
32
+ def user_seat
33
+ ENV['APPVEYOR_REPO_COMMIT_AUTHOR']
34
+ end
35
+
30
36
  def detected
31
37
  ENV.key?('APPVEYOR') ? self.class : nil
32
38
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Config
3
5
  module CI
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Config
3
5
  module CI
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Config
3
5
  module CI
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Config
3
5
  module CI
@@ -26,6 +28,10 @@ module KnapsackPro
26
28
  ENV['CIRRUS_WORKING_DIR']
27
29
  end
28
30
 
31
+ def user_seat
32
+ # not provided
33
+ end
34
+
29
35
  def detected
30
36
  ENV.key?('CIRRUS_CI') ? self.class : nil
31
37
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # https://codefresh.io/docs/docs/codefresh-yaml/variables/#system-provided-variables
2
4
  module KnapsackPro
3
5
  module Config
@@ -27,6 +29,10 @@ module KnapsackPro
27
29
  # not provided
28
30
  end
29
31
 
32
+ def user_seat
33
+ ENV['CF_BUILD_INITIATOR']
34
+ end
35
+
30
36
  def detected
31
37
  ENV.key?('CF_BUILD_ID') ? self.class : nil
32
38
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Config
3
5
  module CI
@@ -26,6 +28,10 @@ module KnapsackPro
26
28
  # not provided
27
29
  end
28
30
 
31
+ def user_seat
32
+ ENV['CI_COMMITTER_NAME']
33
+ end
34
+
29
35
  def detected
30
36
  ENV['CI_NAME'] == 'codeship' ? self.class : nil
31
37
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables
2
4
  module KnapsackPro
3
5
  module Config
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # https://docs.gitlab.com/ce/ci/variables/
2
4
  module KnapsackPro
3
5
  module Config
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Config
3
5
  module CI
@@ -26,6 +28,10 @@ module KnapsackPro
26
28
  '/app' if node_build_id
27
29
  end
28
30
 
31
+ def user_seat
32
+ # not provided
33
+ end
34
+
29
35
  def detected
30
36
  ENV.key?('HEROKU_TEST_RUN_ID') ? self.class : nil
31
37
  end
@@ -1,6 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Config
3
5
  module CI
6
+ # Semaphore Classic is deprecated
7
+ # https://semaphoreci.com/blog/semaphore-classic-deprecation
4
8
  class Semaphore < Base
5
9
  def node_total
6
10
  ENV['SEMAPHORE_THREAD_COUNT']
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # https://docs.semaphoreci.com/article/12-environment-variables
2
4
  module KnapsackPro
3
5
  module Config
@@ -30,6 +32,10 @@ module KnapsackPro
30
32
  end
31
33
  end
32
34
 
35
+ def user_seat
36
+ # not provided
37
+ end
38
+
33
39
  def detected
34
40
  # check 2 keys to be sure we are using Semaphore 2.0
35
41
  ENV.key?('SEMAPHORE') && ENV.key?('SEMAPHORE_WORKFLOW_ID') ? self.class : nil
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Config
3
5
  module CI
@@ -18,6 +20,10 @@ module KnapsackPro
18
20
  ENV['TRAVIS_BUILD_DIR']
19
21
  end
20
22
 
23
+ def user_seat
24
+ # not provided
25
+ end
26
+
21
27
  def detected
22
28
  ENV.key?('TRAVIS') ? self.class : nil
23
29
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Config
3
5
  class Env
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Config
3
5
  class EnvGenerator
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Config
3
5
  class TempFiles
@@ -22,10 +24,12 @@ module KnapsackPro
22
24
  end
23
25
 
24
26
  def self.gitignore_file_content
25
- "# This directory is used by knapsack_pro gem for storing temporary files during tests runtime.\n" <<
26
- "# Ignore all files, and do not commit this directory into your repository.\n" <<
27
- "# Learn more at https://knapsackpro.com\n" <<
28
- "*"
27
+ <<~GITIGNORE
28
+ # This directory is used by knapsack_pro gem for storing temporary files during tests runtime.
29
+ # Ignore all files, and do not commit this directory into your repository.
30
+ # Learn more at https://knapsackpro.com
31
+ *
32
+ GITIGNORE
29
33
  end
30
34
 
31
35
  def self.create_gitignore_file!
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Crypto
3
5
  class BranchEncryptor
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Crypto
3
5
  class Decryptor
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Crypto
3
5
  class Digestor
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Crypto
3
5
  class Encryptor
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'time'
2
4
 
3
5
  class Time
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec::Support.require_rspec_core('formatters/json_formatter')
2
4
 
3
5
  # based on https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/formatters/json_formatter.rb
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec::Support.require_rspec_core('formatters/profile_formatter')
2
4
 
3
5
  module KnapsackPro
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec::Support.require_rspec_core('formatters/base_formatter')
2
4
  RSpec::Support.require_rspec_core('formatters/base_text_formatter')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Hooks
3
5
  class Queue
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class LoggerWrapper
3
5
  def initialize(logger)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class MaskString
3
5
  def self.call(string)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class Presenter
3
5
  class << self
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class QueueAllocator
3
5
  def initialize(args)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class QueueAllocatorBuilder < BaseAllocatorBuilder
3
5
  def allocator
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails'
2
4
  require 'knapsack_pro'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class Report
3
5
  def self.save
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class RepositoryAdapterInitiator
3
5
  def self.call
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module RepositoryAdapters
3
5
  class BaseAdapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module RepositoryAdapters
3
5
  class EnvAdapter < BaseAdapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module RepositoryAdapters
3
5
  class GitAdapter < BaseAdapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Runners
3
5
  class BaseRunner
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Runners
3
5
  class CucumberRunner < BaseRunner
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Runners
3
5
  class MinitestRunner < BaseRunner
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Runners
3
5
  module Queue
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Runners
3
5
  module Queue
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Runners
3
5
  module Queue
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Runners
3
5
  module Queue
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Runners
3
5
  class RSpecRunner < BaseRunner
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Runners
3
5
  class SpinachRunner < BaseRunner
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module Runners
3
5
  class TestUnitRunner < BaseRunner
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class SlowTestFileDeterminer
3
5
  TIME_THRESHOLD_PER_CI_NODE = 0.7 # 70%
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class SlowTestFileFinder
3
5
  # Get recorded test files from API.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake'
2
4
 
3
5
  module KnapsackPro
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module TestCaseDetectors
3
5
  class RSpecTestExampleDetector
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module TestCaseMergers
3
5
  class BaseMerger
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  module TestCaseMergers
3
5
  class RSpecMerger < BaseMerger
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class TestFileCleaner
3
5
  def self.clean(test_file_path)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class TestFileFinder
3
5
  def self.call(test_file_pattern, test_file_list_enabled: true)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class TestFilePattern
3
5
  def self.call(adapter_class)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class TestFilePresenter
3
5
  def self.stringify_paths(test_file_paths)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class TestFilesWithTestCasesComposer
3
5
  # Args:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class TestFlatDistributor
3
5
  DIR_TYPES = [
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class Tracker
3
5
  include Singleton
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
4
  class Utils
3
5
  def self.unsymbolize(obj)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KnapsackPro
2
- VERSION = '5.4.1'
4
+ VERSION = '5.6.0'
3
5
  end
data/lib/knapsack_pro.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'logger'
2
4
  require 'singleton'
3
5
  require 'net/http'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'knapsack_pro'
2
4
 
3
5
  namespace :knapsack_pro do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'knapsack_pro'
2
4
 
3
5
  namespace :knapsack_pro do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'knapsack_pro'
2
4
 
3
5
  namespace :knapsack_pro do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'knapsack_pro'
2
4
 
3
5
  namespace :knapsack_pro do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'knapsack_pro'
2
4
 
3
5
  namespace :knapsack_pro do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'knapsack_pro'
2
4
 
3
5
  namespace :knapsack_pro do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'knapsack_pro'
2
4
 
3
5
  namespace :knapsack_pro do
data/lib/tasks/rspec.rake CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'knapsack_pro'
2
4
 
3
5
  namespace :knapsack_pro do
data/lib/tasks/salt.rake CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  namespace :knapsack_pro do
2
4
  task :salt, [:size] do |_, args|
3
5
  default_size = 32
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'knapsack_pro'
2
4
 
3
5
  namespace :knapsack_pro do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'knapsack_pro'
2
4
 
3
5
  namespace :knapsack_pro do
@@ -70,4 +70,18 @@ describe KnapsackPro::Config::CI::AppVeyor do
70
70
  it { should be nil }
71
71
  end
72
72
  end
73
+
74
+ describe '#user_seat' do
75
+ subject { described_class.new.user_seat }
76
+
77
+ context 'when the APPVEYOR_REPO_COMMIT_AUTHOR environment variable exists' do
78
+ let(:env) { { 'APPVEYOR_REPO_COMMIT_AUTHOR' => 'jane_doe' } }
79
+
80
+ it { should eql 'jane_doe' }
81
+ end
82
+
83
+ context "when the APPVEYOR_REPO_COMMIT_AUTHOR environment variable doesn't exist" do
84
+ it { should be nil }
85
+ end
86
+ end
73
87
  end
@@ -63,4 +63,19 @@ describe KnapsackPro::Config::CI::Codefresh do
63
63
 
64
64
  it { should be nil }
65
65
  end
66
+
67
+
68
+ describe '#user_seat' do
69
+ subject { described_class.new.user_seat }
70
+
71
+ context 'when the CF_BUILD_INITIATOR environment variable exists' do
72
+ let(:env) { { 'CF_BUILD_INITIATOR' => 'jane_doe' } }
73
+
74
+ it { should eql 'jane_doe' }
75
+ end
76
+
77
+ context "when the CF_BUILD_INITIATOR environment variable doesn't exist" do
78
+ it { should be nil }
79
+ end
80
+ end
66
81
  end
@@ -63,4 +63,18 @@ describe KnapsackPro::Config::CI::Codeship do
63
63
 
64
64
  it { should be nil }
65
65
  end
66
+
67
+ describe '#user_seat' do
68
+ subject { described_class.new.user_seat }
69
+
70
+ context 'when the CI_COMMITTER_NAME environment variable exists' do
71
+ let(:env) { { 'CI_COMMITTER_NAME' => 'jane_doe' } }
72
+
73
+ it { should eql 'jane_doe' }
74
+ end
75
+
76
+ context "when the CI_COMMITTER_NAME environment variable doesn't exist" do
77
+ it { should be nil }
78
+ end
79
+ end
66
80
  end
@@ -1082,7 +1082,7 @@ describe KnapsackPro::Config::Env do
1082
1082
  ['Other', { 'CI' => 'true'}],
1083
1083
  [nil, {}],
1084
1084
  ].each do |ci, env|
1085
- it "detects #{ci} name" do
1085
+ it "detects #{ci || 'missing CI from env or development'}" do
1086
1086
  stub_const("ENV", env)
1087
1087
 
1088
1088
  expect(described_class.ci_provider).to eq(ci)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knapsack_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.1
4
+ version: 5.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-21 00:00:00.000000000 Z
11
+ date: 2023-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake