bucky-core 0.9.6 → 0.9.7

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: 6318b2784966f181a85802df1e11a1e210e50b0b
4
- data.tar.gz: fc4b66f02c436867ed64bc0ff41ad1f547dbb518
3
+ metadata.gz: 75c6b90d28c08c2ee93798f1d8ee09eaf3bafb2d
4
+ data.tar.gz: e2845d4e3bb5d7bc75aeee7eeb70d49000bcd0ff
5
5
  SHA512:
6
- metadata.gz: 45ea9c539f1004c31a65db2033ad301dcda543ba790366c30cad7258ccfa5cfe1d770bb175104d79b257cd1afea21b4577060f79a8804aa79c272d9d37921e39
7
- data.tar.gz: 718138334a02c5cdbd780674d7fcf24218e0011449e2d3e8fbbffab62052b6074507fb2a8c824b77156264c27c8349683be4b736d49ca8879378c75d3ce0f9f6
6
+ metadata.gz: 2ee036a2a7adf6fe1726538473cea08430d6ef3235eee2728c3cdd1ae966d38f49bb7c89cac8ba500710cf47d413f6921807c6ea3879f9c439602544e27d2b92
7
+ data.tar.gz: 94b0df01aa34d8f9c546d8b7e473b8fc009bd624b9dc75b8bed72511010729f537a34cbd26661a2f859b0c5a66fafbaad151f97ac0b48da8c373f9b7df2e7443
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Bucky-Core
2
- [![CircleCI](https://circleci.com/gh/lifull-dev/bucky-core/tree/master.svg?style=svg)](https://circleci.com/gh/lifull-dev/bucky-core/tree/master) [![Maintainability](https://api.codeclimate.com/v1/badges/adf9599d98a55ac87a2e/maintainability)](https://codeclimate.com/github/lifull-dev/bucky-core/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/adf9599d98a55ac87a2e/test_coverage)](https://codeclimate.com/github/lifull-dev/bucky-core/test_coverage)
2
+ [![Gem Version](https://badge.fury.io/rb/bucky-core.svg)](https://badge.fury.io/rb/bucky-core) [![CircleCI](https://circleci.com/gh/lifull-dev/bucky-core/tree/master.svg?style=svg)](https://circleci.com/gh/lifull-dev/bucky-core/tree/master) [![Maintainability](https://api.codeclimate.com/v1/badges/adf9599d98a55ac87a2e/maintainability)](https://codeclimate.com/github/lifull-dev/bucky-core/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/adf9599d98a55ac87a2e/test_coverage)](https://codeclimate.com/github/lifull-dev/bucky-core/test_coverage)
3
3
 
4
4
  ## Overview
5
5
  Bucky-core can run test code which is written in YAML. End-to-End test (working with Selenium) and Linkstatus test (HTTP status check) are supported in default. Page object model pattern and page based element management is the main concept in Bucky-core. You can create scenarios and execute it easily by using Bucky-core.
@@ -45,12 +45,8 @@ module Bucky
45
45
 
46
46
  # Generate and execute test
47
47
  def do_test_suites(test_suite_data)
48
- # For checking on linkstatus
49
- link_status_url_log = {}
50
- tcg = Bucky::Core::TestCore::TestClassGenerator.new(@test_cond)
51
- Parallel.each(test_suite_data, in_processes: Bucky::Utils::Config.instance[:parallel_num]) do |data|
52
- tcg.generate_test_class(data, link_status_url_log)
53
- end
48
+ parallel_num = Bucky::Utils::Config.instance[:parallel_num]
49
+ parallel_helper(test_suite_data, parallel_num)
54
50
  end
55
51
 
56
52
  def execute_test
@@ -64,6 +60,31 @@ module Bucky
64
60
  break if @test_cond[:re_test_cond].empty?
65
61
  end
66
62
  end
63
+
64
+ def parallel_helper(test_suite_data, max_processes)
65
+ # Max parallel workers number
66
+ available_workers = max_processes
67
+ # For checking on linkstatus
68
+ link_status_url_log = {}
69
+ parent_pid = Process.pid
70
+ tcg = Bucky::Core::TestCore::TestClassGenerator.new(@test_cond)
71
+
72
+ # If child process dead, available workers increase
73
+ Signal.trap('CLD') { available_workers += 1 }
74
+ # Terminate parent and child process when getting interrupt signal
75
+ Signal.trap('INT') do
76
+ Process.kill('TERM', -1 * parent_pid)
77
+ end
78
+
79
+ test_suite_data.each do |data|
80
+ # Wait until worker is available
81
+ Process.wait unless available_workers.positive?
82
+ # Workers decrease when start working
83
+ available_workers -= 1
84
+ fork { tcg.generate_test_class(data, link_status_url_log) }
85
+ end
86
+ Process.waitall
87
+ end
67
88
  end
68
89
  end
69
90
  end
data/lib/bucky/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bucky
4
4
  module Version
5
- VERSION = '0.9.6'
5
+ VERSION = '0.9.7'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bucky-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - NaotoKishino
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: exe
15
15
  cert_chain: []
16
- date: 2019-05-16 00:00:00.000000000 Z
16
+ date: 2019-06-14 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: awesome_print