inferno_core 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inferno/version.rb +1 -1
- data/spec/factories/header.rb +19 -0
- data/spec/factories/message.rb +17 -0
- data/spec/factories/request.rb +35 -0
- data/spec/factories/result.rb +37 -0
- data/spec/factories/test_run.rb +22 -0
- data/spec/factories/test_session.rb +11 -0
- data/spec/fixtures/basic_test_group.rb +9 -0
- data/spec/fixtures/basic_test_suite.rb +8 -0
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8655cec1d50119f35eb0072e3d65375a78d9233d60ea8ffe3f745c400b941d5
|
4
|
+
data.tar.gz: c7f163bd24c8a5272c803587d9c87680b5b108a9b7f5cd777344ff15d762d4fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12573879f154dfd74c005aeb334c2dec65539345411bb3acfd959d0403fab4481cc5379c1ed28e9639bb09825ce8f2793883d6398da09a98fb8d00f145e11489
|
7
|
+
data.tar.gz: cbf9464a7e571dcef1d6f8c304c3ceadd545eeb7a54be18ded1f58280b77e34a449242f21672bdd8fa400347f425821dfb6fb096be82147537c480dd9e15a7fe
|
data/lib/inferno/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :header, class: 'Inferno::Entities::Header' do
|
3
|
+
request
|
4
|
+
|
5
|
+
request_id { request.index }
|
6
|
+
|
7
|
+
sequence(:name) { |n| "HEADER NAME #{n}" }
|
8
|
+
|
9
|
+
sequence(:value) { |n| "HEADER VALUE #{n}" }
|
10
|
+
|
11
|
+
sequence(:type) { |n| n.even? ? 'request' : 'response' }
|
12
|
+
|
13
|
+
initialize_with { new(**attributes) }
|
14
|
+
|
15
|
+
to_create do |instance|
|
16
|
+
Inferno::Repositories::Headers.new.create(instance.to_hash)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :message, class: 'Inferno::Entities::Message' do
|
3
|
+
result
|
4
|
+
|
5
|
+
result_id { result.id }
|
6
|
+
|
7
|
+
sequence(:message) { |n| "MESSAGE #{n}" }
|
8
|
+
|
9
|
+
type { Inferno::Entities::Message::TYPES.sample }
|
10
|
+
|
11
|
+
initialize_with { new(**attributes) }
|
12
|
+
|
13
|
+
to_create do |instance|
|
14
|
+
Inferno::Repositories::Messages.new.create(instance.to_hash)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :request, class: 'Inferno::Entities::Request' do
|
3
|
+
transient do
|
4
|
+
result
|
5
|
+
header_count { 2 }
|
6
|
+
end
|
7
|
+
|
8
|
+
result_id { result.id }
|
9
|
+
|
10
|
+
verb { 'get' }
|
11
|
+
url { 'http://www.example.com' }
|
12
|
+
name { nil }
|
13
|
+
status { 200 }
|
14
|
+
direction { 'outgoing' }
|
15
|
+
|
16
|
+
request_body { nil }
|
17
|
+
|
18
|
+
sequence(:response_body) { |n| "RESPONSE_BODY #{n}" }
|
19
|
+
|
20
|
+
test_session_id { result.test_session_id }
|
21
|
+
|
22
|
+
initialize_with { new(**attributes) }
|
23
|
+
|
24
|
+
to_create do |instance|
|
25
|
+
Inferno::Repositories::Requests.new.create(instance.to_hash)
|
26
|
+
end
|
27
|
+
|
28
|
+
after(:create) do |instance, evaluator|
|
29
|
+
instance.instance_variable_set(
|
30
|
+
:@headers,
|
31
|
+
repo_create_list(:header, evaluator.header_count, request_id: instance.index)
|
32
|
+
)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :result, class: 'Inferno::Entities::Result' do
|
3
|
+
transient do
|
4
|
+
runnable { test_run.runnable.reference_hash }
|
5
|
+
test_run
|
6
|
+
test_session { test_run.test_session }
|
7
|
+
message_count { 0 }
|
8
|
+
request_count { 0 }
|
9
|
+
end
|
10
|
+
|
11
|
+
test_session_id { test_session.id }
|
12
|
+
test_run_id { test_run.id }
|
13
|
+
|
14
|
+
test_suite_id { runnable[:test_suite_id] }
|
15
|
+
test_group_id { runnable[:test_group_id] }
|
16
|
+
test_id { runnable[:test_id] }
|
17
|
+
|
18
|
+
result { 'pass' }
|
19
|
+
|
20
|
+
initialize_with { new(**attributes) }
|
21
|
+
|
22
|
+
to_create do |instance|
|
23
|
+
Inferno::Repositories::Results.new.create(instance.to_hash)
|
24
|
+
end
|
25
|
+
|
26
|
+
after(:create) do |instance, evaluator|
|
27
|
+
instance.instance_variable_set(
|
28
|
+
:@messages,
|
29
|
+
repo_create_list(:message, evaluator.message_count, result_id: instance.id)
|
30
|
+
)
|
31
|
+
instance.instance_variable_set(
|
32
|
+
:@requests,
|
33
|
+
repo_create_list(:request, evaluator.request_count, result_id: instance.id)
|
34
|
+
)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :test_run, class: 'Inferno::Entities::TestRun' do
|
3
|
+
test_session
|
4
|
+
test_session_id { test_session.id }
|
5
|
+
|
6
|
+
transient do
|
7
|
+
runnable { { test_suite_id: 'BasicTestSuite::Suite' } }
|
8
|
+
end
|
9
|
+
|
10
|
+
test_suite_id { runnable[:test_suite_id] }
|
11
|
+
test_group_id { runnable[:test_group_id] }
|
12
|
+
test_id { runnable[:test_id] }
|
13
|
+
|
14
|
+
inputs { nil }
|
15
|
+
|
16
|
+
initialize_with { new(**attributes) }
|
17
|
+
|
18
|
+
to_create do |instance|
|
19
|
+
Inferno::Repositories::TestRuns.new.create(instance.to_hash).tap(&:runnable)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require_relative '../../lib/inferno/repositories'
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :test_session, class: 'Inferno::Entities::TestSession' do
|
5
|
+
test_suite_id { 'BasicTestSuite::Suite' }
|
6
|
+
|
7
|
+
initialize_with { new(**attributes) }
|
8
|
+
|
9
|
+
to_create { |instance| Inferno::Repositories::TestSessions.new.create(instance.to_hash) }
|
10
|
+
end
|
11
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inferno_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen MacVicar
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-06-
|
13
|
+
date: 2021-06-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -483,6 +483,14 @@ files:
|
|
483
483
|
- lib/inferno/test_runner.rb
|
484
484
|
- lib/inferno/utils/middleware/request_logger.rb
|
485
485
|
- lib/inferno/version.rb
|
486
|
+
- spec/factories/header.rb
|
487
|
+
- spec/factories/message.rb
|
488
|
+
- spec/factories/request.rb
|
489
|
+
- spec/factories/result.rb
|
490
|
+
- spec/factories/test_run.rb
|
491
|
+
- spec/factories/test_session.rb
|
492
|
+
- spec/fixtures/basic_test_group.rb
|
493
|
+
- spec/fixtures/basic_test_suite.rb
|
486
494
|
- spec/support/factory_bot.rb
|
487
495
|
homepage: https://github.com/inferno_community/inferno-core
|
488
496
|
licenses:
|