fuci 0.1.0 → 0.1.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +50 -5
- data/lib/fuci/runner.rb +6 -1
- data/lib/fuci/server.rb +1 -1
- data/lib/fuci/version.rb +1 -1
- data/spec/lib/fuci/runner_spec.rb +23 -11
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34faa150063416bf1ca042b6a3c741bc9d8ea46c
|
4
|
+
data.tar.gz: 1487f25d0712faf4af545dabf7798bb0474eb72b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e10f99678214657933a6bf26c575c6a12f8c7958a59dc7c7632efc90d081c6527ae63f96e5345425e64abffc54efdc2f3c0aa0f79e48bb5d432a374550eb8642
|
7
|
+
data.tar.gz: 49aa7e85bd20e66a1cbc9e7a2946f844d4601186b6b00c5355cfb7628d178a2ee3568ae0edca1fce0a4ebd44a10ca71f18fc6c620729aa3564c7ba8f98a44bde
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Fuci
|
2
|
-
[](https://travis-ci.org/davejachimiak/fuci)
|
3
3
|
|
4
|
-
|
4
|
+
A base gem providing the general case for running CI failures locally.
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
@@ -9,10 +9,55 @@ Add this line to your fuci extension's Gemspec:
|
|
9
9
|
|
10
10
|
.add_dependency 'fuci', '~> 0.1'
|
11
11
|
|
12
|
+
## Known server extensions
|
13
|
+
* [Fuci::Travis](https://github.com/davejachimiak/fuci-travis)
|
14
|
+
|
12
15
|
## Usage
|
13
|
-
###
|
14
|
-
|
15
|
-
|
16
|
+
### Creating server extensions
|
17
|
+
#### Configuring Fuci base with the server
|
18
|
+
Somewhere in the required code of the server extension, the server must
|
19
|
+
be set like so:
|
20
|
+
```ruby
|
21
|
+
Fuci.configure do |fu|
|
22
|
+
fu.server = Fuci::MyCiAgent::ServerClass
|
23
|
+
end
|
24
|
+
```
|
25
|
+
or
|
26
|
+
```ruby
|
27
|
+
module Fuci
|
28
|
+
configure do |fu|
|
29
|
+
fu.server = Fuci::MyCiAgent::ServerClass
|
30
|
+
end
|
31
|
+
|
32
|
+
module MyCiAgent
|
33
|
+
...
|
34
|
+
...
|
35
|
+
end
|
36
|
+
end
|
37
|
+
```
|
38
|
+
|
39
|
+
The ServerClass in this example must be an initializable constant whose
|
40
|
+
instance implements the server interface.
|
41
|
+
|
42
|
+
#### The server interface
|
43
|
+
The `Fuci::Server` interface class that tells what the runner
|
44
|
+
expects of server extensions. As of this version, it expects two
|
45
|
+
methods: `#build_status` and `#fetch_log`. See that file for more
|
46
|
+
details on what they should return.
|
47
|
+
|
48
|
+
#### The binstub
|
49
|
+
Server extensions should ship with their own binstub. `fuci` is
|
50
|
+
preffered. It's short and easy to type. To avoid possible conflicts
|
51
|
+
between local server extensions, prefer that users execute
|
52
|
+
`bundle binstubs <server-extension>`.
|
53
|
+
|
54
|
+
Fuci binstubs should do the following:
|
55
|
+
* Require the extension
|
56
|
+
* Load a configuration file, if necessary
|
57
|
+
* Handle command-line arguments
|
58
|
+
* Call `Fuci.run`
|
59
|
+
|
60
|
+
### Creating tester extensions
|
16
61
|
Coming soon...
|
17
62
|
## Contributing
|
18
63
|
|
data/lib/fuci/runner.rb
CHANGED
@@ -38,7 +38,12 @@ module Fuci
|
|
38
38
|
self.detected_tester = testers.detect do |tester|
|
39
39
|
tester.indicates_failure? log
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
|
+
if detected_tester
|
43
|
+
puts "Failure detected: #{detected_tester.class.name.split('::').last}"
|
44
|
+
else
|
45
|
+
puts_with_exit 'No failure was detected by any tester plugins.'
|
46
|
+
end
|
42
47
|
end
|
43
48
|
|
44
49
|
def run_failures
|
data/lib/fuci/server.rb
CHANGED
data/lib/fuci/version.rb
CHANGED
@@ -52,19 +52,31 @@ describe Fuci::Runner do
|
|
52
52
|
end
|
53
53
|
|
54
54
|
describe '.detect_tester_failure' do
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
55
|
+
describe 'a failure is detected by a tester plugin' do
|
56
|
+
it 'detects the first tester failure in the log' do
|
57
|
+
rspec, konacha, cucumber = mock, mock, mock
|
58
|
+
@runner.stubs(:log).returns log = mock
|
59
|
+
[rspec, cucumber].each { |t| t.stubs :indicates_failure? }
|
60
|
+
konacha.stubs(:indicates_failure?).with(log).returns true
|
61
|
+
konacha.class.stubs(:name).returns 'Fuci::Konacha'
|
62
|
+
testers = [rspec, konacha, cucumber]
|
63
|
+
@runner.expects(:puts).with 'Failure detected: Konacha'
|
64
|
+
@runner.stubs(:testers).returns testers
|
65
|
+
|
66
|
+
@runner.send :detect_tester_failure
|
67
|
+
|
68
|
+
expect(@runner.send :detected_tester ).to_equal konacha
|
69
|
+
end
|
70
|
+
end
|
64
71
|
|
65
|
-
|
72
|
+
describe 'if there was no detected tester' do
|
73
|
+
it 'logs that no failure was detected by any tester plugin' do
|
74
|
+
@runner.stubs(:testers).returns []
|
75
|
+
@runner.expects(:puts_with_exit).
|
76
|
+
with 'No failure was detected by any tester plugins.'
|
66
77
|
|
67
|
-
|
78
|
+
@runner.send :detect_tester_failure
|
79
|
+
end
|
68
80
|
end
|
69
81
|
end
|
70
82
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Jachimiak
|
@@ -75,6 +75,7 @@ extra_rdoc_files: []
|
|
75
75
|
files:
|
76
76
|
- .gitignore
|
77
77
|
- .travis.yml
|
78
|
+
- CHANGELOG.md
|
78
79
|
- Gemfile
|
79
80
|
- LICENSE.txt
|
80
81
|
- README.md
|