teuton 2.3.3 → 2.3.6
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/README.md +1 -1
- data/docs/dsl/execution/send.md +11 -11
- data/docs/learn/example-02-config.md +0 -1
- data/lib/teuton/case_manager/case/dsl/send.rb +4 -2
- data/lib/teuton/case_manager/utils.rb +1 -4
- data/lib/teuton/files/config.yaml +4 -4
- data/lib/teuton/readme/readme.rb +2 -12
- data/lib/teuton/report/close.rb +0 -5
- data/lib/teuton/report/formatter/txt_formatter.rb +0 -2
- data/lib/teuton/skeleton.rb +0 -7
- data/lib/teuton/version.rb +1 -1
- data/lib/teuton.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a57c245ece6497c75d1132e50cfaa722be5fae7df918ffa8b0af4e109f600cee
|
4
|
+
data.tar.gz: 8159ac8b86278ada1e0fac691d91b37d146cb5c336ec2f4babe729d8150063ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28594d840fe733c4fbc0d28b6d81610ccea3011c5d8713ac279b85280ece74b74f37670125edab21eae0a1f93c740a882784757c81c792a2327336f03c995233
|
7
|
+
data.tar.gz: 7f19810c16c1d3ad78b41de32a2b3a6f85dbff280972b9f6193d5b4ab86f470662357c7a29d2f5ae310246b7b6c3dfec3da95f2aab927c6f10e775bed8e0cb77
|
data/README.md
CHANGED
data/docs/dsl/execution/send.md
CHANGED
@@ -20,7 +20,7 @@ end
|
|
20
20
|
|
21
21
|
* `send` instruction must be execute after `export`. Reports must be generated before send them, of course.
|
22
22
|
* `host1`, it' the label that identified remote host. This information must be configured into config file.
|
23
|
-
* `send :
|
23
|
+
* `send copy_to: :host1`, copy every case resport file into temp directory on remote host `host1`.
|
24
24
|
|
25
25
|
## Example
|
26
26
|
|
@@ -38,8 +38,8 @@ Example 2: send report file to remote "./Desktop" folder.
|
|
38
38
|
|
39
39
|
| Action | Description |
|
40
40
|
| ------ | ----------- |
|
41
|
-
| `send :
|
42
|
-
| `send :
|
41
|
+
| `send copy_to: :host1, remote_dir: "/home/david"` | Reports will be saved into "/home/david" directory in remote machine `host1`. |
|
42
|
+
| `send copy_to: :host1, prefix: "samba_"` | Case report will be save into temp directory on every host `host1`, named as `samba_case-XX.txt`. |
|
43
43
|
|
44
44
|
> Teuton version 2.0.x
|
45
45
|
> * By default, `send` only works when remote OS type is UNIX base, like GNU/Linux, MACOS, BSD, etc.
|
@@ -49,14 +49,14 @@ Example 2: send report file to remote "./Desktop" folder.
|
|
49
49
|
|
50
50
|
If you export several files using differents output formats, you will use several `export` orders. Then when invoke `send` order, this will send the last exported file.
|
51
51
|
|
52
|
-
In this example we export
|
52
|
+
In this example we export html and txt files, but only send txt to remote hosts:
|
53
53
|
|
54
54
|
```ruby
|
55
55
|
start do
|
56
|
-
export :
|
57
|
-
export :
|
56
|
+
export format: :json
|
57
|
+
export format: :txt
|
58
58
|
|
59
|
-
send :
|
59
|
+
send copy_to: :host1
|
60
60
|
end
|
61
61
|
```
|
62
62
|
|
@@ -64,10 +64,10 @@ If you want to send every exported output file, then do like this:
|
|
64
64
|
|
65
65
|
```ruby
|
66
66
|
start do
|
67
|
-
export :
|
68
|
-
send :
|
67
|
+
export format: :html
|
68
|
+
send copy_to: :host1
|
69
69
|
|
70
|
-
export :
|
71
|
-
send :
|
70
|
+
export format: :txt
|
71
|
+
send copy_to: :host1
|
72
72
|
end
|
73
73
|
```
|
@@ -18,9 +18,11 @@ module DSL
|
|
18
18
|
ip = get((host + '_ip').to_sym)
|
19
19
|
username = get((host + '_username').to_sym).to_s
|
20
20
|
password = get((host + '_password').to_sym).to_s
|
21
|
-
port = get((host + '_port').to_sym)
|
21
|
+
port = get((host + '_port').to_sym).to_i
|
22
|
+
port = 22 if port.zero?
|
22
23
|
|
23
|
-
filename = @report.filename
|
24
|
+
filename = "#{@report.filename}.#{@report.format.to_s}"
|
25
|
+
filename = "#{@report.filename}.txt" if @report.format == :colored_text
|
24
26
|
localfilepath = File.join(@report.output_dir, filename)
|
25
27
|
filename = args[:prefix].to_s + filename if args[:prefix]
|
26
28
|
|
@@ -1,8 +1,7 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
1
|
|
3
2
|
require_relative '../application'
|
3
|
+
require 'fileutils'
|
4
4
|
|
5
|
-
# Define general use methods
|
6
5
|
module Utils
|
7
6
|
# Create the directory if it dosn't exist.
|
8
7
|
def ensure_dir(dirname)
|
@@ -13,7 +12,6 @@ module Utils
|
|
13
12
|
true
|
14
13
|
end
|
15
14
|
|
16
|
-
# rubocop:disable Metrics/MethodLength
|
17
15
|
def encode_and_split(encoding, text)
|
18
16
|
# Convert text to UTF-8 deleting unknown chars
|
19
17
|
text ||= '' # Ensure text is not nil
|
@@ -31,7 +29,6 @@ module Utils
|
|
31
29
|
|
32
30
|
text.split("\n")
|
33
31
|
end
|
34
|
-
# rubocop:enable Metrics/MethodLength
|
35
32
|
|
36
33
|
def my_execute(cmd, encoding = 'UTF-8')
|
37
34
|
return { exitstatus: 0, content: '' } if Application.instance.debug
|
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
|
4
|
-
-
|
5
|
-
|
2
|
+
global:
|
3
|
+
cases:
|
4
|
+
- tt_members: MEMBERS
|
5
|
+
tt_moodle_id: MOODLE_ID
|
data/lib/teuton/readme/readme.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
1
|
|
3
2
|
require_relative '../application'
|
4
3
|
require_relative '../utils/configfile_reader'
|
@@ -44,8 +43,6 @@ class Readme
|
|
44
43
|
reset
|
45
44
|
end
|
46
45
|
|
47
|
-
##
|
48
|
-
# Show README on screen
|
49
46
|
def show
|
50
47
|
process_content
|
51
48
|
show_head
|
@@ -55,8 +52,6 @@ class Readme
|
|
55
52
|
|
56
53
|
private
|
57
54
|
|
58
|
-
##
|
59
|
-
# Reset attributes
|
60
55
|
def reset
|
61
56
|
app = Application.instance
|
62
57
|
@config = ConfigFileReader.read(app.config_path)
|
@@ -86,8 +81,6 @@ class Readme
|
|
86
81
|
@action = { readme: [] }
|
87
82
|
end
|
88
83
|
|
89
|
-
##
|
90
|
-
# Show README head
|
91
84
|
def show_head
|
92
85
|
app = Application.instance
|
93
86
|
puts '```'
|
@@ -117,12 +110,10 @@ class Readme
|
|
117
110
|
@cases_params.sort!
|
118
111
|
puts Lang::get(:params)
|
119
112
|
@cases_params.uniq.each { |i| puts format('* %s', i) }
|
120
|
-
puts "\n> NOTE: Save every '
|
113
|
+
puts "\n> NOTE: Save every 'param: value' into config file."
|
121
114
|
end
|
122
115
|
end
|
123
116
|
|
124
|
-
##
|
125
|
-
# Show README content
|
126
117
|
def show_content
|
127
118
|
@data[:groups].each do |group|
|
128
119
|
next if group[:actions].empty?
|
@@ -148,8 +139,6 @@ class Readme
|
|
148
139
|
end
|
149
140
|
end
|
150
141
|
|
151
|
-
##
|
152
|
-
# Show README tail
|
153
142
|
def show_tail
|
154
143
|
return if @global_params.empty?
|
155
144
|
|
@@ -170,3 +159,4 @@ class Readme
|
|
170
159
|
@setted_params.each_pair { |k,v| puts "|#{k}|#{v}|" }
|
171
160
|
end
|
172
161
|
end
|
162
|
+
|
data/lib/teuton/report/close.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
1
|
|
3
2
|
# Close Show methods for Report class.
|
4
3
|
class Report
|
@@ -9,8 +8,6 @@ class Report
|
|
9
8
|
# * good_weight,d
|
10
9
|
# * fail_weight
|
11
10
|
# * fail_counter
|
12
|
-
# rubocop:disable Metrics/AbcSize
|
13
|
-
# rubocop:disable Metrics/MethodLength
|
14
11
|
def close
|
15
12
|
app = Application.instance
|
16
13
|
max = 0.0
|
@@ -40,6 +37,4 @@ class Report
|
|
40
37
|
@tail[:grade] = (100.0 * i).round
|
41
38
|
@tail[:grade] = 0 if @tail[:unique_fault].positive?
|
42
39
|
end
|
43
|
-
# rubocop:enable Metrics/AbcSize
|
44
|
-
# rubocop:enable Metrics/MethodLength
|
45
40
|
end
|
data/lib/teuton/skeleton.rb
CHANGED
@@ -1,13 +1,10 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
1
|
|
3
2
|
require 'fileutils'
|
4
3
|
require 'rainbow'
|
5
4
|
|
6
|
-
# Skeleton module
|
7
5
|
module Skeleton
|
8
6
|
##
|
9
7
|
# Create teuton project skeleton
|
10
|
-
# @param project_dir (String)
|
11
8
|
def self.create(project_dir)
|
12
9
|
project_name = File.basename(project_dir)
|
13
10
|
puts "\n[INFO] Creating #{Rainbow(project_name).bright} project skeleton"
|
@@ -33,9 +30,6 @@ module Skeleton
|
|
33
30
|
end
|
34
31
|
end
|
35
32
|
|
36
|
-
##
|
37
|
-
# Create dir
|
38
|
-
# @param dirpath (String)
|
39
33
|
private_class_method def self.create_dir(dirpath)
|
40
34
|
if Dir.exist? dirpath
|
41
35
|
puts "* Exists dir! => #{Rainbow(dirpath).yellow}"
|
@@ -67,5 +61,4 @@ module Skeleton
|
|
67
61
|
end
|
68
62
|
end
|
69
63
|
end
|
70
|
-
# rubocop:enable Metrics/MethodLength
|
71
64
|
end
|
data/lib/teuton/version.rb
CHANGED
data/lib/teuton.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
|
2
2
|
require_relative 'teuton/application'
|
3
|
-
require_relative 'teuton/skeleton'
|
4
3
|
|
5
4
|
module Teuton
|
6
5
|
def self.create(path_to_new_dir)
|
6
|
+
require_relative 'teuton/skeleton'
|
7
7
|
Skeleton.create(path_to_new_dir)
|
8
8
|
end
|
9
9
|
|
@@ -13,7 +13,7 @@ module Teuton
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.readme(projectpath, options = {})
|
16
|
-
# Create Readme file for a test
|
16
|
+
# Create Readme file for a teuton test
|
17
17
|
Application.instance.add_input_params(projectpath, options)
|
18
18
|
require_dsl_and_script('teuton/readme/readme') # Define DSL keywords
|
19
19
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teuton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Vargas Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -378,5 +378,5 @@ requirements: []
|
|
378
378
|
rubygems_version: 3.1.6
|
379
379
|
signing_key:
|
380
380
|
specification_version: 4
|
381
|
-
summary: Teuton (
|
381
|
+
summary: Teuton (Infrastructure test)
|
382
382
|
test_files: []
|