rspecq 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8bcc40eeeccb4d94e795f524f7f6bce73454a25ebb1907c58523e7e775740a7
4
- data.tar.gz: 93d9aa04b32ef60c430c505fb7cd4d147ca2e106be442ebd5f6bd18221db4841
3
+ metadata.gz: d62ec9f80b28ee9acd347b82b484eeeb0e7a6b21f76e201a19d14477840f91a3
4
+ data.tar.gz: 8b20f8f635cc3bec96707e29f6547a060baf7131c6e53527e3e1ce8583e5e27b
5
5
  SHA512:
6
- metadata.gz: 80b3eea41c65a3f759c895c0aaf9895c67b4fd2d4c57acb3b8d193fa2522e654735eed33f96a1800a34d5471e5ed83768c2d2c1a31c8a6975c16673f3aaffa79
7
- data.tar.gz: dfe2e954fc0d83be7da5bd4c3b24c236950ac6f088ec6a46284954c5e49609c8dea6e15222ccbf5d9d1be353f28671a61e68a04d90bd4b19fb791b2acae685fd
6
+ metadata.gz: 327351debae5f53a3a0be189fc7ff59877030d38d640e3310bb6cd24ec8944e7b38f7761f88e05fa5fa5804d37bbc5fd4889839829f88d96f1d84e1545de6625
7
+ data.tar.gz: 4ba95049a709afb17feebd22617c7018528fe9f2379170f93913e66e10ddb2723eb01411b228087efe8cfb27a255a7dacce7cddd283246da89c34dbbfe2d5fc0
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ Breaking changes are prefixed with a "[BREAKING]" label.
4
4
 
5
5
  ## master (unreleased)
6
6
 
7
+ ## 0.7.2 (2021-11-15)
8
+
9
+ - Add tag option to filter specs (@jorge-wonolo)
10
+
7
11
  ## 0.7.1 (2021-04-08)
8
12
 
9
13
  - New env variable RSPECQ_REPORTER_RERUN_COMMAND_SKIP. When set, the reporter
data/README.md CHANGED
@@ -77,6 +77,7 @@ OPTIONS:
77
77
  --queue-wait-timeout N Time to wait for a queue to be ready before considering it failed (default: 30).
78
78
  --fail-fast N Abort build with a non-zero status code after N failed examples.
79
79
  --reproduction Enable reproduction mode: Publish files and examples in the exact order given in the command. Incompatible with --timings.
80
+ --tag TAG Run examples with the specified tag, or exclude examples by adding ~ before the tag. - e.g. ~slow - TAG is always converted to a symbol.
80
81
  -h, --help Show this message.
81
82
  -v, --version Print the version and exit.
82
83
  ```
@@ -84,7 +85,7 @@ OPTIONS:
84
85
  You can set most options using ENV variables:
85
86
 
86
87
  ```shell
87
- $ RSPECQ_BUILD=123 RSPECQ_WORKDER=foo1 rspecq spec/
88
+ $ RSPECQ_BUILD=123 RSPECQ_WORKER=foo1 rspecq spec/
88
89
  ```
89
90
 
90
91
  ### Supported ENV variables
data/bin/rspecq CHANGED
@@ -12,7 +12,9 @@ def env_set?(var)
12
12
  ["1", "true"].include?(ENV[var])
13
13
  end
14
14
 
15
- opts = {}
15
+ opts = {
16
+ tags: []
17
+ }
16
18
 
17
19
  OptionParser.new do |o|
18
20
  name = File.basename($PROGRAM_NAME)
@@ -112,6 +114,13 @@ OptionParser.new do |o|
112
114
  exit
113
115
  end
114
116
 
117
+ o.on("--tag TAG", "Run examples with the specified tag, or exclude examples " \
118
+ "by adding ~ before the tag." \
119
+ " - e.g. ~slow" \
120
+ " - TAG is always converted to a symbol.") do |tag|
121
+ opts[:tags] << tag
122
+ end
123
+
115
124
  o.on_tail("-v", "--version", "Print the version and exit.") do
116
125
  puts "#{name} #{RSpecQ::VERSION}"
117
126
  exit
@@ -169,5 +178,6 @@ else
169
178
  worker.fail_fast = opts[:fail_fast]
170
179
  worker.seed = Integer(opts[:seed]) if opts[:seed]
171
180
  worker.reproduction = opts[:reproduction]
181
+ worker.tags = opts[:tags]
172
182
  worker.work
173
183
  end
@@ -1,3 +1,3 @@
1
1
  module RSpecQ
2
- VERSION = "0.7.1".freeze
2
+ VERSION = "0.7.2".freeze
3
3
  end
data/lib/rspecq/worker.rb CHANGED
@@ -54,6 +54,9 @@ module RSpecQ
54
54
  # The RSpec seed
55
55
  attr_accessor :seed
56
56
 
57
+ # Rspec tags
58
+ attr_accessor :tags
59
+
57
60
  # Reproduction flag. If true, worker will publish files in the exact order
58
61
  # given in the command.
59
62
  attr_accessor :reproduction
@@ -72,6 +75,7 @@ module RSpecQ
72
75
  @max_requeues = 3
73
76
  @queue_wait_timeout = 30
74
77
  @seed = srand && srand % 0xFFFF
78
+ @tags = []
75
79
  @reproduction = false
76
80
 
77
81
  RSpec::Core::Formatters.register(Formatters::JobTimingRecorder, :dump_summary)
@@ -122,8 +126,10 @@ module RSpecQ
122
126
  if populate_timings
123
127
  RSpec.configuration.add_formatter(Formatters::JobTimingRecorder.new(queue, job))
124
128
  end
125
-
126
- opts = RSpec::Core::ConfigurationOptions.new(["--format", "progress", job])
129
+
130
+ options = ["--format", "progress", job]
131
+ tags.each { |tag| options.push(*["--tag", tag]) }
132
+ opts = RSpec::Core::ConfigurationOptions.new(options)
127
133
  _result = RSpec::Core::Runner.new(opts).run($stderr, $stdout)
128
134
 
129
135
  queue.acknowledge_job(job)
@@ -149,7 +155,6 @@ module RSpecQ
149
155
  )
150
156
  return
151
157
  end
152
-
153
158
  RSpec.configuration.files_or_directories_to_run = files_or_dirs_to_run
154
159
  files_to_run = RSpec.configuration.files_to_run.map { |j| relative_path(j) }
155
160
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspecq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agis Anastasopoulos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-08 00:00:00.000000000 Z
11
+ date: 2021-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-core