Commit Graph

25 Commits

Author SHA1 Message Date
Isaac Moore 0e3e8c7ce7 Switch from `sentry-raven` to `sentry-ruby`
Fixes skroutz/rspecq#68
2022-01-03 10:08:15 -06:00
James Butters 1152c8c579 reporter respect the queue-wait-timeout option
currently the reporter does not respect the queue-wait-timeout
option. Send that option to the reporter initializer.
2021-08-18 18:50:31 -06:00
Rob Christie 7c16e65b4a Rename junit-formatter option to junit-output. 2021-07-15 11:26:15 -07:00
Rob Christie acae702c45 Add ability to define formatter file name and path. 2021-07-15 11:23:04 -07:00
Rob Christie 5ed7b55512 Cleanup debugging. 2021-07-15 11:19:50 -07:00
Rob Christie 9b77993ab5 Add suite to filename when option is set. 2021-07-15 11:09:45 -07:00
Jacob Smith b3c96bd51c Pass through rspec arguments 2021-07-15 10:40:46 -07:00
John Fragoulis 6f53a305a8 Introduce 'reproduction' argument
The new argument modifies how the rspecq worker publishes the files and
examples to the queue.

By detault it first merges individual examples into files and then
depending on whether the `update-timings` is passed, it will either
publish based on the timings or randomly shuffly them.

If the `reproduction` argument is passed, the worker will ignore timings and
randomness and will publish the files exactly as given.

This feature is very important in order for a developer to be able to
successfully reproduce a flaky test as reported by the reporter in a previous
run.
2021-04-01 16:07:17 +03:00
John Fragoulis 36dc9376b8 Allow rspecq to accept more than one files/locations as arguments 2021-03-31 17:55:09 +03:00
John Fragoulis 7168495afa Expose the rspec seed to the worker 2021-03-23 11:47:58 +02:00
John Fragoulis 4e6411da85 Improve deprecation message for --redis option 2021-03-18 12:44:28 +02:00
John Fragoulis f9559fb248 Expose the queue ready timeout
This commit exposes the timeout we use to consider a queue failed
(not ready).

The need for this was triggered after using rspecq on a host
with lower specs.
2021-02-05 10:52:11 +02:00
Agis Anastasopoulos 6f0077a60e Bootstrap Rubocop configuration and fix offenses 2020-10-11 14:01:39 +03:00
Kostas Pelelis a7b1709cdf queue: Enable fast failure
These commits adds support on the Queue class to terminate builds after
a certain threshold of failures is surpassed. This configuration is
controlled via the `Queue#publish` method and it is persisted on Redis
Hash[1]. The persistence is added so that the value is shared between
different components that use the same queue instance. (e.g. worker and
reporter)

The feature can be enabled via the `--fail-fast` flag which is passed
onto the worker. This is in par with RSpec's `--fail-fast`[2] which will
terminate the execution of the suite after certain failed examples.
This is an optional flag, and will be nil if not set.

[1]: https://redis.io/topics/data-types#hashes
[2]: https://relishapp.com/rspec/rspec-core/docs/command-line/fail-fast-option
2020-10-05 15:28:35 +03:00
Agis Anastasopoulos febfa9af33 Fix host setting via the --redis-url option
Since we always set a default --redis-host, setting the host from --redis-url
was not possible because the value from --redis-host always took precedence.

With this change, --redis-url always takes precedence and it's possible
to properly set the host using it.
2020-10-05 14:09:49 +03:00
Daniel Westendorf 9c4b77dd84
Add support for specifying redis host via a redis URL (#40)
* Add support for connecting to redis via URL

Nearly identical implementation to https://github.com/skroutz/rspecq/pull/25 by @hiroshikimura

* Add --redis-host CLI option

As specified here: https://github.com/skroutz/rspecq/pull/25#issuecomment-683130330

+ Add a deprecation message when using `-r` or `--redis` CLI options.

* Apply suggestions from code review

* Implement review comments. Closes #37
2020-10-01 10:06:57 +03:00
Agis Anastasopoulos a41b849b9b worker: Move `files_or_dirs_to_run` to an accessor
Since we set a reasonable default ("spec", like RSpec does) that will fit most
of the cases, this setting doesn't have to be provided during Worker
initialization. This simplifies Worker#initialize.
2020-08-08 22:49:22 +03:00
Agis Anastasopoulos 3364dd0213 Implement Sentry integration
This patch adds support for Workers to emit various RSpecQ internal events to
a Sentry[1] instance.

Reporting to Sentry is opt-in and is enabled by setting the SENTRY_DSN
environment variable (see
https://github.com/getsentry/raven-ruby#raven-only-runs-when-sentry_dsn-is-set).
If SENTRY_DSN is not set this is a noop.

Events emitted:

- [error] the spec file split command failed; slow spec files files will
  be scheduled as a whole so build times will be negatively impacted
- [warning] no previous timings were found in Redis; scheduling will be random
  so build times will be negatively impacted
- [info] slow files were detected and will be split, including the
  actual filenames

The above are still printed to the standard output of the worker.

Closes #8

[1] https://sentry.io
2020-08-08 21:58:17 +03:00
Roy Zwambag 8d6b0305f7
Add option to set max requeues (#14)
Adds a CLI option to set max-requeues. It will default to 3 if the
option is not given.

Fixes #14
2020-08-03 22:24:24 +03:00
Agis Anastasopoulos 4fa80e2712 Minor CLI help text improvements 2020-07-25 23:19:22 +03:00
Agis Anastasopoulos 4323a75ca3 Don't require a worker ID in reporter
Also improve the README
2020-07-05 14:10:24 +03:00
Agis Anastasopoulos c5192303e2 Also read config from environment variables
Additionally:

- rename `--timings` to `--update-timings`
- don't communicate the default value of `--file-split-threshold`. We
  handle this transparently (effectively disable it if it's not set) by
  passing a very large value

Closes #4
2020-07-05 10:56:34 +03:00
Agis Anastasopoulos df9faa8ec6 Improve CLI
- Improve descriptions
- Add shorthand version of flags
- Factor out defaults into constants
- Add checks for invalid flag combinations
- Add `--help` and `--version`
2020-07-05 00:01:27 +03:00
Agis Anastasopoulos f735362e97 Require 'optparse' instead of 'optionparser'
optionparser just requires optparse anyway.
2020-07-05 00:01:27 +03:00
Agis Anastasopoulos 9e386d9ff6 Initial commit 2020-06-26 09:32:07 +03:00