liveqa 1.9.5 → 1.9.6

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: 8348917e29e6010dc71be47847b9dba0f8816616
4
- data.tar.gz: 7faba417c10c83120d8c4add967647c6a3d8202e
3
+ metadata.gz: '09aa604e7e84377ff259a8d5cf24eee8b130e188'
4
+ data.tar.gz: 5b54f896360e16c32f6125a5e91d5808002b7262
5
5
  SHA512:
6
- metadata.gz: 9a0e27f2ed96eb61db14ae29d083c408fd0f945611f3d6e77bda0ab15a7c1f2a791c23e474c77c0122d4d8f2284732244fecb5500190cd81b07d4d94220064e2
7
- data.tar.gz: '01792b83eb999086046d19812ec1deb642a4c6680e4867cd467b49cb29f563ee854a5015e3d22b6b08c4c06220ea29ab01cf2754e7375b87c8d8622fb7246d3a'
6
+ metadata.gz: fa2416a0f721914d1d61bd5dcefd712434c52588266b1fbf7e67128d508765e3958040e6d9d59b361fbf67bd7309fd171291a33e7ee4cfd3974858635bb171ad
7
+ data.tar.gz: 790d47c0e5ffb8368d8a97426d18897c80cc1848b2ffb76ce8d53f56b5b630a607f4e0c0a2e69649331b66a9379393927b0d7930b93acdef34337d7aee481f22
@@ -141,7 +141,7 @@ module LiveQA
141
141
  payload = Message.base.merge(payload)
142
142
 
143
143
  if configurations.async
144
- payload[:id] = group_id
144
+ payload[:external_id] = group_id
145
145
 
146
146
  return processor.enqueue(
147
147
  action: GROUPS_UPDATE_ACTION,
@@ -168,7 +168,7 @@ module LiveQA
168
168
  payload = Message.base.merge(payload)
169
169
 
170
170
  if configurations.async
171
- payload[:id] = user_id
171
+ payload[:external_id] = user_id
172
172
 
173
173
  return processor.enqueue(
174
174
  action: IDENTITIES_UPDATE_ACTION,
@@ -11,7 +11,6 @@ module LiveQA
11
11
  message_id: SecureRandom.uuid,
12
12
  timestamp: Time.now.utc.iso8601(3),
13
13
  session_tracker_id: session_tracker_id,
14
- metadata: metadata
15
14
  )
16
15
  end
17
16
 
@@ -21,7 +20,8 @@ module LiveQA
21
20
  server: server,
22
21
  request: LiveQA::Store.get(:request),
23
22
  worker: LiveQA::Store.get(:worker),
24
- environment: LiveQA::Store.get(:environment)
23
+ environment: LiveQA::Store.get(:environment) || LiveQA.configurations.environment_name,
24
+ metadata: metadata
25
25
  ).merge(base)
26
26
  end
27
27
 
@@ -45,10 +45,18 @@ module LiveQA
45
45
  {
46
46
  host: Socket.gethostname,
47
47
  pid: Process.pid,
48
- software: LiveQA::Store.get(:server_software),
48
+ software: LiveQA::Store.get(:server_software) || program_name,
49
49
  }
50
50
  end
51
51
 
52
+ def program_name
53
+ name = $PROGRAM_NAME
54
+
55
+ name.split('/').last
56
+ rescue StandardError => _e
57
+ name
58
+ end
59
+
52
60
  def metadata
53
61
  return nil if LiveQA.configurations.metadata.nil?
54
62
 
@@ -10,6 +10,7 @@ module LiveQA
10
10
 
11
11
  def call(_worker, job, _queue)
12
12
  LiveQA::Store.set(:session_tracker_id, job['liveqa_session_tracker_id'] || SecureRandom.uuid)
13
+ LiveQA::Store.set(:server_software, "Sidekiq #{::Sidekiq::VERSION}")
13
14
  store_worker_data(job)
14
15
  yield
15
16
  ensure
@@ -1,3 +1,3 @@
1
1
  module LiveQA # :nodoc:
2
- VERSION = '1.9.5'.freeze
2
+ VERSION = '1.9.6'.freeze
3
3
  end
@@ -25,51 +25,6 @@ describe LiveQA::Message do
25
25
 
26
26
  it { expect(base.base).to match(expected_hash) }
27
27
  end
28
-
29
- context 'with metadata' do
30
-
31
-
32
- let(:expected_hash) {{
33
- message_id: kind_of(String),
34
- timestamp: kind_of(String),
35
- session_tracker_id: kind_of(String),
36
- metadata: {
37
- deployment_id: 42
38
- }
39
- }}
40
-
41
- context 'hash type' do
42
- before do
43
- LiveQA.configurations.metadata = {
44
- deployment_id: 42
45
- }
46
- end
47
-
48
- it { expect(base.base).to match(expected_hash) }
49
- end
50
-
51
- context 'proc type' do
52
- before do
53
- LiveQA.configurations.metadata = {
54
- deployment_id: lambda { 84 / 2 }
55
- }
56
- end
57
-
58
- it { expect(base.base).to match(expected_hash) }
59
- end
60
-
61
- context 'proc & raise type' do
62
- before do
63
- LiveQA.configurations.metadata = {
64
- deployment_id: -> { 84 / 2 },
65
- other_id: -> { hello }
66
- }
67
- end
68
-
69
- it { expect(base.base).to match(expected_hash) }
70
- end
71
- end
72
-
73
28
  end
