appveyor-worker 0.1.1 → 0.2.0
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/.editorconfig +28 -0
- data/.gitignore +9 -9
- data/.rspec +2 -0
- data/.travis.yml +6 -6
- data/Gemfile +4 -4
- data/README.md +24 -3
- data/Rakefile +10 -1
- data/appveyor-worker.gemspec +1 -0
- data/appveyor.yml +34 -33
- data/lib/appveyor/worker.rb +58 -57
- data/lib/appveyor/worker/rspec.rb +55 -0
- data/lib/appveyor/worker/version.rb +1 -1
- metadata +20 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b991b92a0fba1e6036c143b0776497cd313577bc
|
4
|
+
data.tar.gz: b1efcb211a766402d65603f48bb1270dcf1618ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daeeb401b2a69735bd3b23fd247be06e7b1df06f8535f41a9e8cb219888bf26fdbbd9559fd1441c962b41f7265e345a9d611450440a972a4911fe89a6e033c80
|
7
|
+
data.tar.gz: bf02ce4bfe10a35f59066d3927df3a980d538fac5ad9c490185a8dc95f583700a7750b6263c197a0bccfa4ca87930e1c5996797a83b972c4d4bb73a35a9f9bee
|
data/.editorconfig
ADDED
@@ -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
data/.travis.yml
CHANGED
@@ -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
|
[](https://ci.appveyor.com/project/ukoloff/appveyor-worker)
|
4
4
|
[](http://badge.fury.io/rb/appveyor-worker)
|
5
5
|
|
6
|
-
Access to [AppVeyor]
|
7
|
-
[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]
|
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 :
|
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
|
data/appveyor-worker.gemspec
CHANGED
data/appveyor.yml
CHANGED
@@ -1,33 +1,34 @@
|
|
1
|
-
version: 1.0.{build}-{branch}
|
2
|
-
|
3
|
-
cache:
|
4
|
-
- vendor/bundle
|
5
|
-
|
6
|
-
environment:
|
7
|
-
matrix:
|
8
|
-
- RUBY_VERSION:
|
9
|
-
- RUBY_VERSION:
|
10
|
-
- RUBY_VERSION:
|
11
|
-
- RUBY_VERSION:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
-
|
16
|
-
- bundle
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
-
|
23
|
-
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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
|
data/lib/appveyor/worker.rb
CHANGED
@@ -1,57 +1,58 @@
|
|
1
|
-
require 'json'
|
2
|
-
require 'net/http'
|
3
|
-
|
4
|
-
require_relative "worker/version"
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
'Content-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
'Content-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
'Content-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
return
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
x.
|
54
|
-
x
|
55
|
-
|
56
|
-
|
57
|
-
|
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
|
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.
|
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:
|
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.
|
126
|
+
rubygems_version: 2.6.14
|
110
127
|
signing_key:
|
111
128
|
specification_version: 4
|
112
129
|
summary: Access to AppVeyor Build Worker API
|