inferno_core 0.3.10 → 0.3.12

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: 3001d2c9b156117f88ae751c8e2f81416c9b37249d8a0bdce7de759a52bde543
4
- data.tar.gz: b2dc6e6d2168c11eee09326d19459fbd202c92cddc871925de5283250cdb7dde
3
+ metadata.gz: b9bc9822a032ed4fa7c3b1639b24bc14c6ed977e271e60e424f6a1d60fbff657
4
+ data.tar.gz: 5d0a9a794ce081c3128e68d7cb6a1802a05aafddbcbb03ab7ee7667696ac81f5
5
5
  SHA512:
6
- metadata.gz: e16fda0221af1b289a1fb2cd82fa011723cef4c0e6cb443c3ec730cb527e2cfb1be11f4a5ff87093709dadb01ad0bd2551bfb0e5fa1a7b2c826a93e1e4e8c7af
7
- data.tar.gz: 78a0c14897fd20e3273cd0a4f45a5c84c9d4f5ddc79beb9afca7e9a0a938f5144729e6e2e3c5588d127bcd87dfb5ca291e807a8e7688089dc99b4f3d13cc7742
6
+ metadata.gz: 8645e64fc2c5890378d9693734ce5268b219541c82307b13d14703f7a8e8ff70ddac9c00ddf254ba9db6121bb54015445222e497b0d519b9bc2de1d93ac1c06c
7
+ data.tar.gz: 67a64df05660cca2377009e45c13fb6baddae3cd39e3527d7fe85e6b64fc201b2cb871b894bf86c55ca6facc6f3790993e6548dec14ad245b563d8bbc5ac690f
@@ -1,5 +1,6 @@
1
1
  require_relative 'console'
2
2
  require_relative 'migration'
3
+ require_relative 'services'
3
4
  require_relative 'suite'
4
5
  require_relative 'suites'
5
6
 
@@ -16,11 +17,23 @@ module Inferno
16
17
  Migration.new.run
17
18
  end
18
19
 
20
+ desc 'start', 'Start Inferno'
21
+ def start
22
+ if `gem list -i foreman`.chomp == 'false'
23
+ puts "You must install foreman with 'gem install foreman' prior to running inferno."
24
+ end
25
+
26
+ system 'foreman start --env=/dev/null'
27
+ end
28
+
19
29
  desc 'suites', 'List available test suites'
20
30
  def suites
21
31
  Suites.new.run
22
32
  end
23
33
 
34
+ desc 'services stop/start', 'Start or stop background services'
35
+ subcommand 'services', Services
36
+
24
37
  desc 'suite SUBCOMMAND ...ARGS', 'Perform suite-based operations'
25
38
  subcommand 'suite', Suite
26
39
  end
@@ -0,0 +1,56 @@
1
+ module Inferno
2
+ module CLI
3
+ class Services < Thor
4
+ no_commands do
5
+ def base_command
6
+ 'docker-compose -f docker-compose.background.yml'
7
+ end
8
+ end
9
+
10
+ desc 'start', 'Start background services'
11
+ option :foreground,
12
+ default: false,
13
+ type: :boolean,
14
+ desc: 'Run services in foreground'
15
+ def start
16
+ command = "#{base_command} up"
17
+ command += ' -d' unless options[:foreground]
18
+
19
+ system command
20
+ end
21
+
22
+ desc 'stop', 'Stop background services'
23
+ def stop
24
+ system "#{base_command} down"
25
+ end
26
+
27
+ desc 'build', 'Build background service images'
28
+ def build
29
+ system "#{base_command} build"
30
+ end
31
+
32
+ desc 'pull', 'Pull background service images'
33
+ def pull
34
+ system "#{base_command} pull"
35
+ end
36
+
37
+ desc 'logs', 'Display the logs for the background services'
38
+ option :follow,
39
+ default: false,
40
+ aliases: [:f],
41
+ type: :boolean,
42
+ desc: 'Follow log output'
43
+ option :tail,
44
+ banner: 'string',
45
+ default: 'all',
46
+ desc: 'Number of lines to show from the end of the logs for each container'
47
+ def logs
48
+ command = "#{base_command} logs"
49
+ command += ' -f' if options[:follow]
50
+ command += " --tail #{options[:tail]}" if options[:tail]
51
+
52
+ system command
53
+ end
54
+ end
55
+ end
56
+ end
@@ -38,14 +38,18 @@
38
38
  height: 100%;
39
39
  display: flex;
40
40
  flex-direction: column;
41
+ overflow: hidden;
41
42
  }
42
43
  .banner {
43
44
  flex-shrink: 1;
45
+ overflow: 'auto';
46
+ white-space: nowrap;
44
47
  }
45
48
  .app {
46
49
  flex-grow: 1;
47
50
  display: flex;
48
51
  flex-direction: column;
52
+ overflow: auto;
49
53
  }
50
54
  </style>
51
55
  <title>Inferno</title>
@@ -3,7 +3,8 @@ module Inferno
3
3
  module Serializers
4
4
  class Request < Serializer
5
5
  view :summary do
6
- field :id
6
+ identifier :id
7
+ field :index
7
8
  field :created_at, name: :timestamp
8
9
  field :verb
9
10
  field :url
@@ -1,4 +1,5 @@
1
1
  require 'json'
2
+ require_relative 'request'
2
3
 
3
4
  module Inferno
4
5
  module Web
@@ -27,7 +28,9 @@ module Inferno
27
28
  end
28
29
 
29
30
  association :messages, blueprint: Message, if: :field_present?
30
- association :requests, blueprint: Request, view: :summary, if: :field_present?
31
+ field :requests do |result, _options|
32
+ Request.render_as_hash(result.requests.sort_by(&:index), view: :summary)
33
+ end
31
34
  end
32
35
  end
33
36
  end
@@ -4,4 +4,9 @@ ENV['APP_ENV'] ||= 'development'
4
4
 
5
5
  root_path = Dir.pwd
6
6
 
7
- Dotenv.load(File.join(root_path, '.env'), File.join(root_path, ".env.#{ENV.fetch('APP_ENV', nil)}"))
7
+ Dotenv.load(
8
+ File.join(root_path, ".env.#{ENV.fetch('APP_ENV', nil)}.local"),
9
+ File.join(root_path, '.env.local'),
10
+ File.join(root_path, ".env.#{ENV.fetch('APP_ENV', nil)}"),
11
+ File.join(root_path, '.env')
12
+ )
@@ -382,7 +382,11 @@ module Inferno
382
382
  def test_count(selected_suite_options = [])
383
383
  @test_counts ||= {}
384
384
 
385
- @test_counts[selected_suite_options] ||=
385
+ options_json = selected_suite_options.to_json
386
+
387
+ return @test_counts[options_json] if @test_counts[options_json]
388
+
389
+ @test_counts[options_json] =
386
390
  children(selected_suite_options)
387
391
  &.reduce(0) { |sum, child| sum + child.test_count(selected_suite_options) } || 0
388
392
  end