teuton 3.1.0 → 3.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/docs/devel/todo.md +13 -43
- data/docs/install/t-node.md +4 -14
- data/docs/learn/18-log.md +55 -20
- data/lib/teuton/case/dsl/expect.rb +1 -1
- data/lib/teuton/case/dsl/expect_sequence.rb +1 -1
- data/lib/teuton/case/dsl/run_script.rb +3 -3
- data/lib/teuton/case/dsl/send.rb +1 -1
- data/lib/teuton/case/dsl/upload.rb +1 -1
- data/lib/teuton/case/execute/execute_base.rb +3 -3
- data/lib/teuton/case_manager/dsl.rb +4 -4
- data/lib/teuton/case_manager/export_manager.rb +4 -4
- data/lib/teuton/report/formatter/base_formatter.rb +2 -2
- data/lib/teuton/report/formatter/default/txt.rb +1 -1
- data/lib/teuton/report/formatter/formatter.rb +3 -3
- data/lib/teuton/utils/config_file_reader.rb +9 -9
- data/lib/teuton/version.rb +1 -1
- data/lib/teuton.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3143249db4eb37afed6b89f43c8eac399724fc1a65c3d582455693b7c2c70f15
|
|
4
|
+
data.tar.gz: d45960480b70bca167e2fc8733b05595038db19d9787d737e69fe8292ac6db0b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9ddfd29427767f264e6988bb90e6a1080af39b405028c76274f1731b1b5cfe066b054c08f8669f549537e44284a201871b13dcd9d6a6c76550f8c7e0f2b852e3
|
|
7
|
+
data.tar.gz: dae095a5c5f4f17643ed5ea26523ec2abb369b0a34c82381102f9ed0f4e0766fe5809188f0ac252b66744a28250fd8b652a7299f42d7faa3443c0a081766d2d8
|
data/docs/devel/todo.md
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* Revisar (tests): result.grep(a).grep(b)
|
|
8
8
|
* "Limpiar" las funciones "deprecated"
|
|
9
9
|
* Aplicar las recomendaciones del informe de seguridad de Andrés.
|
|
10
|
-
* Eliminar/limpiar toda referencia a Vagrant.
|
|
11
10
|
* verify get(:key) and get('key') works fine!
|
|
12
11
|
* Formatter: xml
|
|
13
12
|
|
|
@@ -71,7 +70,7 @@ libs/module
|
|
|
71
70
|
|
|
72
71
|
Modificar el DSL/configuración para mejorar la integración con los contenidores Docker/podman:
|
|
73
72
|
|
|
74
|
-
> * Docker
|
|
73
|
+
> * Docker?? → https://www.cloudbees.com/blog/ssh-into-a-docker-container-how-to-execute-your-commands
|
|
75
74
|
|
|
76
75
|
Host definition example:
|
|
77
76
|
|
|
@@ -147,7 +146,6 @@ var
|
|
|
147
146
|
* Unify messages ERROR, INFO, WARN. etc
|
|
148
147
|
* **TEST**:
|
|
149
148
|
* HallOfFame test
|
|
150
|
-
* actualizar las pruebas con vagrant para la versión actual. Mejora de la calidad del código (Todo lo de Vagrant debería estar deprecated).
|
|
151
149
|
|
|
152
150
|
## 4.3 FEATURE - SAVE STATE
|
|
153
151
|
|
|
@@ -170,48 +168,20 @@ var
|
|
|
170
168
|
* Documentación en https://readthedocs.org/ ??
|
|
171
169
|
* FEATURE: Auto Parse new input format, and detect parse errors
|
|
172
170
|
|
|
171
|
+
## 4.5 Async or Ractors
|
|
172
|
+
|
|
173
|
+
Expandir el modo de ejecución y medir rendimiento:
|
|
174
|
+
|
|
175
|
+
- Secuencial
|
|
176
|
+
- Hilos
|
|
177
|
+
- Fibras
|
|
178
|
+
- Actores
|
|
179
|
+
|
|
173
180
|
# 5. Proyectos
|
|
174
181
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
## 5.1. Nueva gema teuton-panel (v2.0.0)
|
|
180
|
-
|
|
181
|
-
> Consultar en el repostorio `teuton-panel`. EN PROCESO!!!
|
|
182
|
-
|
|
183
|
-
Este TO-DO debería estar en el propio repo de la nueva gema.
|
|
184
|
-
|
|
185
|
-
* Crear nueva gema `teuton-panel` (v2) que sustituirá la versión obsoleta actual.
|
|
186
|
-
* Modificar/ampliar las funciones de `teuton config` para facilitar el trabajo a `teuton-panel`.
|
|
187
|
-
* tt_include
|
|
188
|
-
* tt_include_params
|
|
189
|
-
* aplanar/desaplanar config file.
|
|
190
|
-
* En las pruebas hemos usado `sinatra` para implementarlo.
|
|
191
|
-
|
|
192
|
-
Funcionalidades del interfaz web:
|
|
193
|
-
|
|
194
|
-
* config cases:
|
|
195
|
-
* config/remote:
|
|
196
|
-
* accept-remote-config. activar/desactivar configuraciones remotas
|
|
197
|
-
* Aceptar post formulario y vía get curl con ruta.
|
|
198
|
-
* config/list: mostrar listado con info de alumnos
|
|
199
|
-
* Elegir ubicación de almacenamiento de las configuraciones
|
|
200
|
-
* run:
|
|
201
|
-
* Ejecutar por el profesor
|
|
202
|
-
* Todos
|
|
203
|
-
* Una selección de cases
|
|
204
|
-
* every: repeticiones en bucle de I iteraciones, cada T tiempo.
|
|
205
|
-
* El alumno solicita su propia ejecución vía curl
|
|
206
|
-
* Elegir ubicación de almacenamiento de los informes
|
|
207
|
-
* Al finalizar cada ejecución se muestre un listado con los resultados
|
|
208
|
-
* readme/doc:
|
|
209
|
-
* activar auto "teuton doc" a página web para los alumnos.
|
|
210
|
-
* config panel:
|
|
211
|
-
* panel/new: crear fichero de configuración del panel
|
|
212
|
-
* panel/save: save configuración del panel
|
|
213
|
-
|
|
214
|
-
## 5.2 Editor de tests
|
|
182
|
+
Ideas que emepzaron como un nuevo feature pero por sus dimensiones, funcionalidades y características van ha derivar a su propio proyecto independiente:
|
|
183
|
+
|
|
184
|
+
## 5.1 Editor de tests
|
|
215
185
|
|
|
216
186
|
* Editor de tests ?! .... lo veo complejo... a menos que se empiece por una versión simplificada..
|
|
217
187
|
* El DSL es tan sencillo que no le veo sentido a un editor de retos.
|
data/docs/install/t-node.md
CHANGED
|
@@ -57,19 +57,9 @@ Run this command as admin user (member of `admin` group):
|
|
|
57
57
|
curl -sL https://raw.githubusercontent.com/teuton-software/teuton/master/install/mac/t-node_install.sh | bash
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
## 3.
|
|
60
|
+
## 3. Docker installation
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
## 3.1 Install using Vagrant
|
|
65
|
-
|
|
66
|
-
* First, install `Vagrant` and `VirtualBox` on your host.
|
|
67
|
-
* Create directory for vagrant project. For example, `mkdir teuton-vagrant`.
|
|
68
|
-
* Move into that directory: `cd teuton-vagrant`.
|
|
69
|
-
* Choose and download [Vagrantfile](../../install/vagrant).
|
|
70
|
-
* Run `vagrant up` to create your Virtual Machine.
|
|
71
|
-
|
|
72
|
-
## 3.2 Install using Docker
|
|
62
|
+
## 3.1 Installation
|
|
73
63
|
|
|
74
64
|
First:
|
|
75
65
|
* Install `docker` on your host.
|
|
@@ -84,7 +74,7 @@ Run this command to pull **dvarrui/teuton** image from Docker Hub and create "te
|
|
|
84
74
|
|
|
85
75
|
`docker run --name teuton -v /home/teuton -i -t dvarrui/teuton /bin/bash`
|
|
86
76
|
|
|
87
|
-
## 3.
|
|
77
|
+
## 3.3 Rebuild local docker image
|
|
88
78
|
|
|
89
79
|
1. Create Dockerfile like this:
|
|
90
80
|
|
|
@@ -113,7 +103,7 @@ CMD ["/bin/bash"]
|
|
|
113
103
|
|
|
114
104
|
## 4. Source code
|
|
115
105
|
|
|
116
|
-
If you want to install Teuton by your own, or there are not installation scripts for your OS,
|
|
106
|
+
If you want to install Teuton by your own, or there are not installation scripts for your OS, here you have information how to install all the required packages for Teuton.
|
|
117
107
|
|
|
118
108
|
Manual installation:
|
|
119
109
|
1. Git installation
|
data/docs/learn/18-log.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
## Example
|
|
8
8
|
|
|
9
|
+
* Logging ERROR, WARN and INFO messages.
|
|
10
|
+
|
|
9
11
|
```ruby
|
|
10
12
|
group "Learning about log messages" do
|
|
11
13
|
log "Using log messages."
|
|
@@ -21,46 +23,79 @@ group "Learning about log messages" do
|
|
|
21
23
|
end
|
|
22
24
|
```
|
|
23
25
|
|
|
26
|
+
* Logging an Array config param, and a Hash config param:
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
---
|
|
30
|
+
global:
|
|
31
|
+
values1:
|
|
32
|
+
- A1
|
|
33
|
+
- B1
|
|
34
|
+
- C1
|
|
35
|
+
values2:
|
|
36
|
+
p1: A2
|
|
37
|
+
p2: B2
|
|
38
|
+
p3: C2
|
|
39
|
+
cases:
|
|
40
|
+
- tt_members: TOCHANGE
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```ruby
|
|
44
|
+
group "Log: Array, Hash" do
|
|
45
|
+
log "-------------"
|
|
46
|
+
log "Array values : #{get(:values1)}"
|
|
47
|
+
log "Hash values : #{get(:values2)}"
|
|
48
|
+
end
|
|
49
|
+
```
|
|
50
|
+
|
|
24
51
|
## Output
|
|
25
52
|
|
|
26
53
|
Content of `var/18-log/case-01.txt` file.
|
|
27
54
|
|
|
28
|
-
```
|
|
55
|
+
```txt
|
|
29
56
|
CONFIGURATION
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
57
|
+
+----------------+-----------------------------------+
|
|
58
|
+
| tt_config_path | examples/18-log/config.yaml |
|
|
59
|
+
| tt_members | TOCHANGE |
|
|
60
|
+
| tt_script_path | examples/18-log/start.rb |
|
|
61
|
+
| tt_sequence | false |
|
|
62
|
+
| tt_skip | false |
|
|
63
|
+
| values1 | ["A1", "B1", "C1"] |
|
|
64
|
+
| values2 | {:p1=>"A2", :p2=>"B2", :p3=>"C2"} |
|
|
65
|
+
+----------------+-----------------------------------+
|
|
36
66
|
|
|
37
67
|
LOGS
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
68
|
+
[22:35:04] INFO: Using log messages.
|
|
69
|
+
[22:35:04] INFO: uid=1000(david) gid=1000(david) grupos=1000(david),478(wheel),464(vboxusers),108(libvirt),107(qemu),462(vagrant),460(docker),452(ollama)
|
|
70
|
+
[22:35:04] ERROR: Problem detected!
|
|
71
|
+
[22:35:04] WARN!: This is a warning
|
|
72
|
+
[22:35:04] INFO: Hi, there!
|
|
73
|
+
[22:35:04] INFO: -------------
|
|
74
|
+
[22:35:04] INFO: Array values : ["A1", "B1", "C1"]
|
|
75
|
+
[22:35:04] INFO: Hash values : {:p1=>"A2", :p2=>"B2", :p3=>"C2"}
|
|
43
76
|
|
|
44
77
|
GROUPS
|
|
45
78
|
- Learning about log messages
|
|
46
79
|
01 (1.0/1.0)
|
|
47
80
|
Description : Create user david
|
|
48
81
|
Command : id david
|
|
49
|
-
|
|
82
|
+
Output : uid=1000(david) gid=1000(david) grupos=1000(david),478(wheel),464(vboxusers),108(libvirt),107(qemu),462(vagrant),460(docker),452(ollama)
|
|
83
|
+
Duration : 0.005 (local)
|
|
50
84
|
Alterations : find(david) & count
|
|
51
|
-
Expected : Greater than 0
|
|
52
|
-
Result : 1
|
|
85
|
+
Expected : Greater than 0
|
|
86
|
+
Result : 1
|
|
53
87
|
|
|
54
88
|
RESULTS
|
|
55
89
|
+--------------+---------------------------+
|
|
56
|
-
| case_id | 01 |
|
|
57
|
-
| start_time | 2023-01-26 09:14:22 +0000 |
|
|
58
|
-
| finish_time | 2023-01-26 09:14:22 +0000 |
|
|
59
|
-
| duration | 0.002012326 |
|
|
60
90
|
| unique_fault | 0 |
|
|
91
|
+
| case_id | 01 |
|
|
92
|
+
| start_time | 2026-10-12 22:35:04 +0100 |
|
|
93
|
+
| finish_time | 2026-10-12 22:35:04 +0100 |
|
|
94
|
+
| duration | 0.004786563 |
|
|
61
95
|
| max_weight | 1.0 |
|
|
62
96
|
| good_weight | 1.0 |
|
|
63
|
-
| fail_weight | 0
|
|
97
|
+
| fail_weight | 0 |
|
|
64
98
|
| fail_counter | 0 |
|
|
65
99
|
| grade | 100 |
|
|
66
100
|
+--------------+---------------------------+
|
|
101
|
+
```
|
|
@@ -15,7 +15,7 @@ module DSL
|
|
|
15
15
|
elsif input.instance_of?(String) || input.instance_of?(Regexp) || input.instance_of?(Array)
|
|
16
16
|
expect_any input
|
|
17
17
|
else
|
|
18
|
-
puts Rainbow("[ERROR] Case expect TypeError: <expect #{input} (#{input.class})>").red
|
|
18
|
+
puts Rainbow("[ERROR] Case expect TypeError: <expect #{input} (#{input.class})>").bright.red
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
@@ -164,7 +164,7 @@ class ExpectSequence
|
|
|
164
164
|
elsif value.is_a? Regexp
|
|
165
165
|
return true << index if value.match(line)
|
|
166
166
|
else
|
|
167
|
-
puts "[ERROR] expect_sequence #{value.class}"
|
|
167
|
+
puts Rainbow("[ERROR] expect_sequence #{value.class}").bright.red
|
|
168
168
|
exit 1
|
|
169
169
|
end
|
|
170
170
|
false
|
|
@@ -11,8 +11,8 @@ module DSL
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
items = script.split(" ")
|
|
14
|
-
if items.
|
|
15
|
-
msg = Rainbow("
|
|
14
|
+
if items.empty?
|
|
15
|
+
msg = Rainbow("[ERROR] run_script: Incorrect command '#{command}'").bright.red
|
|
16
16
|
verboseln(msg)
|
|
17
17
|
return
|
|
18
18
|
end
|
|
@@ -28,7 +28,7 @@ module DSL
|
|
|
28
28
|
command = items.join(" ")
|
|
29
29
|
run(command, args)
|
|
30
30
|
else
|
|
31
|
-
msg = Rainbow("
|
|
31
|
+
msg = Rainbow("[ERROR] run_script: Incorrect protocol(#{host.protocol})").bright.red
|
|
32
32
|
verboseln(msg)
|
|
33
33
|
end
|
|
34
34
|
end
|
data/lib/teuton/case/dsl/send.rb
CHANGED
|
@@ -38,7 +38,7 @@ module DSL
|
|
|
38
38
|
logfile.write "#{msg}\n"
|
|
39
39
|
logfile.flush
|
|
40
40
|
rescue => e
|
|
41
|
-
msg = Rainbow("==> [FAIL] Case #{get(:tt_members)}: 'scp #{localfilepath}' to #{remotefilepath}").
|
|
41
|
+
msg = Rainbow("==> [FAIL] Case #{get(:tt_members)}: 'scp #{localfilepath}' to #{remotefilepath}").yellow
|
|
42
42
|
msg += "\n--> [ERROR] #{e}"
|
|
43
43
|
verboseln(msg)
|
|
44
44
|
logfile.write "#{msg}\n"
|
|
@@ -35,7 +35,7 @@ module DSL
|
|
|
35
35
|
verbose(Rainbow("!").green)
|
|
36
36
|
end
|
|
37
37
|
elsif host.protocol != "local"
|
|
38
|
-
msg = Rainbow("==> [ERROR] upload: Incorrect protocol(#{host.protocol})").red
|
|
38
|
+
msg = Rainbow("==> [ERROR] upload: Incorrect protocol(#{host.protocol})").bright.red
|
|
39
39
|
verboseln(msg)
|
|
40
40
|
end
|
|
41
41
|
end
|
|
@@ -46,9 +46,9 @@ class ExecuteBase
|
|
|
46
46
|
begin
|
|
47
47
|
text = ec.convert(text)
|
|
48
48
|
rescue => e
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
warn Rainbow("[ERROR] ExecuteBase: #{e}").bright.red
|
|
50
|
+
warn Rainbow("[ERROR] Declare text encoding. Example:").white
|
|
51
|
+
warn Rainbw("[ERROR] run 'command', on: :host, encoding: 'ISO-8859-1'").white
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
text.split("\n").compact
|
|
@@ -36,10 +36,10 @@ def use(filename)
|
|
|
36
36
|
begin
|
|
37
37
|
require_relative findfiles.first
|
|
38
38
|
Project.value[:uses] << File.basename(findfiles.first)
|
|
39
|
-
rescue => e
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
rescue StandardError => e
|
|
40
|
+
warn Rainbow("[ERROR] case_manager/dsl: #{e}").bright.red
|
|
41
|
+
warn Rainbow("[ERROR] File not found!").white
|
|
42
|
+
warn Rainbow("[ERROR] Fix line <use '#{filename}'>").white
|
|
43
43
|
exit 1
|
|
44
44
|
end
|
|
45
45
|
end
|
|
@@ -15,10 +15,10 @@ class ExportManager
|
|
|
15
15
|
# @param input (Hash) Selected export options
|
|
16
16
|
def call(main_report, cases, args)
|
|
17
17
|
if args.class != Hash
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
warn Rainbow("[ERROR] ExportManager: argument error!").bright.red
|
|
19
|
+
warn Rainbow("[ERROR] Fix line <export #{args}>").white
|
|
20
|
+
warn Rainbow("[ERROR] Replace by <export format: 'txt'>").white
|
|
21
|
+
warn ""
|
|
22
22
|
exit 1
|
|
23
23
|
end
|
|
24
24
|
|
|
@@ -41,9 +41,9 @@ module Formatter
|
|
|
41
41
|
def self.call(report, options, filename)
|
|
42
42
|
klass = get(options[:format])
|
|
43
43
|
if klass.nil?
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
warn Rainbow("[ERROR] Formatter:").bright.red
|
|
45
|
+
warn Rainbow("[ERROR] - Unkown format <#{options[:format]}>. Fix line <export format: FORMAT>").white
|
|
46
|
+
warn Rainbow("[ERROR] - Available formats: #{Formatter.available_formats.join(",")}.").white
|
|
47
47
|
exit 1
|
|
48
48
|
end
|
|
49
49
|
formatter = klass.new(report)
|
|
@@ -11,7 +11,7 @@ module ConfigFileReader
|
|
|
11
11
|
|
|
12
12
|
return read_json(filepath) if File.extname(filepath) == ".json"
|
|
13
13
|
|
|
14
|
-
raise "[ERROR] ConfigFileReader.call: <#{filepath}>. Unkown extension!"
|
|
14
|
+
raise Rainbow("[ERROR] ConfigFileReader.call: <#{filepath}>. Unkown extension!").bright.red
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def self.convert_string_keys_to_symbol(input)
|
|
@@ -61,8 +61,8 @@ module ConfigFileReader
|
|
|
61
61
|
begin
|
|
62
62
|
data = YAML.load(File.open(filepath))
|
|
63
63
|
rescue => e
|
|
64
|
-
warn "[ERROR] ConfigFileReader.read_yaml: #{e}"
|
|
65
|
-
warn "[ERROR] Revise file content! <#{filepath}>"
|
|
64
|
+
warn Rainbow("[ERROR] ConfigFileReader.read_yaml: #{e}").bright.red
|
|
65
|
+
warn Rainbow("[ERROR] Revise file content! <#{filepath}>").white
|
|
66
66
|
exit 1
|
|
67
67
|
end
|
|
68
68
|
data = convert_string_keys_to_symbol(data)
|
|
@@ -111,9 +111,9 @@ module ConfigFileReader
|
|
|
111
111
|
begin
|
|
112
112
|
data = YAML.load(File.open(filepath))
|
|
113
113
|
rescue => e
|
|
114
|
-
warn "[ERROR] Reading configurations from yaml:"
|
|
115
|
-
warn "[ERROR] - File : #{filepath}"
|
|
116
|
-
warn "[ERROR] - Type : #{e}"
|
|
114
|
+
warn Rainbow("[ERROR] Reading configurations from yaml:").bright.red
|
|
115
|
+
warn Rainbow("[ERROR] - File : #{filepath}").white
|
|
116
|
+
warn Rainbow("[ERROR] - Type : #{e}").white
|
|
117
117
|
exit 1
|
|
118
118
|
end
|
|
119
119
|
data[:tt_source_file] = relative_path(filepath)
|
|
@@ -124,9 +124,9 @@ module ConfigFileReader
|
|
|
124
124
|
begin
|
|
125
125
|
data = JSON.parse(File.read(filepath), symbolize_names: true)
|
|
126
126
|
rescue => e
|
|
127
|
-
warn "[ERROR] Reading configurations from json:"
|
|
128
|
-
warn "[ERROR] - File : #{filepath}"
|
|
129
|
-
warn "[ERROR] - Type : #{e}"
|
|
127
|
+
warn Rainbow("[ERROR] Reading configurations from json:").bright.red
|
|
128
|
+
warn Rainboe("[ERROR] - File : #{filepath}").white
|
|
129
|
+
warn Rainbow("[ERROR] - Type : #{e}").white
|
|
130
130
|
exit 1
|
|
131
131
|
end
|
|
132
132
|
data[:tt_source_file] = relative_path(filepath)
|
data/lib/teuton/version.rb
CHANGED
data/lib/teuton.rb
CHANGED