appveyor-worker 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42443bab6c2eb9ea2a639d73e1ac9217c4e44fee
4
- data.tar.gz: 487eccd0cbf2d56bc53163137de33f203f9eac5e
3
+ metadata.gz: b991b92a0fba1e6036c143b0776497cd313577bc
4
+ data.tar.gz: b1efcb211a766402d65603f48bb1270dcf1618ea
5
5
  SHA512:
6
- metadata.gz: ab3aa9020f7acc62f5384c9f86d5c845a7c0e40993e0d65a218fd7a0f253024a505ffc642eed17d1c9ca4d6f502a7685da6b6b89d83594d605c17b788c527609
7
- data.tar.gz: 72416a73e237e5224b0e9012b655bb7ed269c150fc168d7fb0c4f2abd5d1651ed78e434aec7624308985e4527041b50e067a9a5c8481a4b720b037645128f6d8
6
+ metadata.gz: daeeb401b2a69735bd3b23fd247be06e7b1df06f8535f41a9e8cb219888bf26fdbbd9559fd1441c962b41f7265e345a9d611450440a972a4911fe89a6e033c80
7
+ data.tar.gz: bf02ce4bfe10a35f59066d3927df3a980d538fac5ad9c490185a8dc95f583700a7750b6263c197a0bccfa4ca87930e1c5996797a83b972c4d4bb73a35a9f9bee
@@ -0,0 +1,28 @@
1
+ # http://editorconfig.org/
2
+ # https://github.com/mfuentesg/EditorConfigSnippets
3
+
4
+ root = true
5
+
6
+ [*]
7
+ max_line_length = 100
8
+ end_of_line = lf
9
+ indent_style = space
10
+ indent_size = 2
11
+ charset = utf-8
12
+ trim_trailing_whitespace = true
13
+ insert_final_newline = true
14
+
15
+ [*.php]
16
+ indent_size = 4
17
+
18
+ [*.py]
19
+ indent_size = 4
20
+
21
+ [*.txt]
22
+ indent_size = 4
23
+
24
+ [*.go]
25
+ indent_style = tab
26
+
27
+ [*.cpp]
28
+ indent_style = tab
data/.gitignore CHANGED
@@ -1,9 +1,9 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --require spec_helper
2
+ -r appveyor/worker
@@ -1,6 +1,6 @@
1
- language: ruby
2
- rvm:
3
- - '2.3'
4
- - '2.2'
5
- - '2.1'
6
- - '2.0'
1
+ language: ruby
2
+ rvm:
3
+ - '2.3'
4
+ - '2.2'
5
+ - '2.1'
6
+ - '2.0'
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in appveyor-worker.gemspec
4
- gemspec
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in appveyor-worker.gemspec
4
+ gemspec
data/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  [![Build status](https://ci.appveyor.com/api/projects/status/oiqm2v8jcr9td1la?svg=true)](https://ci.appveyor.com/project/ukoloff/appveyor-worker)
4
4
  [![Gem Version](https://badge.fury.io/rb/appveyor-worker.svg)](http://badge.fury.io/rb/appveyor-worker)
5
5
 
6
- Access to [AppVeyor](http://www.appveyor.com/)
7
- [Build Worker API](http://www.appveyor.com/docs/build-worker-api)
6
+ Access to [AppVeyor][]
7
+ [Build Worker API][].
8
8
 
9
9
  ## Installation
10
10
 
@@ -30,8 +30,29 @@ require 'appveyor/worker'
30
30
  AppVeyor::Worker.message "Hello, world!", "It's me"
31
31
  ```
32
32
 
33
+ ### Minitest
34
+
33
35
  When using `AppVeyor::Worker` under
34
- [Minitest](https://github.com/seattlerb/minitest)
36
+ [Minitest][]
35
37
  the latter automagically requires the former.
36
38
  Just add to `Gemfile` et voila! Test results will populate list
37
39
  and `AppVeyor::Worker.message` is available in your tests.
40
+
41
+ In addition, Minitest seed will be sent as AppVeyor message.
42
+
43
+ ### RSpec
44
+
45
+ For [RSpec][] you need *two* lines of code, as mentioned above:
46
+
47
+ 1. Add gem to `Gemfile`
48
+ 2. Require gem
49
+
50
+ * Either directly in one of your `./spec/*_spec.rb` files
51
+ * Or by adding `-r appveyor/worker` to `./.rspec'
52
+
53
+ RScpec seed is also reported as standard AppVeyor message.
54
+
55
+ [AppVeyor]: http://www.appveyor.com/
56
+ [Build Worker API]: http://www.appveyor.com/docs/build-worker-api
57
+ [Minitest]: https://github.com/seattlerb/minitest
58
+ [RSpec]: http://rspec.info/
data/Rakefile CHANGED
@@ -1,10 +1,19 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
3
  desc 'Run tests'
4
- task :test do
4
+ task test: %i(minitest rspec) do
5
+ end
6
+
7
+ desc "Run Minitest"
8
+ task :minitest do
5
9
  require "minitest/autorun"
6
10
 
7
11
  Dir.glob('./test/*.rb'){|f| require f}
8
12
  end
9
13
 
14
+ desc "Run RSpec"
15
+ task :rspec do
16
+ system "rspec"
17
+ end
18
+
10
19
  task default: :test
@@ -24,4 +24,5 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "bundler", "~> 1.9"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
26
26
  spec.add_development_dependency "minitest"
27
+ spec.add_development_dependency "rspec"
27
28
  end
@@ -1,33 +1,34 @@
1
- version: 1.0.{build}-{branch}
2
-
3
- cache:
4
- - vendor/bundle
5
-
6
- environment:
7
- matrix:
8
- - RUBY_VERSION: 23
9
- - RUBY_VERSION: 22
10
- - RUBY_VERSION: 21
11
- - RUBY_VERSION: 200
12
-
13
- install:
14
- - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
15
- - bundle config --local path vendor/bundle
16
- - bundle install
17
-
18
- build: off
19
-
20
- before_test:
21
- - ruby -v
22
- - gem -v
23
- - bundle -v
24
-
25
- test_script:
26
- - bundle exec rake
27
-
28
- after_test:
29
- - bundle exec rake build
30
-
31
- artifacts:
32
- - path: pkg/*.gem
33
- name: Gem
1
+ version: 1.0.{build}-{branch}
2
+
3
+ cache:
4
+ - vendor/bundle
5
+
6
+ environment:
7
+ matrix:
8
+ - RUBY_VERSION: 24
9
+ - RUBY_VERSION: 23
10
+ - RUBY_VERSION: 22
11
+ - RUBY_VERSION: 21
12
+ - RUBY_VERSION: 200
13
+
14
+ install:
15
+ - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
16
+ - bundle config --local path vendor/bundle
17
+ - bundle install
18
+
19
+ build: off
20
+
21
+ before_test:
22
+ - ruby -v
23
+ - gem -v
24
+ - bundle -v
25
+
26
+ test_script:
27
+ - bundle exec rake
28
+
29
+ after_test:
30
+ - bundle exec rake build
31
+
32
+ artifacts:
33
+ - path: pkg/*.gem
34
+ name: Gem
@@ -1,57 +1,58 @@
1
- require 'json'
2
- require 'net/http'
3
-
4
- require_relative "worker/version"
5
-
6
- module AppVeyor::Worker
7
- def self.skip?
8
- !api
9
- end
10
-
11
- def self.message msg, details=nil
12
- x = api or return
13
- body = JSON.generate category: 'info',
14
- message: msg,
15
- details: details
16
- x.post '/api/build/messages',
17
- body,
18
- 'Content-Length'=>body.length.to_s,
19
- 'Content-Type'=>'application/json'
20
- end
21
-
22
- def self.test info
23
- x = api or return
24
- body = JSON.generate info
25
- x.post '/api/tests',
26
- body,
27
- 'Content-Length'=>body.length.to_s,
28
- 'Content-Type'=>'application/json'
29
- end
30
-
31
- def self.env envs
32
- x = api or return
33
- envs.each do |k, v|
34
- body = JSON.generate name: k, value: v
35
- x.post '/api/build/variables',
36
- body,
37
- 'Content-Length'=>body.length.to_s,
38
- 'Content-Type'=>'application/json'
39
- end
40
- end
41
-
42
- private
43
-
44
- def self.api
45
- return if false===@http
46
- return @http if @http
47
- unless z = ENV['APPVEYOR_API_URL']
48
- @http = false
49
- return
50
- end
51
- z = URI z
52
- @http = x = Net::HTTP.start z.host, z.port
53
- x.use_ssl='https'==z.scheme
54
- x
55
- end
56
-
57
- end
1
+ require 'json'
2
+ require 'net/http'
3
+
4
+ require_relative "worker/version"
5
+ require_relative "worker/rspec" if defined? RSpec
6
+
7
+ module AppVeyor::Worker
8
+ def self.skip?
9
+ !api
10
+ end
11
+
12
+ def self.message msg, details=nil
13
+ x = api or return
14
+ body = JSON.generate category: 'info',
15
+ message: msg,
16
+ details: details
17
+ x.post '/api/build/messages',
18
+ body,
19
+ 'Content-Length'=>body.length.to_s,
20
+ 'Content-Type'=>'application/json'
21
+ end
22
+
23
+ def self.test info
24
+ x = api or return
25
+ body = JSON.generate info
26
+ x.post '/api/tests',
27
+ body,
28
+ 'Content-Length'=>body.length.to_s,
29
+ 'Content-Type'=>'application/json'
30
+ end
31
+
32
+ def self.env envs
33
+ x = api or return
34
+ envs.each do |k, v|
35
+ body = JSON.generate name: k, value: v
36
+ x.post '/api/build/variables',
37
+ body,
38
+ 'Content-Length'=>body.length.to_s,
39
+ 'Content-Type'=>'application/json'
40
+ end
41
+ end
42
+
43
+ private
44
+
45
+ def self.api
46
+ return if false===@http
47
+ return @http if @http
48
+ unless z = ENV['APPVEYOR_API_URL']
49
+ @http = false
50
+ return
51
+ end
52
+ z = URI z
53
+ @http = x = Net::HTTP.start z.host, z.port
54
+ x.use_ssl='https'==z.scheme
55
+ x
56
+ end
57
+
58
+ end
@@ -0,0 +1,55 @@
1
+ module AppVeyor::Worker::RSpec
2
+ def self.welcome
3
+ ::AppVeyor::Worker.message "RSpec seed: #{RSpec.configuration.seed}"
4
+ []
5
+ end
6
+
7
+ def self.report example
8
+ res = example.execution_result
9
+ return unless res.status
10
+
11
+ ::AppVeyor::Worker.test testFramework: 'RSpec',
12
+ testName: example.full_description,
13
+ fileName: example.location,
14
+ outcome: ({passed: 'Passed', failed: 'Failed', pending: 'Ignored'}[res.status] || '?'),
15
+ durationMilliseconds: res.run_time*1000
16
+ # StdOut: YAML.dump('assertions'=>result.assertions),
17
+ # ErrorStackTrace: (result.failure.backtrace * "\n" rescue nil)
18
+
19
+ true
20
+ end
21
+
22
+ def self.examples
23
+ @examples ||= welcome
24
+ end
25
+
26
+ def self.add example
27
+ process
28
+ examples.push example
29
+ end
30
+
31
+ def self.process
32
+ ex = examples
33
+ @examples = []
34
+ ex.each do |example|
35
+ unless report example
36
+ examples.push example
37
+ end
38
+ end
39
+ end
40
+
41
+ def self.intercept!
42
+ this = self
43
+ RSpec.configure do |config|
44
+ config.before :each do |example|
45
+ this.add example
46
+ end
47
+
48
+ config.after :all do
49
+ this.process
50
+ end
51
+ end
52
+ end
53
+
54
+ intercept! if defined? RSpec
55
+ end
@@ -1,5 +1,5 @@
1
1
  require_relative "../../appveyor"
2
2
 
3
3
  module AppVeyor::Worker
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appveyor-worker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stas Ukolov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-23 00:00:00.000000000 Z
11
+ date: 2018-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: Access to AppVeyor Build Worker API
70
84
  email:
71
85
  - ukoloff@gmail.com
@@ -73,7 +87,9 @@ executables: []
73
87
  extensions: []
74
88
  extra_rdoc_files: []
75
89
  files:
90
+ - ".editorconfig"
76
91
  - ".gitignore"
92
+ - ".rspec"
77
93
  - ".travis.yml"
78
94
  - FarMenu.ini
79
95
  - Gemfile
@@ -84,6 +100,7 @@ files:
84
100
  - lib/app_veyor.rb
85
101
  - lib/appveyor.rb
86
102
  - lib/appveyor/worker.rb
103
+ - lib/appveyor/worker/rspec.rb
87
104
  - lib/appveyor/worker/version.rb
88
105
  - lib/minitest/appveyor_plugin.rb
89
106
  homepage: https://github.com/ukoloff/appveyor-worker
@@ -106,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
123
  version: '0'
107
124
  requirements: []
108
125
  rubyforge_project:
109
- rubygems_version: 2.2.3
126
+ rubygems_version: 2.6.14
110
127
  signing_key:
111
128
  specification_version: 4
112
129
  summary: Access to AppVeyor Build Worker API