flakon 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3f9f203e4d1c0638b0064255a30e605175f451cd1123c3ce00719de97e8e696b
4
+ data.tar.gz: b8d7a5e6c580584ec64eeb9beeca03bf02eece7ed8fab067a6e12dfb2ff68d3f
5
+ SHA512:
6
+ metadata.gz: fc5cfb5215ced4394dfac51804b64b74aa2e2045e4d623b6f7d3273173fc6223a864297aaefa2f949492c5e4b5e860a2dafbce885e666389fc983cfc857ebcc0
7
+ data.tar.gz: 1652f28cf706d9e9e5a9dc01be0dd8c01168d558ea8cab1077ee9447aa4753a0ccf9f83828591896c842506bfa3f719174bdec48f51ab1fe7f7f04fd9773a6c8
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Change log
2
+
3
+ ## master
4
+
5
+ [@palkan]: https://github.com/palkan
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2021 Vladimir Dementyev
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ [![Gem Version](https://badge.fury.io/rb/flakon.svg)](https://rubygems.org/gems/flakon)
2
+
3
+ # Flakon
4
+
5
+ Smart flaky tests detection for Rails apps.
6
+
7
+ ## Installation
8
+
9
+ Add gem to your project:
10
+
11
+ ```ruby
12
+ # Gemfile
13
+ gem "flakon", group: :test
14
+ ```
15
+
16
+ ### Supported Ruby versions
17
+
18
+ - Ruby (MRI) >= 2.5.0
19
+
20
+ ## Usage
21
+
22
+ Make sure `flakon` is loaded:
23
+
24
+ - Happens automatically when you load a Rails app unless you added `require: false` in the Gemfile).
25
+ - Add `require 'flakon'` in your `rails_helper.rb` / `test_helper.rb`.
26
+
27
+ To enable flaky tests analysis, run tests with `FLAKON=1` env var set:
28
+
29
+ ```sh
30
+ FLAKON=1 bundle exec rspec
31
+ # or
32
+ FLAKON=1 bundle exec rails test
33
+ ```
34
+
35
+ When _flakiness_ is detected, the test is marked as failed with the thourough description on what has happened and how to fix this.
36
+
37
+ **NOTE:** The tests could take a bit longer to execute than usually, since Flakon tries to re-run some of them to detect problems.
38
+
39
+ **NOTE:** Flakon requires running tests in a random order. Otherwise an exception is raised and the execution halts.
40
+
41
+ ## Analyzers
42
+
43
+ TBD
44
+
45
+ ## License
46
+
47
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/lib/flakon.rb ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "flakon/version"
4
+
5
+ require "flakon/rspec" if defined?(RSpec::Core)
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.configure do |config|
4
+ # Check that random order is in use and halt the execution if not
5
+ config.before(:suite) do
6
+ next if config.ordering_manager.ordering_registry.fetch(:global).is_a?(RSpec::Core::Ordering::Random)
7
+
8
+ warn <<~MSG
9
+ Random tests order must be used with Flakon.
10
+
11
+ Add the following line to your RSpec configuration:
12
+ config.order = :random
13
+ MSG
14
+ exit(1)
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Flakon # :nodoc:
4
+ VERSION = "0.0.1"
5
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: flakon
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Vladimir Dementyev
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-02-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.15'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '1.15'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '13.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '13.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '3.9'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '3.9'
55
+ description: Smart flaky tests detection for Rails apps
56
+ email:
57
+ - dementiev.vm@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - CHANGELOG.md
63
+ - LICENSE.txt
64
+ - README.md
65
+ - lib/flakon.rb
66
+ - lib/flakon/rspec.rb
67
+ - lib/flakon/version.rb
68
+ homepage: http://github.com/palkan/flakon
69
+ licenses:
70
+ - MIT
71
+ metadata:
72
+ bug_tracker_uri: http://github.com/palkan/flakon/issues
73
+ changelog_uri: https://github.com/palkan/flakon/blob/master/CHANGELOG.md
74
+ documentation_uri: http://github.com/palkan/flakon
75
+ homepage_uri: http://github.com/palkan/flakon
76
+ source_code_uri: http://github.com/palkan/flakon
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '2.5'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubygems_version: 3.0.6
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Smart flaky tests detection for Rails apps
96
+ test_files: []