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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b74c39894aba367bcde5c790b93628d31232f3a16ebbe8adc2173f766f395320
4
- data.tar.gz: 36eda29d50c81c57fdc71ea723d5551b6f9963924f24a60f47720a4ec7f25689
3
+ metadata.gz: b8655cec1d50119f35eb0072e3d65375a78d9233d60ea8ffe3f745c400b941d5
4
+ data.tar.gz: c7f163bd24c8a5272c803587d9c87680b5b108a9b7f5cd777344ff15d762d4fb
5
5
  SHA512:
6
- metadata.gz: 1f545895e3d03c20f4f8a43911ac8ac2382f1d778506c6b9422150a444aa15382ff0e2ef2ddb6b472bbcef8cf736e9d72face9d22adc7a93c11ed236a92b2d85
7
- data.tar.gz: bfeb371f3e857caf44690605a70dece84f8926b36fd37616f057aea55646374930ce209107592d5d741640ee2ac614992d4a005d4ee35397a4a09d76a5ce4c29
6
+ metadata.gz: 12573879f154dfd74c005aeb334c2dec65539345411bb3acfd959d0403fab4481cc5379c1ed28e9639bb09825ce8f2793883d6398da09a98fb8d00f145e11489
7
+ data.tar.gz: cbf9464a7e571dcef1d6f8c304c3ceadd545eeb7a54be18ded1f58280b77e34a449242f21672bdd8fa400347f425821dfb6fb096be82147537c480dd9e15a7fe
@@ -1,3 +1,3 @@
1
1
  module Inferno
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
@@ -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
@@ -0,0 +1,9 @@
1
+ module BasicTestSuite
2
+ class AbcGroup < Inferno::Entities::TestGroup
3
+ title 'ABC Group'
4
+
5
+ test 'demo_test' do
6
+ 1 + 1
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ require_relative 'basic_test_group'
2
+
3
+ module BasicTestSuite
4
+ class Suite < Inferno::Entities::TestSuite
5
+ title 'Basic Test Suite'
6
+ group from: 'BasicTestSuite::AbcGroup'
7
+ end
8
+ 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.2
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-15 00:00:00.000000000 Z
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: