gitlab-exporter 11.18.2 → 12.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +13 -2
- data/Gemfile.lock +4 -4
- data/gitlab-exporter.gemspec +1 -1
- data/lib/gitlab_exporter/database/row_count.rb +2 -1
- data/lib/gitlab_exporter/version.rb +1 -1
- data/spec/integration/cli_spec.rb +20 -0
- data/spec/spec_helper.rb +17 -2
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca354fcfa5a8bde34e45a37610546ed70135c1a9208e92f2986c1811ddf9bf26
|
4
|
+
data.tar.gz: fc584b756b3032c31d758271d603df84104821be727b4fce50b23f7cf5488185
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f199b0d85a71d607023bb39e2d16d8aec6fff0506ea151b5358c1ce374d34e0ae91ad1eb70079da22ca8ba726b3f4d758517623a00bfa5bef8b72e97b5c2f2d
|
7
|
+
data.tar.gz: 76bcce5399be29898662aa0cb067d1285bf41c1a2286380b835924aeac0b8d3577b874ad943f080c6a93076715e1e32a7172d28e8c06e7b929766faf561cd7d6
|
data/.gitlab-ci.yml
CHANGED
@@ -43,8 +43,19 @@ rspec:
|
|
43
43
|
before_script: *before_scripts
|
44
44
|
parallel:
|
45
45
|
matrix:
|
46
|
-
- RUBY_VERSION: "2.7"
|
47
|
-
|
46
|
+
- RUBY_VERSION: ["2.7", "3.0"]
|
47
|
+
|
48
|
+
rspec_integration:
|
49
|
+
script:
|
50
|
+
- bundle exec rspec spec -t integration -f d -c
|
51
|
+
before_script: *before_scripts
|
52
|
+
services:
|
53
|
+
- redis:latest
|
54
|
+
variables:
|
55
|
+
REDIS_URL: "redis://redis"
|
56
|
+
parallel:
|
57
|
+
matrix:
|
58
|
+
- RUBY_VERSION: ["2.7", "3.0"]
|
48
59
|
|
49
60
|
rubocop:
|
50
61
|
script:
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gitlab-exporter (
|
4
|
+
gitlab-exporter (12.0.0)
|
5
5
|
connection_pool (= 2.2.5)
|
6
6
|
faraday (~> 1.8.0)
|
7
7
|
pg (= 1.2.3)
|
8
8
|
puma (= 5.6.5)
|
9
9
|
quantile (= 0.2.1)
|
10
10
|
redis (= 4.4.0)
|
11
|
-
redis-namespace (= 1.
|
11
|
+
redis-namespace (= 1.9.0)
|
12
12
|
sidekiq (= 6.4.0)
|
13
13
|
sinatra (~> 2.2.0)
|
14
14
|
|
@@ -53,8 +53,8 @@ GEM
|
|
53
53
|
rack
|
54
54
|
rainbow (3.0.0)
|
55
55
|
redis (4.4.0)
|
56
|
-
redis-namespace (1.
|
57
|
-
redis (>=
|
56
|
+
redis-namespace (1.9.0)
|
57
|
+
redis (>= 4)
|
58
58
|
regexp_parser (2.0.3)
|
59
59
|
rexml (3.2.4)
|
60
60
|
rspec (3.7.0)
|
data/gitlab-exporter.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.add_runtime_dependency "puma", "5.6.5"
|
27
27
|
s.add_runtime_dependency "quantile", "0.2.1"
|
28
28
|
s.add_runtime_dependency "redis", "4.4.0"
|
29
|
-
s.add_runtime_dependency "redis-namespace", "1.
|
29
|
+
s.add_runtime_dependency "redis-namespace", "1.9.0"
|
30
30
|
s.add_runtime_dependency "sidekiq", "6.4.0"
|
31
31
|
s.add_runtime_dependency "sinatra", "~> 2.2.0"
|
32
32
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "gitlab_exporter/cli"
|
3
|
+
|
4
|
+
module GitLab
|
5
|
+
module Exporter
|
6
|
+
module CLI
|
7
|
+
describe SidekiqRunner, :integration do
|
8
|
+
let(:redis_url) { ENV.fetch("REDIS_URL", "redis://localhost:6379") }
|
9
|
+
let(:io) { StringIO.new }
|
10
|
+
|
11
|
+
it "can properly reach out to redis" do
|
12
|
+
args = CLIArgs.new([io], options: { /^--redis-url/ => redis_url })
|
13
|
+
runner = SidekiqRunner.new(args)
|
14
|
+
|
15
|
+
expect { runner.run }.not_to raise_error
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -7,6 +7,10 @@ require "tmpdir"
|
|
7
7
|
$LOAD_PATH.unshift File.expand_path(".")
|
8
8
|
Dir["spec/support/**/*.rb"].each do |f| require f end
|
9
9
|
|
10
|
+
RSpec.configure do |config|
|
11
|
+
config.filter_run_excluding integration: true
|
12
|
+
end
|
13
|
+
|
10
14
|
class GitRepoBuilder
|
11
15
|
def origin
|
12
16
|
@origin ||= create_origin
|
@@ -41,19 +45,30 @@ class GitRepoBuilder
|
|
41
45
|
end
|
42
46
|
|
43
47
|
class CLIArgs
|
44
|
-
def initialize(args)
|
48
|
+
def initialize(args, options: {})
|
45
49
|
@arguments = args
|
50
|
+
@options = options
|
46
51
|
end
|
47
52
|
|
48
53
|
def options
|
49
54
|
yield self
|
55
|
+
|
56
|
+
self
|
50
57
|
end
|
51
58
|
|
52
|
-
def on(*
|
59
|
+
def on(flag, *_)
|
60
|
+
match = @options.find { |regex, _| regex.match?(flag) }
|
61
|
+
|
62
|
+
yield match[1] if match
|
63
|
+
end
|
53
64
|
|
54
65
|
def banner=(banner); end
|
55
66
|
|
56
67
|
def parse!
|
57
68
|
@arguments
|
58
69
|
end
|
70
|
+
|
71
|
+
def shift
|
72
|
+
@arguments.shift
|
73
|
+
end
|
59
74
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-exporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 12.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pablo Carranza
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - '='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
103
|
+
version: 1.9.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.
|
110
|
+
version: 1.9.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: sidekiq
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -217,6 +217,7 @@ files:
|
|
217
217
|
- spec/fixtures/smaps/sample.txt
|
218
218
|
- spec/git_process_proper_spec.rb
|
219
219
|
- spec/git_spec.rb
|
220
|
+
- spec/integration/cli_spec.rb
|
220
221
|
- spec/memstats_spec.rb
|
221
222
|
- spec/prometheus_metrics_spec.rb
|
222
223
|
- spec/ruby_spec.rb
|
@@ -254,6 +255,7 @@ test_files:
|
|
254
255
|
- spec/fixtures/smaps/sample.txt
|
255
256
|
- spec/git_process_proper_spec.rb
|
256
257
|
- spec/git_spec.rb
|
258
|
+
- spec/integration/cli_spec.rb
|
257
259
|
- spec/memstats_spec.rb
|
258
260
|
- spec/prometheus_metrics_spec.rb
|
259
261
|
- spec/ruby_spec.rb
|