74
29
 
75
30
  describe '#extended' do
@@ -77,6 +32,7 @@ describe LiveQA::Message do
77
32
  message_id: kind_of(String),
78
33
  timestamp: kind_of(String),
79
34
  session_tracker_id: kind_of(String),
35
+ environment: 'test',
80
36
  library: {
81
37
  name: "liveqa",
82
38
  language: "ruby",
@@ -84,7 +40,8 @@ describe LiveQA::Message do
84
40
  },
85
41
  server: {
86
42
  host: kind_of(String),
87
- pid: kind_of(Numeric)
43
+ pid: kind_of(Numeric),
44
+ software: 'rspec'
88
45
  }
89
46
  }}
90
47
 
@@ -163,6 +120,59 @@ describe LiveQA::Message do
163
120
 
164
121
  it { expect(base.extended).to match(expected_hash) }
165
122
  end
123
+
124
+ context 'with metadata' do
125
+ let(:expected_hash) {{
126
+ message_id: kind_of(String),
127
+ timestamp: kind_of(String),
128
+ session_tracker_id: kind_of(String),
129
+ environment: 'test',
130
+ library: {
131
+ name: "liveqa",
132
+ language: "ruby",
133
+ version: kind_of(String)
134
+ },
135
+ server: {
136
+ host: kind_of(String),
137
+ pid: kind_of(Numeric),
138
+ software: 'rspec'
139
+ },
140
+ metadata: {
141
+ deployment_id: 42
142
+ },
143
+ }}
144
+
145
+ context 'hash type' do
146
+ before do
147
+ LiveQA.configurations.metadata = {
148
+ deployment_id: 42
149
+ }
150
+ end
151
+
152
+ it { expect(base.extended).to match(expected_hash) }
153
+ end
154
+
155
+ context 'proc type' do
156
+ before do
157
+ LiveQA.configurations.metadata = {
158
+ deployment_id: lambda { 84 / 2 }
159
+ }
160
+ end
161
+
162
+ it { expect(base.extended).to match(expected_hash) }
163
+ end
164
+
165
+ context 'proc & raise type' do
166
+ before do
167
+ LiveQA.configurations.metadata = {
168
+ deployment_id: -> { 84 / 2 },
169
+ other_id: -> { hello }
170
+ }
171
+ end
172
+
173
+ it { expect(base.extended).to match(expected_hash) }
174
+ end
175
+ end
166
176
  end
167
177
 
168
178
  end
@@ -35,6 +35,7 @@ describe LiveQA::Plugins::Sidekiq::ServerMiddleware do
35
35
 
36
36
  let(:expected) {{
37
37
  session_tracker_id: '06a09f70-6219-4860-babc-18aa47a62f7f',
38
+ server_software: include("Sidekiq"),
38
39
  worker: {
39
40
  name: 'sidekiq',
40
41
  version: kind_of(String),
@@ -24,7 +24,8 @@ describe LiveQA::Event do
24
24
  },
25
25
  server: {
26
26
  host: kind_of(String),
27
- pid: kind_of(Numeric)
27
+ pid: kind_of(Numeric),
28
+ software: 'rspec',
28
29
  },
29
30
  }}
30
31
  let(:response) { double('LiveQA::Event', successful?: true) }
@@ -77,7 +78,8 @@ describe LiveQA::Event do
77
78
  },
78
79
  server: {
79
80
  host: kind_of(String),
80
- pid: kind_of(Numeric)
81
+ pid: kind_of(Numeric),
82
+ software: 'rspec',
81
83
  },
82
84
  }}
83
85
  let(:response) { double('LiveQA::Event', successful?: true) }
@@ -130,7 +132,7 @@ describe LiveQA::Event do
130
132
  LiveQA.set_group(42, { properties: { name: 'John Group' }}, no_ssl: true, space_name: 'test')
131
133
  end
132
134
 
133
- it { expect(processor_mock).to have_received(:enqueue).with(action: 'groups:update', payload: hash_including(expected_arg.merge(id: 42)), options: { space_name: 'test' }) }
135
+ it { expect(processor_mock).to have_received(:enqueue).with(action: 'groups:update', payload: hash_including(expected_arg.merge(external_id: 42)), options: { space_name: 'test' }) }
134
136
  end
135
137
 
136
138
  context 'without async' do
@@ -171,7 +173,7 @@ describe LiveQA::Event do
171
173
  LiveQA.set_identity(42, { properties: { name: 'John Doe' }}, no_ssl: true, space_name: 'test')
172
174
  end
173
175
 
174
- it { expect(processor_mock).to have_received(:enqueue).with(action: 'identities:update', payload: hash_including(expected_arg.merge(id: 42)), options: { space_name: 'test' }) }
176
+ it { expect(processor_mock).to have_received(:enqueue).with(action: 'identities:update', payload: hash_including(expected_arg.merge(external_id: 42)), options: { space_name: 'test' }) }
175
177
  end
176
178
 
177
179
  context 'without async' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liveqa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.5
4
+ version: 1.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - LiveQA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-05 00:00:00.000000000 Z
11
+ date: 2018-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby