zold-stress 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.simplecov +1 -1
- data/.travis.yml +1 -1
- data/Gemfile +1 -1
- data/LICENSE.txt +1 -1
- data/README.md +4 -2
- data/Rakefile +3 -5
- data/bin/zold-stress +3 -1
- data/features/step_definitions/steps.rb +1 -1
- data/features/support/env.rb +1 -1
- data/fixtures/scripts/multi-node.sh +1 -1
- data/fixtures/scripts/simple-stress.sh +1 -1
- data/lib/zold/stress/air.rb +2 -2
- data/lib/zold/stress/pmnts.rb +3 -3
- data/lib/zold/stress/pool.rb +4 -4
- data/lib/zold/stress/round.rb +14 -5
- data/lib/zold/stress/stats.rb +3 -2
- data/lib/zold/stress/summary.rb +2 -2
- data/test/zold/stress/fake_node.rb +1 -1
- data/test/zold/stress/test_air.rb +1 -1
- data/test/zold/stress/test_bin.rb +2 -2
- data/test/zold/stress/test_pmnts.rb +8 -8
- data/test/zold/stress/test_pool.rb +3 -3
- data/test/zold/stress/test_round.rb +16 -10
- data/test/zold/stress/test_stats.rb +1 -1
- data/test/zold/test__helper.rb +9 -6
- data/zold-stress.gemspec +7 -6
- metadata +27 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb8829e6838efdbd9fd137c63e570c606ce1c3a75dfcfea8fe2900ac70c34e8e
|
4
|
+
data.tar.gz: 90d1d10a2eb82740bc98d06890caa98c663d2b72ad344265775e23dd2be839f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6664c32d321b7b823c14f18395a58decef7bf225a2997ccebc4789972d93bd3c520ae818e86a38ca8a05be82239b9992631b5b43a8ca78fcdda011365ad71667
|
7
|
+
data.tar.gz: 295c01f9de3802e70f1d2b42babccac944f39b5ed77a591de3221bdc4b912f3977ea48442282d9760d76084dd1f37b5ce26101e1af920f57566543d741fb8e26
|
data/.simplecov
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
#
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -14,6 +14,8 @@
|
|
14
14
|
[](https://codecov.io/github/zold-io/zold-stress?branch=master)
|
15
15
|
[](https://codeclimate.com/github/zold-io/zold-stress/maintainability)
|
16
16
|
|
17
|
+
[](https://hitsofcode.com/view/github/zold-stress)
|
18
|
+
|
17
19
|
Here is the [White Paper](https://papers.zold.io/wp.pdf).
|
18
20
|
|
19
21
|
Join our [Telegram group](https://t.me/zold_io) to discuss it all live.
|
@@ -32,7 +34,7 @@ $ zold-stress --help
|
|
32
34
|
|
33
35
|
You will have to install [Ruby](https://www.ruby-lang.org/en/) 2.5.1+ first.
|
34
36
|
|
35
|
-
|
37
|
+
## How to contribute
|
36
38
|
|
37
39
|
Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
|
38
40
|
Make sure you build is green before you contribute
|
@@ -41,7 +43,7 @@ your pull request. You will need to have [Ruby](https://www.ruby-lang.org/en/) 2
|
|
41
43
|
|
42
44
|
```
|
43
45
|
$ bundle update
|
44
|
-
$ rake
|
46
|
+
$ bundle exec rake
|
45
47
|
```
|
46
48
|
|
47
49
|
If it's clean and you don't see any error messages, submit your pull request.
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -20,6 +20,7 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
+
require 'date'
|
23
24
|
require 'rubygems'
|
24
25
|
require 'rake'
|
25
26
|
require 'rdoc'
|
@@ -36,7 +37,6 @@ end
|
|
36
37
|
task default: %i[clean test features rubocop copyright]
|
37
38
|
|
38
39
|
require 'rake/testtask'
|
39
|
-
desc 'Run all unit tests'
|
40
40
|
Rake::TestTask.new(:test) do |test|
|
41
41
|
ENV['TEST_QUIET_LOG'] = 'true' if ARGV.include?('--quiet')
|
42
42
|
Rake::Cleaner.cleanup_files(['coverage'])
|
@@ -47,7 +47,6 @@ Rake::TestTask.new(:test) do |test|
|
|
47
47
|
end
|
48
48
|
|
49
49
|
require 'rdoc/task'
|
50
|
-
desc 'Build RDoc documentation'
|
51
50
|
Rake::RDocTask.new do |rdoc|
|
52
51
|
rdoc.rdoc_dir = 'rdoc'
|
53
52
|
rdoc.title = "#{name} #{version}"
|
@@ -56,7 +55,6 @@ Rake::RDocTask.new do |rdoc|
|
|
56
55
|
end
|
57
56
|
|
58
57
|
require 'rubocop/rake_task'
|
59
|
-
desc 'Run RuboCop on all directories'
|
60
58
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
61
59
|
task.fail_on_error = true
|
62
60
|
task.requires << 'rubocop-rspec'
|
@@ -72,7 +70,7 @@ Cucumber::Rake::Task.new(:'features:html') do |t|
|
|
72
70
|
end
|
73
71
|
|
74
72
|
task :copyright do
|
75
|
-
sh "grep -q -r '
|
73
|
+
sh "grep -q -r '2018-#{Date.today.strftime('%Y')}' \
|
76
74
|
--include '*.rb' \
|
77
75
|
--include '*.txt' \
|
78
76
|
--include 'Rakefile' \
|
data/bin/zold-stress
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
4
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -93,6 +93,8 @@ Available options:"
|
|
93
93
|
exit
|
94
94
|
end
|
95
95
|
|
96
|
+
Zold::Hands.start
|
97
|
+
|
96
98
|
home = File.expand_path(opts[:home])
|
97
99
|
FileUtils.mkdir_p(home)
|
98
100
|
Dir.chdir(home)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/features/support/env.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -50,7 +50,7 @@ wait
|
|
50
50
|
zold --public-key=id_rsa.pub create 0000000000000000
|
51
51
|
zold --public-key=id_rsa.pub create abcdabcdabcdabcd
|
52
52
|
zold pay --private-key=id_rsa 0000000000000000 abcdabcdabcdabcd 4.95 'To test'
|
53
|
-
zold push 0000000000000000 --ignore-score-weakness
|
53
|
+
zold push 0000000000000000 --ignore-score-weakness --tolerate-edges
|
54
54
|
zold remove 0000000000000000
|
55
55
|
|
56
56
|
# sleep 10000
|
@@ -23,7 +23,7 @@ zold remote add localhost ${port}
|
|
23
23
|
zold --public-key=id_rsa.pub create 0000000000000000
|
24
24
|
zold --public-key=id_rsa.pub create abcdabcdabcdabcd
|
25
25
|
zold pay --private-key=id_rsa 0000000000000000 abcdabcdabcdabcd 4.95 'To test'
|
26
|
-
zold push 0000000000000000
|
26
|
+
zold push 0000000000000000 --tolerate-edges --tolerate-quorum=1
|
27
27
|
zold remove 0000000000000000
|
28
28
|
|
29
29
|
zold-stress --rounds=4 --wait=5 --threads=4 --pool=4 --batch=4 \
|
data/lib/zold/stress/air.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
# Payments still flying in air.
|
24
24
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
25
|
-
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
25
|
+
# Copyright:: Copyright (c) 2018-2019 Yegor Bugayenko
|
26
26
|
# License:: MIT
|
27
27
|
module Zold::Stress
|
28
28
|
# Flying payments.
|
data/lib/zold/stress/pmnts.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -30,7 +30,7 @@ require_relative 'stats'
|
|
30
30
|
|
31
31
|
# Pool of wallets.
|
32
32
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
33
|
-
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
33
|
+
# Copyright:: Copyright (c) 2018-2019 Yegor Bugayenko
|
34
34
|
# License:: MIT
|
35
35
|
module Zold::Stress
|
36
36
|
# Payments to send in a batch.
|
@@ -85,7 +85,7 @@ module Zold::Stress
|
|
85
85
|
end
|
86
86
|
details = SecureRandom.uuid
|
87
87
|
@stats.exec('paid', swallow: false) do
|
88
|
-
Zold::Pay.new(wallets: @wallets, remotes: @remotes, log: @vlog).run(
|
88
|
+
Zold::Pay.new(wallets: @wallets, remotes: @remotes, log: @vlog, copies: nil).run(
|
89
89
|
[
|
90
90
|
'pay', source.to_s, target.to_s, amount.to_zld(6), details,
|
91
91
|
"--network=#{@opts['network']}", "--private-key=#{pvt}"
|
data/lib/zold/stress/pool.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -32,7 +32,7 @@ require_relative 'stats'
|
|
32
32
|
|
33
33
|
# Pool of wallets.
|
34
34
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
35
|
-
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
35
|
+
# Copyright:: Copyright (c) 2018-2019 Yegor Bugayenko
|
36
36
|
# License:: MIT
|
37
37
|
module Zold::Stress
|
38
38
|
# Pool of wallets.
|
@@ -62,8 +62,8 @@ module Zold::Stress
|
|
62
62
|
Tempfile.open do |f|
|
63
63
|
File.write(f, @wallets.acq(balances[0][:id], &:key).to_s)
|
64
64
|
while @wallets.all.count < @opts['pool']
|
65
|
-
Zold::Create.new(wallets: @wallets, log: @vlog).run(
|
66
|
-
['create', "--public-key=#{f.path}", "--network=#{@opts['network']}"] + @opts.arguments
|
65
|
+
Zold::Create.new(wallets: @wallets, log: @vlog, remotes: nil).run(
|
66
|
+
['create', "--public-key=#{f.path}", "--network=#{@opts['network']}", '--skip-test'] + @opts.arguments
|
67
67
|
)
|
68
68
|
end
|
69
69
|
end
|
data/lib/zold/stress/round.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -34,7 +34,7 @@ require_relative 'air'
|
|
34
34
|
|
35
35
|
# Stress test.
|
36
36
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
37
|
-
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
37
|
+
# Copyright:: Copyright (c) 2018-2019 Yegor Bugayenko
|
38
38
|
# License:: MIT
|
39
39
|
module Zold::Stress
|
40
40
|
# Full round of stress test
|
@@ -82,7 +82,10 @@ module Zold::Stress
|
|
82
82
|
Thread.current.name = 'prepare-push'
|
83
83
|
@stats.exec('push') do
|
84
84
|
Zold::Push.new(wallets: @wallets, remotes: @remotes, log: @vlog).run(
|
85
|
-
[
|
85
|
+
[
|
86
|
+
'push', id.to_s, "--network=#{@opts['network']}",
|
87
|
+
'--tolerate-edges', '--tolerate-quorum=1'
|
88
|
+
] + @opts.arguments
|
86
89
|
)
|
87
90
|
end
|
88
91
|
end
|
@@ -104,7 +107,10 @@ in #{Zold::Age.new(start)}")
|
|
104
107
|
Thread.current.name = 'send-push'
|
105
108
|
@stats.exec('push') do
|
106
109
|
Zold::Push.new(wallets: @wallets, remotes: @remotes, log: @vlog).run(
|
107
|
-
[
|
110
|
+
[
|
111
|
+
'push', a[0].to_s, "--network=#{@opts['network']}",
|
112
|
+
'--tolerate-edges', '--tolerate-quorum=1'
|
113
|
+
] + @opts.arguments
|
108
114
|
)
|
109
115
|
mutex.synchronize do
|
110
116
|
a[1].each { |p| @air.add(p) }
|
@@ -126,7 +132,10 @@ in #{Zold::Age.new(start)}, #{@air.fetch.count} are now in the air, \
|
|
126
132
|
Thread.current.name = "pull-#{id}"
|
127
133
|
@stats.exec('pull') do
|
128
134
|
Zold::Pull.new(wallets: @wallets, remotes: @remotes, copies: @copies, log: @vlog).run(
|
129
|
-
[
|
135
|
+
[
|
136
|
+
'pull', id.to_s, "--network=#{@opts['network']}",
|
137
|
+
'--skip-propagate', '--tolerate-edges', '--tolerate-quorum=1'
|
138
|
+
] + @opts.arguments
|
130
139
|
)
|
131
140
|
end
|
132
141
|
@air.pulled(id)
|
data/lib/zold/stress/stats.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -28,7 +28,7 @@ require 'zold/age'
|
|
28
28
|
|
29
29
|
# Statistics.
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
31
|
-
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
31
|
+
# Copyright:: Copyright (c) 2018-2019 Yegor Bugayenko
|
32
32
|
# License:: MIT
|
33
33
|
module Zold::Stress
|
34
34
|
# Stats
|
@@ -80,6 +80,7 @@ module Zold::Stress
|
|
80
80
|
rescue StandardError => ex
|
81
81
|
put(metric + '_error', Time.now - start)
|
82
82
|
@log.error(Backtrace.new(ex))
|
83
|
+
puts '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
|
83
84
|
raise ex unless swallow
|
84
85
|
ensure
|
85
86
|
put(metric, Time.now - start)
|
data/lib/zold/stress/summary.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -29,7 +29,7 @@ require 'zold/size'
|
|
29
29
|
|
30
30
|
# Summary line.
|
31
31
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
32
|
-
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
32
|
+
# Copyright:: Copyright (c) 2018-2019 Yegor Bugayenko
|
33
33
|
# License:: MIT
|
34
34
|
module Zold::Stress
|
35
35
|
# Summary line
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -30,7 +30,7 @@ require_relative '../test__helper'
|
|
30
30
|
|
31
31
|
# Bin test.
|
32
32
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
33
|
-
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
33
|
+
# Copyright:: Copyright (c) 2018-2019 Yegor Bugayenko
|
34
34
|
# License:: MIT
|
35
35
|
class TestBin < Minitest::Test
|
36
36
|
Dir.new('fixtures/scripts').select { |f| f =~ /\.sh$/ && !f.start_with?('_') }.each do |f|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -41,13 +41,13 @@ class PmntsTest < Minitest::Test
|
|
41
41
|
Dir.mktmpdir do |home|
|
42
42
|
wallets = Zold::SyncWallets.new(Zold::Wallets.new(home))
|
43
43
|
remotes = Zold::Remotes.new(file: File.join(home, 'remotes'), network: 'test')
|
44
|
-
Zold::Create.new(wallets: wallets, log: test_log).run(
|
45
|
-
['create', '--public-key=fixtures/id_rsa.pub', Zold::Id::ROOT.to_s, '--network=test']
|
44
|
+
Zold::Create.new(wallets: wallets, log: test_log, remotes: nil).run(
|
45
|
+
['create', '--public-key=fixtures/id_rsa.pub', Zold::Id::ROOT.to_s, '--network=test', '--skip-test']
|
46
46
|
)
|
47
|
-
id = Zold::Create.new(wallets: wallets, log: test_log).run(
|
48
|
-
['create', '--public-key=fixtures/id_rsa.pub', '--network=test']
|
47
|
+
id = Zold::Create.new(wallets: wallets, log: test_log, remotes: nil).run(
|
48
|
+
['create', '--public-key=fixtures/id_rsa.pub', '--network=test', '--skip-test']
|
49
49
|
)
|
50
|
-
Zold::Pay.new(wallets: wallets, remotes: remotes, log: test_log).run(
|
50
|
+
Zold::Pay.new(wallets: wallets, remotes: remotes, log: test_log, copies: nil).run(
|
51
51
|
['pay', Zold::Id::ROOT.to_s, id.to_s, '7.00', 'start', '--private-key=fixtures/id_rsa']
|
52
52
|
)
|
53
53
|
sent = Zold::Stress::Pmnts.new(
|
@@ -72,8 +72,8 @@ class PmntsTest < Minitest::Test
|
|
72
72
|
remotes = Zold::Remotes.new(file: File.join(home, 'remotes'), network: 'test')
|
73
73
|
ids = []
|
74
74
|
6.times do
|
75
|
-
id = Zold::Create.new(wallets: wallets, log: test_log).run(
|
76
|
-
['create', '--public-key=fixtures/id_rsa.pub', Zold::Id.new.to_s, '--network=test']
|
75
|
+
id = Zold::Create.new(wallets: wallets, log: test_log, remotes: nil).run(
|
76
|
+
['create', '--public-key=fixtures/id_rsa.pub', Zold::Id.new.to_s, '--network=test', '--skip-test']
|
77
77
|
)
|
78
78
|
wallets.acq(id) do |w|
|
79
79
|
w.add(Zold::Txn.new(1, Time.now, Zold::Amount.new(zld: 1.0), 'NOPREFIX', Zold::Id.new, '-'))
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -40,8 +40,8 @@ class PoolTest < Minitest::Test
|
|
40
40
|
Zold::Stress::FakeNode.new(test_log).exec do |port|
|
41
41
|
Dir.mktmpdir do |home|
|
42
42
|
wallets = Zold::SyncWallets.new(Zold::Wallets.new(home))
|
43
|
-
Zold::Create.new(wallets: wallets, log: test_log).run(
|
44
|
-
['create', '--public-key=fixtures/id_rsa.pub', Zold::Id::ROOT.to_s, '--network=test']
|
43
|
+
Zold::Create.new(wallets: wallets, log: test_log, remotes: nil).run(
|
44
|
+
['create', '--public-key=fixtures/id_rsa.pub', Zold::Id::ROOT.to_s, '--network=test', '--skip-test']
|
45
45
|
)
|
46
46
|
wallets.acq(Zold::Id::ROOT) do |w|
|
47
47
|
w.add(Zold::Txn.new(1, Time.now, Zold::Amount.new(zld: 1.0), 'NOPREFIX', Zold::Id.new, '-'))
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -52,31 +52,37 @@ class StressTest < Minitest::Test
|
|
52
52
|
remotes.clean
|
53
53
|
remotes.add('localhost', port)
|
54
54
|
wallets = Zold::SyncWallets.new(Zold::CachedWallets.new(Zold::Wallets.new(home)))
|
55
|
-
Zold::Create.new(wallets: wallets, log: test_log).run(
|
56
|
-
['create', '--public-key=fixtures/id_rsa.pub', Zold::Id::ROOT.to_s, '--network=test']
|
55
|
+
Zold::Create.new(wallets: wallets, log: test_log, remotes: nil).run(
|
56
|
+
['create', '--public-key=fixtures/id_rsa.pub', Zold::Id::ROOT.to_s, '--network=test', '--skip-test']
|
57
57
|
)
|
58
58
|
wallets.acq(Zold::Id::ROOT) do |w|
|
59
59
|
w.add(Zold::Txn.new(1, Time.now, Zold::Amount.new(zld: 1.0), 'NOPREFIX', Zold::Id.new, '-'))
|
60
60
|
end
|
61
|
-
stats = Zold::Stress::Stats.new
|
61
|
+
stats = Zold::Stress::Stats.new(log: test_log)
|
62
62
|
air = Zold::Stress::Air.new
|
63
|
-
batch =
|
63
|
+
batch = 4
|
64
64
|
summary = Zold::Stress::Summary.new(stats, batch)
|
65
65
|
round = Zold::Stress::Round.new(
|
66
66
|
pvt: Zold::Key.new(file: 'fixtures/id_rsa'),
|
67
|
-
wallets: wallets,
|
68
|
-
|
67
|
+
wallets: wallets,
|
68
|
+
remotes: remotes,
|
69
|
+
air: air,
|
70
|
+
stats: stats,
|
69
71
|
opts: test_opts('--pool=5', "--batch=#{batch}"),
|
70
72
|
copies: File.join(home, 'copies'),
|
71
|
-
log: test_log,
|
73
|
+
log: test_log,
|
74
|
+
vlog: test_log
|
72
75
|
)
|
73
76
|
round.update
|
74
77
|
round.prepare
|
75
78
|
round.send
|
76
79
|
attempt = 0
|
77
80
|
loop do
|
78
|
-
|
79
|
-
|
81
|
+
if air.fetch.empty?
|
82
|
+
test_log.info('There is nothing in the air, time to stop')
|
83
|
+
break
|
84
|
+
end
|
85
|
+
break if attempt > 4
|
80
86
|
round.pull
|
81
87
|
round.match
|
82
88
|
test_log.info(summary)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/test/zold/test__helper.rb
CHANGED
@@ -22,12 +22,15 @@
|
|
22
22
|
|
23
23
|
ENV['RACK_ENV'] = 'test'
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
require 'simplecov'
|
26
|
+
SimpleCov.start
|
27
|
+
if ENV['CI'] == 'true'
|
28
|
+
require 'codecov'
|
29
|
+
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
30
|
+
end
|
31
|
+
|
32
|
+
require 'zold/hands'
|
33
|
+
Zold::Hands.start
|
31
34
|
|
32
35
|
require 'concurrent'
|
33
36
|
require 'slop'
|
data/zold-stress.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2018-2019 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.rubygems_version = '2.2'
|
28
28
|
s.required_ruby_version = '>=2.3'
|
29
29
|
s.name = 'zold-stress'
|
30
|
-
s.version = '0.
|
30
|
+
s.version = '0.7.0'
|
31
31
|
s.license = 'MIT'
|
32
32
|
s.summary = 'Zold stress test'
|
33
33
|
s.description = 'Stress testing toolkit for Zold network'
|
@@ -40,15 +40,16 @@ Gem::Specification.new do |s|
|
|
40
40
|
s.rdoc_options = ['--charset=UTF-8']
|
41
41
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
42
42
|
s.add_runtime_dependency 'backtrace', '0.3.0'
|
43
|
-
s.add_runtime_dependency 'concurrent-ruby', '1.1
|
43
|
+
s.add_runtime_dependency 'concurrent-ruby', '~>1.1'
|
44
44
|
s.add_runtime_dependency 'parallelize', '0.4.1'
|
45
45
|
s.add_runtime_dependency 'slop', '4.6.2'
|
46
|
-
s.add_runtime_dependency 'zold', '0.
|
46
|
+
s.add_runtime_dependency 'zold', '0.29.30'
|
47
47
|
s.add_development_dependency 'codecov', '0.1.13'
|
48
|
+
s.add_development_dependency 'cucumber', '1.3.11'
|
48
49
|
s.add_development_dependency 'minitest', '5.11.3'
|
49
50
|
s.add_development_dependency 'random-port', '0.3.0'
|
50
51
|
s.add_development_dependency 'rdoc', '4.3.0'
|
51
52
|
s.add_development_dependency 'rspec-rails', '3.8.1'
|
52
|
-
s.add_development_dependency 'rubocop', '0.
|
53
|
-
s.add_development_dependency 'rubocop-rspec', '1.
|
53
|
+
s.add_development_dependency 'rubocop', '0.62.0'
|
54
|
+
s.add_development_dependency 'rubocop-rspec', '1.31.0'
|
54
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zold-stress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backtrace
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: concurrent-ruby
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.1
|
33
|
+
version: '1.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.1
|
40
|
+
version: '1.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: parallelize
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.29.30
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.29.30
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: codecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 0.1.13
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: cucumber
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.3.11
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.3.11
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: minitest
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,28 +170,28 @@ dependencies:
|
|
156
170
|
requirements:
|
157
171
|
- - '='
|
158
172
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.
|
173
|
+
version: 0.62.0
|
160
174
|
type: :development
|
161
175
|
prerelease: false
|
162
176
|
version_requirements: !ruby/object:Gem::Requirement
|
163
177
|
requirements:
|
164
178
|
- - '='
|
165
179
|
- !ruby/object:Gem::Version
|
166
|
-
version: 0.
|
180
|
+
version: 0.62.0
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: rubocop-rspec
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
170
184
|
requirements:
|
171
185
|
- - '='
|
172
186
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.
|
187
|
+
version: 1.31.0
|
174
188
|
type: :development
|
175
189
|
prerelease: false
|
176
190
|
version_requirements: !ruby/object:Gem::Requirement
|
177
191
|
requirements:
|
178
192
|
- - '='
|
179
193
|
- !ruby/object:Gem::Version
|
180
|
-
version: 1.
|
194
|
+
version: 1.31.0
|
181
195
|
description: Stress testing toolkit for Zold network
|
182
196
|
email: yegor256@gmail.com
|
183
197
|
executables:
|
@@ -245,8 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
259
|
- !ruby/object:Gem::Version
|
246
260
|
version: '0'
|
247
261
|
requirements: []
|
248
|
-
|
249
|
-
rubygems_version: 2.7.6
|
262
|
+
rubygems_version: 3.0.1
|
250
263
|
signing_key:
|
251
264
|
specification_version: 2
|
252
265
|
summary: Zold stress test
|