rspec-flaky 0.0.2 → 0.0.4

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: 68908861a9d1deb8870d2b981c08d3b4d2e35a71c51f73a389ae2be398cbe03d
4
- data.tar.gz: be50f21c01defd91ae738ec9d1d19f3ecfe0ee4b606eddfabc241fea0d1843e1
3
+ metadata.gz: 826e6c22729b3b955a7ca25dc24ea7ba8ff757065e1f3bd9e1ee0d6d16863b84
4
+ data.tar.gz: 8a762da31ba315fa31e2c23aadcc41af610a924d13340d64fb404695ad59c4b3
5
5
  SHA512:
6
- metadata.gz: 158aea7d249eae4e938e0d12a2ac898a059a13c8ae32ce41b7fd408c3c781b953306ade0dabacd62c6879c4a1f9176f1d034a080a2c41bb672afdcb1eb98ee50
7
- data.tar.gz: f3d2d3b53a66bc4c076b8088a55dca8cd83dc754fbe8fef678f507630fa335ce848e0dba36dfaeb2190483eb095a92e15987c932b07039e022d52a623bcc9791
6
+ metadata.gz: 977b1809217a067d53ae5bb5bc61159f7fbaf7470166066c40f33fdc4662271afc7ed511987e076661988bb1a27c960b18584f6ae5199d055f56bae64cd10781
7
+ data.tar.gz: dc8b0ef75a807202c522f1cc9e0b8373542ef13144f5ee7c50a887a74ed6cc86f062bdaffd630dd32ec4eb42902c7c2cc8fba4a321bf69f554b46b57ed8d07dc
data/README.md CHANGED
@@ -1,38 +1,60 @@
1
1
  # RSpecFlaky
2
2
 
3
- TODO: Write a gem description
3
+ The most common reason for test flakiness is randomized factories which fill a database before test execution. This small gem is designed to help you find out what exactly attribute values were assigned to an investigated model during a failed and passed execution.
4
+
5
+ ![image](https://user-images.githubusercontent.com/43433100/106516737-8e72a380-64e8-11eb-9758-34e5cb9f278b.png)
6
+
4
7
 
5
8
  ## Installation
6
9
 
7
10
  Add this line to test group of your application's Gemfile:
8
11
 
9
- gem 'rspec-flaky'
12
+ ```bash
13
+ gem 'rspec-flaky'
14
+ ```
10
15
 
11
16
  Install the gem:
12
17
 
13
- $ bundle
18
+ ```bash
19
+ bundle
20
+ ```
21
+
22
+ That's all. Select the model whose attributes will be dumped:
14
23
 
15
- And then add this line to your spec/spec_helper.rb:
24
+ ```ruby
25
+ it 'is flaky test', tables: [User, Post] do
26
+ expect([true, false]).to be true
27
+ end
28
+ ```
29
+ ## Usage
16
30
 
17
- require 'rspec/flaky'
31
+ Run the command to iteratively run flaky example (option `-i` specifies the number of iterations):
18
32
 
19
- Select the model whose attributes will be dumped:
33
+ ```bash
34
+ rspec-flaky path/to/flaky_spec.rb:12 -i 5
35
+ ```
20
36
 
21
- it 'is flaky test', tables: [User, Post] do
22
- expect([true, false]).to be true
23
- end
37
+ If at least one example is failed gem will generate tables where you are able to investigate source of flakiness by comparing failed and success attribute values. After running your tests, open `tmp/flaky_tests/result.html` in the browser of your choice. For example, in a Mac Terminal, run the following command from your application's root directory:
24
38
 
25
- ## Usage
26
39
 
27
- Run the command to iteratively run flaky example:
40
+ ```bash
41
+ open tmp/flaky_tests/result.html
42
+ ```
43
+ in a debian/ubuntu Terminal,
44
+
45
+ ```bash
46
+ xdg-open tmp/flaky_tests/result.html
47
+ ```
28
48
 
29
- rspec-flaky path/to/flaky_spec.rb:12 -i 10 -j -d
49
+ **Note:** [This guide](https://dwheeler.com/essays/open-files-urls.html) can help if you're unsure which command your particular
50
+ operating system requires.
30
51
 
31
- -i - iterations number
32
- -j - save pointed model attributes to tmp/flaky_tests/.:flaky_spec:12 as json
33
- -d - save database dump after each example to tmp/flaky_tests/database_dumps/.:flaky_spec:12 as sql file
34
52
 
35
- If at least one example is failed you can compare pointed model's attributes dumped to tmp/flaky_test folder.
53
+ It's also possible to dump the whole database per each test example if there was a failed result as well as a passed result. For that just add `-d` option (currently only PostresQL is available):
54
+
55
+ ```
56
+ rspec-flaky path/to/flaky_speЗc.rb:12 -i 10 -d
57
+ ```
36
58
 
37
59
  ## Contributing
38
60
 
@@ -40,4 +62,4 @@ If at least one example is failed you can compare pointed model's attributes dum
40
62
  2. Create your feature branch (`git checkout -b my-new-feature`)
41
63
  3. Commit your changes (`git commit -am 'Add some feature'`)
42
64
  4. Push to the branch (`git push origin my-new-feature`)
43
- 5. Create new Pull Request
65
+ 5. Create new Pull Request
@@ -5,7 +5,7 @@ module Flaky
5
5
  class CLI
6
6
 
7
7
  DEFAULT_OPTIONS = {
8
- iterations: 1,
8
+ iterations: 10,
9
9
  silent: false,
10
10
  save_jsons: false,
11
11
  dump_db: false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module RSpecFlaky
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-flaky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - maratz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-28 00:00:00.000000000 Z
11
+ date: 2021-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashdiff
@@ -45,7 +45,7 @@ files:
45
45
  - lib/rspec/flaky/pathes.rb
46
46
  - lib/rspec/flaky/tables.rb
47
47
  - lib/rspec/flaky/version.rb
48
- homepage: https://github.com/mzsrn/rspec-flaky
48
+ homepage: https://github.com/RND-SOFT/rspec-flaky
49
49
  licenses:
50
50
  - MIT
51
51
  metadata: {}
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  - !ruby/object:Gem::Version
65
65
  version: '0'
66
66
  requirements: []
67
- rubygems_version: 3.0.3
67
+ rubygems_version: 3.0.8
68
68
  signing_key:
69
69
  specification_version: 4
70
70
  summary: Gem for catching flaky specs