liri 0.1.0 → 0.2.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/.gitignore +4 -2
- data/.simplecov +8 -0
- data/Gemfile +4 -1
- data/Gemfile.lock +27 -15
- data/bash_script_examples.sh +1 -0
- data/dummy-app/.gitignore +12 -0
- data/dummy-app/.rspec +3 -0
- data/dummy-app/.ruby-gemset +1 -0
- data/dummy-app/.ruby-version +1 -0
- data/dummy-app/CODE_OF_CONDUCT.md +84 -0
- data/dummy-app/Gemfile +10 -0
- data/dummy-app/Gemfile.lock +35 -0
- data/dummy-app/LICENSE.txt +21 -0
- data/dummy-app/README.md +43 -0
- data/dummy-app/Rakefile +8 -0
- data/dummy-app/bin/console +15 -0
- data/dummy-app/bin/setup +8 -0
- data/dummy-app/dummy-app.gemspec +39 -0
- data/dummy-app/lib/dummy/app/version.rb +7 -0
- data/dummy-app/lib/dummy/app.rb +10 -0
- data/dummy-app/spec/dummy/app_spec.rb +11 -0
- data/dummy-app/spec/spec_helper.rb +15 -0
- data/exe/liri +9 -4
- data/lib/agent/agent.rb +90 -50
- data/lib/agent/runner.rb +1 -3
- data/lib/all_libraries.rb +4 -2
- data/lib/common/benchmarking.rb +5 -10
- data/lib/common/log.rb +12 -6
- data/lib/common/manager_data.rb +30 -0
- data/lib/common/progressbar.rb +29 -0
- data/lib/common/setup.rb +103 -0
- data/lib/common/source_code.rb +22 -12
- data/lib/common/tests_result.rb +115 -0
- data/lib/common/unit_test/rspec.rb +15 -23
- data/lib/liri.rb +22 -35
- data/lib/manager/manager.rb +163 -98
- data/lib/task.rb +2 -2
- data/liri.gemspec +8 -0
- data/spec_credentials.yml.example +4 -0
- data/template/liri-config.yml +4 -2
- metadata +54 -4
- data/lib/manager/setup.rb +0 -70
- data/lib/manager/test_result.rb +0 -38
data/liri.gemspec
CHANGED
@@ -55,4 +55,12 @@ Gem::Specification.new do |spec|
|
|
55
55
|
# Ruby internationalization and localization (i18n) solution. https://github.com/ruby-i18n/i18n
|
56
56
|
# Este es un requerimiento de la gema to_duration
|
57
57
|
spec.add_runtime_dependency('i18n', '~> 1')
|
58
|
+
|
59
|
+
# The ultimate text progress bar library for Ruby!. https://github.com/jfelchner/ruby-progressbar
|
60
|
+
# Para mostrar barras de progreso
|
61
|
+
spec.add_runtime_dependency('ruby-progressbar', '~> 1')
|
62
|
+
|
63
|
+
# Terminal Table is a fast and simple, yet feature rich table generator written in Ruby. https://github.com/tj/terminal-table
|
64
|
+
# Para mostrar resumen de resultados
|
65
|
+
spec.add_runtime_dependency('terminal-table', '~> 3')
|
58
66
|
end
|
data/template/liri-config.yml
CHANGED
@@ -3,12 +3,14 @@
|
|
3
3
|
# Obs.: Puede que no sea útil para el usuario poder cambiar este nombre
|
4
4
|
compressed_file_name: compressed_source_code
|
5
5
|
# Configuración de la cantidad de tests a ejecutar por tandas
|
6
|
-
test_samples_by_runner:
|
6
|
+
test_samples_by_runner: 1000
|
7
|
+
print_failures: false
|
7
8
|
log:
|
8
9
|
stdout:
|
9
10
|
# Configuración que define si se muestra el log de ejecución del programa en línea de comando. Puede ser true o false.
|
10
11
|
# Por defecto siempre se imprimirá el log en un archivo dentro de la carpeta logs
|
11
|
-
|
12
|
+
# Si se pone a true, interfiere con la barra de progreso del Manager, mejor tenerlo en false
|
13
|
+
show: false
|
12
14
|
# Define los colores del texto del log. Puede ser none (no muestra colores), severity (colorea código de error),
|
13
15
|
# severity_date (colorea código de error y fecha), full (colorea el texto entero).
|
14
16
|
colorize: full
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Fernández
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-05-
|
12
|
+
date: 2022-05-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubyzip
|
@@ -95,6 +95,34 @@ dependencies:
|
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '1'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: ruby-progressbar
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '1'
|
105
|
+
type: :runtime
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '1'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: terminal-table
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '3'
|
119
|
+
type: :runtime
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - "~>"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '3'
|
98
126
|
description: Test distributor executor
|
99
127
|
email:
|
100
128
|
- rofaccess@gmail.com
|
@@ -110,6 +138,7 @@ files:
|
|
110
138
|
- ".rubocop.yml"
|
111
139
|
- ".ruby-gemset"
|
112
140
|
- ".ruby-version"
|
141
|
+
- ".simplecov"
|
113
142
|
- ".travis.yml"
|
114
143
|
- CODE_OF_CONDUCT.md
|
115
144
|
- Gemfile
|
@@ -117,6 +146,7 @@ files:
|
|
117
146
|
- LICENSE.txt
|
118
147
|
- README.md
|
119
148
|
- Rakefile
|
149
|
+
- bash_script_examples.sh
|
120
150
|
- bin/bundle
|
121
151
|
- bin/coderay
|
122
152
|
- bin/commander
|
@@ -132,6 +162,23 @@ files:
|
|
132
162
|
- bin/yardoc
|
133
163
|
- bin/yri
|
134
164
|
- config/locales/to_duration_es.yml
|
165
|
+
- dummy-app/.gitignore
|
166
|
+
- dummy-app/.rspec
|
167
|
+
- dummy-app/.ruby-gemset
|
168
|
+
- dummy-app/.ruby-version
|
169
|
+
- dummy-app/CODE_OF_CONDUCT.md
|
170
|
+
- dummy-app/Gemfile
|
171
|
+
- dummy-app/Gemfile.lock
|
172
|
+
- dummy-app/LICENSE.txt
|
173
|
+
- dummy-app/README.md
|
174
|
+
- dummy-app/Rakefile
|
175
|
+
- dummy-app/bin/console
|
176
|
+
- dummy-app/bin/setup
|
177
|
+
- dummy-app/dummy-app.gemspec
|
178
|
+
- dummy-app/lib/dummy/app.rb
|
179
|
+
- dummy-app/lib/dummy/app/version.rb
|
180
|
+
- dummy-app/spec/dummy/app_spec.rb
|
181
|
+
- dummy-app/spec/spec_helper.rb
|
135
182
|
- exe/liri
|
136
183
|
- lib/agent/agent.rb
|
137
184
|
- lib/agent/runner.rb
|
@@ -139,7 +186,11 @@ files:
|
|
139
186
|
- lib/common/benchmarking.rb
|
140
187
|
- lib/common/compressor/zip.rb
|
141
188
|
- lib/common/log.rb
|
189
|
+
- lib/common/manager_data.rb
|
190
|
+
- lib/common/progressbar.rb
|
191
|
+
- lib/common/setup.rb
|
142
192
|
- lib/common/source_code.rb
|
193
|
+
- lib/common/tests_result.rb
|
143
194
|
- lib/common/unit_test/rspec.rb
|
144
195
|
- lib/exe/agent.rb
|
145
196
|
- lib/exe/manager.rb
|
@@ -147,10 +198,9 @@ files:
|
|
147
198
|
- lib/liri.rb
|
148
199
|
- lib/manager/credential.rb
|
149
200
|
- lib/manager/manager.rb
|
150
|
-
- lib/manager/setup.rb
|
151
|
-
- lib/manager/test_result.rb
|
152
201
|
- lib/task.rb
|
153
202
|
- liri.gemspec
|
203
|
+
- spec_credentials.yml.example
|
154
204
|
- template/liri-config.yml
|
155
205
|
homepage: https://github.com/rofaccess/tfg
|
156
206
|
licenses:
|
data/lib/manager/setup.rb
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
Este modulo se encarga de manejar la configuración
|
3
|
-
=end
|
4
|
-
require 'yaml'
|
5
|
-
require 'json'
|
6
|
-
|
7
|
-
module Liri
|
8
|
-
class Manager
|
9
|
-
class Setup
|
10
|
-
FILE_NAME = 'liri-config.yml'
|
11
|
-
TEMPLATE_PATH = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), 'template/liri-config.yml')
|
12
|
-
|
13
|
-
def initialize(folder_path)
|
14
|
-
# Crea la carpeta en donde se guardarán los datos relativos a liri, ya sean archivos comprimidos,
|
15
|
-
# archivos descomprimidos, configuraciones, etc.
|
16
|
-
Dir.mkdir(folder_path) unless Dir.exist?(folder_path)
|
17
|
-
|
18
|
-
@file_path = File.join(folder_path, '/', FILE_NAME)
|
19
|
-
end
|
20
|
-
|
21
|
-
# Crea un archivo de configuración en la raiz del proyecto desde un template
|
22
|
-
def create
|
23
|
-
File.open(@file_path, "w") do |output_file|
|
24
|
-
File.foreach(TEMPLATE_PATH) do |input_line|
|
25
|
-
output_file.write(input_line)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
true
|
29
|
-
end
|
30
|
-
|
31
|
-
# Retorna los datos del archivo de configuración
|
32
|
-
def load
|
33
|
-
if File.exist?(@file_path)
|
34
|
-
data = YAML.load(File.read(@file_path))
|
35
|
-
JSON.parse(data.to_json, object_class: OpenStruct)
|
36
|
-
else
|
37
|
-
raise Liri::FileNotFoundError.new(@file_path)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# Borra el archivo de configuración
|
42
|
-
def delete
|
43
|
-
if File.exist?(@file_path)
|
44
|
-
File.delete(@file_path)
|
45
|
-
true
|
46
|
-
else
|
47
|
-
false
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
def set(value, *keys)
|
52
|
-
data = YAML.load(File.read(@file_path))
|
53
|
-
keys = keys.first
|
54
|
-
aux = data
|
55
|
-
keys.each_with_index do |key, index|
|
56
|
-
if (keys[index + 1])
|
57
|
-
aux = data[key]
|
58
|
-
else
|
59
|
-
aux[key] = value
|
60
|
-
end
|
61
|
-
end
|
62
|
-
File.open(@file_path, 'w') { |f| f.write data.to_yaml }
|
63
|
-
end
|
64
|
-
|
65
|
-
def path
|
66
|
-
@file_path
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
data/lib/manager/test_result.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
# Procesa el resultado de las pruebas unitarias
|
2
|
-
module Liri
|
3
|
-
class Manager
|
4
|
-
class TestResult
|
5
|
-
def initialize
|
6
|
-
@example_quantity = 0
|
7
|
-
@failure_quantity = 0
|
8
|
-
@passed_quantity = 0
|
9
|
-
end
|
10
|
-
def update(test_result)
|
11
|
-
@example_quantity += test_result['example_quantity']
|
12
|
-
@failure_quantity += test_result['failure_quantity']
|
13
|
-
@passed_quantity += (@example_quantity - @failure_quantity)
|
14
|
-
end
|
15
|
-
|
16
|
-
def print_process(test_result)
|
17
|
-
passed_quantity = test_result['example_quantity'] - test_result['failure_quantity']
|
18
|
-
passed_quantity.times do
|
19
|
-
print '.'
|
20
|
-
end
|
21
|
-
|
22
|
-
test_result['failure_quantity'].times do
|
23
|
-
print 'F'
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def print_summary
|
28
|
-
print_examples_and_failures
|
29
|
-
end
|
30
|
-
|
31
|
-
private
|
32
|
-
|
33
|
-
def print_examples_and_failures
|
34
|
-
puts "#{@example_quantity} examples, #{@failure_quantity} failures\n\n"
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|