teuton 2.3.11 → 2.4.1
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 +45 -13
- data/docs/CHANGELOG.md +0 -13
- data/docs/changelog/todo.md +26 -0
- data/docs/changelog/v2.4.md +6 -2
- data/docs/dsl/execution/export.md +11 -16
- data/docs/dsl/execution/show.md +22 -7
- data/docs/ideas/{ideas.md → todo.md} +8 -16
- data/docs/install/README.md +26 -42
- data/docs/install/s-node.md +35 -0
- data/docs/install/t-node.md +76 -0
- data/docs/learn/01-target.md +34 -66
- data/docs/learn/02-config.md +35 -56
- data/docs/learn/03-remote_hosts.md +20 -1
- data/docs/learn/04-new_test.md +4 -4
- data/docs/learn/05-use.md +3 -4
- data/docs/learn/06-debug.md +6 -9
- data/docs/learn/07-log.md +14 -14
- data/docs/learn/08-readme.md +4 -4
- data/docs/learn/09-preserve.md +1 -1
- data/docs/learn/13-include.md +13 -6
- data/docs/learn/14-alias.md +14 -8
- data/docs/learn/17-hide-feedback.md +52 -0
- data/docs/learn/README.md +8 -15
- data/lib/teuton/case_manager/case/case.rb +2 -5
- data/lib/teuton/case_manager/case/dsl/expect.rb +2 -4
- data/lib/teuton/case_manager/case/dsl/log.rb +1 -2
- data/lib/teuton/case_manager/case/dsl/send.rb +4 -2
- data/lib/teuton/case_manager/case/play.rb +1 -2
- data/lib/teuton/case_manager/case/runner.rb +6 -7
- data/lib/teuton/case_manager/case_manager.rb +18 -12
- data/lib/teuton/case_manager/check_cases.rb +5 -7
- data/lib/teuton/case_manager/dsl.rb +1 -1
- data/lib/teuton/case_manager/export_manager.rb +13 -15
- data/lib/teuton/case_manager/hall_of_fame.rb +20 -16
- data/lib/teuton/case_manager/main.rb +1 -2
- data/lib/teuton/case_manager/report.rb +3 -3
- data/lib/teuton/report/formatter/base_formatter.rb +8 -7
- data/lib/teuton/report/formatter/{array_formatter.rb → default/array.rb} +44 -9
- data/lib/teuton/report/formatter/default/colored_text.rb +7 -0
- data/lib/teuton/report/formatter/default/html.rb +24 -0
- data/lib/teuton/report/formatter/default/json.rb +15 -0
- data/lib/teuton/report/formatter/{txt_formatter.rb → default/txt.rb} +4 -3
- data/lib/teuton/report/formatter/{xml_formatter.rb → default/xml.rb} +10 -4
- data/lib/teuton/report/formatter/default/yaml.rb +15 -0
- data/lib/teuton/report/formatter/formatter.rb +55 -0
- data/lib/teuton/report/formatter/moodle_csv_formatter.rb +4 -10
- data/lib/teuton/report/formatter/{resume_array_formatter.rb → resume/array.rb} +4 -7
- data/lib/teuton/report/formatter/resume/colored_text.rb +7 -0
- data/lib/teuton/report/formatter/{resume_html_formatter.rb → resume/html.rb} +7 -9
- data/lib/teuton/report/formatter/{resume_json_formatter.rb → resume/json.rb} +4 -4
- data/lib/teuton/report/formatter/{resume_txt_formatter.rb → resume/txt.rb} +4 -6
- data/lib/teuton/report/formatter/{resume_yaml_formatter.rb → resume/yaml.rb} +4 -3
- data/lib/teuton/report/report.rb +60 -43
- data/lib/teuton/report/show.rb +38 -24
- data/lib/teuton/version.rb +1 -1
- data/lib/teuton.rb +2 -1
- metadata +38 -35
- data/docs/install/scripts.md +0 -96
- data/lib/teuton/case_manager/show.rb +0 -24
- data/lib/teuton/report/close.rb +0 -38
- data/lib/teuton/report/formatter/csv_formatter.rb +0 -25
- data/lib/teuton/report/formatter/formatter_factory.rb +0 -79
- data/lib/teuton/report/formatter/html_formatter.rb +0 -57
- data/lib/teuton/report/formatter/json_formatter.rb +0 -12
- data/lib/teuton/report/formatter/list_formatter.rb +0 -65
- data/lib/teuton/report/formatter/resume_list_formatter.rb +0 -62
- data/lib/teuton/report/formatter/yaml_formatter.rb +0 -15
data/docs/learn/02-config.md
CHANGED
@@ -1,19 +1,16 @@
|
|
1
1
|
[<< back](README.md)
|
2
2
|
|
3
|
-
# Example:
|
3
|
+
# Example: config
|
4
4
|
|
5
|
-
|
6
|
-
* Use params defined into config files.
|
7
|
-
* It's good idea save variable data separated into external config file.
|
5
|
+
_It's good idea save variables into config file._
|
8
6
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
4. [Results](#results).
|
7
|
+
Learn:
|
8
|
+
* How to use config file.
|
9
|
+
* How to use params defined into config files.
|
13
10
|
|
14
11
|
## Config file
|
15
12
|
|
16
|
-
By default, `config.yaml` is our config file.
|
13
|
+
By default, `config.yaml` is our default config file. Example:
|
17
14
|
|
18
15
|
```yaml
|
19
16
|
---
|
@@ -22,12 +19,14 @@ cases:
|
|
22
19
|
- tt_members: Student-name-1
|
23
20
|
username: root
|
24
21
|
- tt_members: Student-name-2
|
25
|
-
username:
|
22
|
+
username: david
|
26
23
|
```
|
27
24
|
|
25
|
+
> **How to choose another config file?** Read this [document](../commands/example_run.md#3-choosing-config-file).
|
26
|
+
|
28
27
|
## Definition section
|
29
28
|
|
30
|
-
By default, `start.rb` it's our main execution file.
|
29
|
+
By default, `start.rb` it's our main execution file. Example:
|
31
30
|
|
32
31
|
```ruby
|
33
32
|
group "Reading params from config file" do
|
@@ -39,15 +38,14 @@ group "Reading params from config file" do
|
|
39
38
|
end
|
40
39
|
```
|
41
40
|
|
42
|
-
In this section we define targets using
|
43
|
-
|
44
|
-
* **get** keyword is used to read params from configuracion file. It's posible personalize tests with diferent values for every case.
|
41
|
+
In this section, we define targets using `target`, `run`, `expect` and `get` keywords.
|
45
42
|
|
46
|
-
|
43
|
+
* **get** keyword read params from configuration file. It's posible personalize tests with diferent values for every case.
|
47
44
|
|
48
45
|
## Execution section
|
49
46
|
|
50
47
|
Main execution block:
|
48
|
+
|
51
49
|
```ruby
|
52
50
|
play do
|
53
51
|
show
|
@@ -55,41 +53,25 @@ play do
|
|
55
53
|
end
|
56
54
|
```
|
57
55
|
|
58
|
-
|
56
|
+
This example run test and show (`show` keyword) output on screen:
|
59
57
|
|
60
|
-
```
|
61
|
-
> teuton run
|
62
|
-
|
63
|
-
|
64
|
-
| tt_title | Executing [teuton] (version 2.2.0) |
|
65
|
-
| tt_scriptname | examples/learn-02-config/start.rb |
|
66
|
-
| tt_configfile | examples/learn-02-config/config.yaml |
|
67
|
-
| tt_pwd | /home/david/proy/repos/teuton.d/teuton |
|
68
|
-
| tt_testname | learn-02-config |
|
69
|
-
| tt_sequence | false |
|
70
|
-
+---------------+----------------------------------------+
|
71
|
-
|
72
|
-
CASES
|
58
|
+
```console
|
59
|
+
> teuton run examples/02-config
|
60
|
+
|
61
|
+
CASE RESULTS
|
73
62
|
+------+----------------+-------+-------+
|
74
63
|
| CASE | MEMBERS | GRADE | STATE |
|
75
|
-
| 01 | Student-name-1 |
|
76
|
-
| 02 | Student-name-2 |
|
64
|
+
| 01 | Student-name-1 | 100.0 | ✔ |
|
65
|
+
| 02 | Student-name-2 | 0.0 | ? |
|
77
66
|
+------+----------------+-------+-------+
|
78
|
-
|
79
|
-
RESULTS
|
80
|
-
+-------------+---------------------------+
|
81
|
-
| start_time | 2020-10-10 12:37:54 +0100 |
|
82
|
-
| finish_time | 2020-10-10 12:37:54 +0100 |
|
83
|
-
| duration | 0.002054143 |
|
84
|
-
+-------------+---------------------------+
|
85
67
|
```
|
86
68
|
|
87
69
|
## Results
|
88
70
|
|
89
|
-
Output reports are saved into `var/
|
71
|
+
Output reports are saved into `var/02-config/` directory. Detail output report is created for every case.
|
90
72
|
|
91
73
|
```
|
92
|
-
var/
|
74
|
+
var/02-config
|
93
75
|
├── case-01.txt
|
94
76
|
├── case-02.txt
|
95
77
|
├── moodle.csv
|
@@ -99,23 +81,22 @@ var/learn-02-config
|
|
99
81
|
Let's see `export` keyword output for case 01.
|
100
82
|
|
101
83
|
```
|
102
|
-
> more var/
|
84
|
+
> more var/02-config/case-01.txt
|
103
85
|
CONFIGURATION
|
104
|
-
|
105
|
-
| tt_members | Student-name-1
|
106
|
-
| tt_sequence | false
|
107
|
-
| tt_skip | false
|
108
|
-
| tt_testname |
|
109
|
-
| username | root
|
110
|
-
|
111
|
-
|
86
|
+
+-------------+----------------+
|
87
|
+
| tt_members | Student-name-1 |
|
88
|
+
| tt_sequence | false |
|
89
|
+
| tt_skip | false |
|
90
|
+
| tt_testname | 02-config |
|
91
|
+
| username | root |
|
92
|
+
+-------------+----------------+
|
112
93
|
|
113
94
|
GROUPS
|
114
95
|
- Reading params from config file
|
115
96
|
01 (1.0/1.0)
|
116
|
-
Description : Create user root
|
97
|
+
Description : Create user root
|
117
98
|
Command : id root
|
118
|
-
Duration : 0.
|
99
|
+
Duration : 0.002 (local)
|
119
100
|
Alterations : find(root) & count
|
120
101
|
Expected : Greater than 0 (String)
|
121
102
|
Result : 1 (Integer)
|
@@ -123,9 +104,9 @@ GROUPS
|
|
123
104
|
RESULTS
|
124
105
|
+--------------+---------------------------+
|
125
106
|
| case_id | 01 |
|
126
|
-
| start_time |
|
127
|
-
| finish_time |
|
128
|
-
| duration | 0.
|
107
|
+
| start_time | 2022-12-24 13:33:49 +0000 |
|
108
|
+
| finish_time | 2022-12-24 13:33:49 +0000 |
|
109
|
+
| duration | 0.001777756 |
|
129
110
|
| unique_fault | 0 |
|
130
111
|
| max_weight | 1.0 |
|
131
112
|
| good_weight | 1.0 |
|
@@ -134,5 +115,3 @@ RESULTS
|
|
134
115
|
| grade | 100 |
|
135
116
|
+--------------+---------------------------+
|
136
117
|
```
|
137
|
-
|
138
|
-
> **How to choose another config file?** Read this [document](../commands/example_run.md#3-choosing-config-file).
|
@@ -81,11 +81,30 @@ end
|
|
81
81
|
|
82
82
|
* `send copy_to: :host1` keyword copy output report into remote machine (host1).
|
83
83
|
|
84
|
+
## Screen output
|
85
|
+
|
86
|
+
```
|
87
|
+
CASE RESULTS
|
88
|
+
+------+---------------+-------+-------+
|
89
|
+
| CASE | MEMBERS | GRADE | STATE |
|
90
|
+
| 01 | Darth Maul | 0.0 | ? |
|
91
|
+
| - | - | 0.0 | |
|
92
|
+
| 03 | Obiwan Kenobi | 0.0 | ? |
|
93
|
+
+------+---------------+-------+-------+
|
94
|
+
|
95
|
+
CONN ERRORS
|
96
|
+
+------+---------------+-------+------------------+
|
97
|
+
| CASE | MEMBERS | HOST | ERROR |
|
98
|
+
| 01 | Darth Maul | host1 | host_unreachable |
|
99
|
+
| 03 | Obiwan Kenobi | host1 | host_unreachable |
|
100
|
+
+------+---------------+-------+------------------+
|
101
|
+
```
|
102
|
+
|
84
103
|
## Results
|
85
104
|
|
86
105
|
```
|
87
106
|
var
|
88
|
-
└──
|
107
|
+
└── 03-remote-hosts
|
89
108
|
├── case-01.json
|
90
109
|
├── case-01.txt
|
91
110
|
├── case-03.json
|
data/docs/learn/04-new_test.md
CHANGED
@@ -13,8 +13,8 @@ Steps:
|
|
13
13
|
|
14
14
|
Create skeleton for a new project: `teuton create foo`
|
15
15
|
|
16
|
-
```
|
17
|
-
|
16
|
+
```
|
17
|
+
> teuton new foo
|
18
18
|
|
19
19
|
[INFO] Creating foo project skeleton
|
20
20
|
* Create dir => foo
|
@@ -22,7 +22,7 @@ $ teuton new foo
|
|
22
22
|
* Create file => foo/start.rb
|
23
23
|
```
|
24
24
|
|
25
|
-
> It
|
25
|
+
> NOTA: It is posible to create these files by hand.
|
26
26
|
|
27
27
|
This command will create:
|
28
28
|
|
@@ -81,7 +81,7 @@ Use a YAML file (`foo/config.yaml`) or JSON for your own configurations. In this
|
|
81
81
|
Now we only have to run the challenge:
|
82
82
|
|
83
83
|
```bash
|
84
|
-
|
84
|
+
> teuton run foo
|
85
85
|
```
|
86
86
|
|
87
87
|
Output files are saved into `var/foo` directory.
|
data/docs/learn/05-use.md
CHANGED
@@ -16,8 +16,9 @@ Learn how to:
|
|
16
16
|
This example has more files:
|
17
17
|
|
18
18
|
```bash
|
19
|
-
|
20
|
-
|
19
|
+
> tree example/04-use
|
20
|
+
|
21
|
+
example/04-require
|
21
22
|
├── config.yaml
|
22
23
|
├── network.rb
|
23
24
|
├── README.md
|
@@ -25,8 +26,6 @@ example/learn-04-require
|
|
25
26
|
└── users.rb
|
26
27
|
```
|
27
28
|
|
28
|
-
* `README.md` and `config.yaml` are the same as previous example.
|
29
|
-
|
30
29
|
## Execution section
|
31
30
|
|
32
31
|
Previous `start.rb` file is now splited in: start.rb, users.rb and network.rb.
|
data/docs/learn/06-debug.md
CHANGED
@@ -14,8 +14,9 @@ Learn how to:
|
|
14
14
|
|
15
15
|
## Tree directory
|
16
16
|
|
17
|
-
```
|
18
|
-
|
17
|
+
```
|
18
|
+
> tree learn/learn-06-debug
|
19
|
+
|
19
20
|
example/learn-06-debug
|
20
21
|
├── config.yaml
|
21
22
|
├── external.rb
|
@@ -48,12 +49,7 @@ When this happend, sometimes we need to verify or check rb file consistency and
|
|
48
49
|
|
49
50
|
Let's see example `teuton check examples/learn-01-target`:
|
50
51
|
|
51
|
-
```
|
52
|
-
[INFO] ScriptPath => examples/learn-01-target/start.rb
|
53
|
-
[INFO] ConfigPath => examples/learn-01-target/config.yaml
|
54
|
-
[INFO] Pwd => /mnt/home/leap/proy/repos/teuton.d/teuton
|
55
|
-
[INFO] TestName => learn-01-target
|
56
|
-
|
52
|
+
```
|
57
53
|
+----------------------------+
|
58
54
|
| GROUP: Learn about targets |
|
59
55
|
+----------------------------+
|
@@ -78,12 +74,13 @@ Let's see example `teuton check examples/learn-01-target`:
|
|
78
74
|
+----------------------+
|
79
75
|
| Revising CONFIG file |
|
80
76
|
+----------------------+
|
81
|
-
[WARN] File
|
77
|
+
[WARN] File /home/david/proy/repos/teuton.d/teuton/examples/01-target/config.yaml not found!
|
82
78
|
[INFO] Recomended content:
|
83
79
|
---
|
84
80
|
:global:
|
85
81
|
:cases:
|
86
82
|
- :tt_members: VALUE
|
83
|
+
|
87
84
|
```
|
88
85
|
|
89
86
|
In this case, Teuton detects that there isn't exist config file, and propose us content for `config.yaml`.
|
data/docs/learn/07-log.md
CHANGED
@@ -27,27 +27,27 @@ end
|
|
27
27
|
|
28
28
|
## Result
|
29
29
|
|
30
|
-
**Let's see example**: Content of `var/
|
30
|
+
**Let's see example**: Content of `var/07-log/case-01.txt` file.
|
31
31
|
|
32
|
-
```
|
32
|
+
```
|
33
33
|
CONFIGURATION
|
34
|
-
|
35
|
-
| tt_members | anonymous
|
36
|
-
| tt_sequence | false
|
37
|
-
| tt_skip | false
|
38
|
-
| tt_testname |
|
39
|
-
|
34
|
+
+-------------+-----------+
|
35
|
+
| tt_members | anonymous |
|
36
|
+
| tt_sequence | false |
|
37
|
+
| tt_skip | false |
|
38
|
+
| tt_testname | 07-log |
|
39
|
+
+-------------+-----------+
|
40
40
|
|
41
41
|
LOGS
|
42
|
-
[
|
43
|
-
[
|
42
|
+
[13:45:02] : Using log messages...
|
43
|
+
[13:45:02] ERROR: Problem detected!
|
44
44
|
|
45
45
|
GROUPS
|
46
46
|
- Learning about log messages
|
47
47
|
01 (1.0/1.0)
|
48
48
|
Description : Create user david
|
49
49
|
Command : id david
|
50
|
-
Duration : 0.
|
50
|
+
Duration : 0.002 (local)
|
51
51
|
Alterations : find(david) & count
|
52
52
|
Expected : Greater than 0 (String)
|
53
53
|
Result : 1 (Integer)
|
@@ -55,9 +55,9 @@ GROUPS
|
|
55
55
|
RESULTS
|
56
56
|
+--------------+---------------------------+
|
57
57
|
| case_id | 01 |
|
58
|
-
| start_time |
|
59
|
-
| finish_time |
|
60
|
-
| duration | 0.
|
58
|
+
| start_time | 2022-12-24 13:45:02 +0000 |
|
59
|
+
| finish_time | 2022-12-24 13:45:02 +0000 |
|
60
|
+
| duration | 0.001900685 |
|
61
61
|
| unique_fault | 0 |
|
62
62
|
| max_weight | 1.0 |
|
63
63
|
| good_weight | 1.0 |
|
data/docs/learn/08-readme.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[<< back](README.md)
|
2
2
|
|
3
|
-
# Example:
|
3
|
+
# Example: readme
|
4
4
|
|
5
5
|
Create README files (with test instructions) from our test definition.
|
6
6
|
|
@@ -35,15 +35,15 @@ There exists some `readme` instructions after `group` and `target` lines.
|
|
35
35
|
To generate automatically a README file from previous test, execute this:
|
36
36
|
|
37
37
|
```
|
38
|
-
teuton readme example/
|
38
|
+
teuton readme example/08-readme > example/08-readme/README.md
|
39
39
|
```
|
40
40
|
|
41
41
|
## Result
|
42
42
|
|
43
|
-
**Let's see the output**: Content of `example/
|
43
|
+
**Let's see the output**: Content of `example/08-readme/README.md` file.
|
44
44
|
|
45
45
|
---
|
46
|
-
#
|
46
|
+
# 08-readme
|
47
47
|
|
48
48
|
## Customize readme output
|
49
49
|
|
data/docs/learn/09-preserve.md
CHANGED
data/docs/learn/13-include.md
CHANGED
@@ -2,13 +2,17 @@
|
|
2
2
|
|
3
3
|
# Example: 13-include
|
4
4
|
|
5
|
-
|
5
|
+
Use `tt-include` to include several config files into your main config file.
|
6
|
+
|
7
|
+
## Explanation
|
8
|
+
|
9
|
+
Until now, all the examples we have seen use one configuration file (`config.yaml`) that contain all the parameters required by the test. It is possible to save configuration distributed among several files.
|
6
10
|
|
7
11
|
Suppose we have the following file structure.
|
8
12
|
|
9
13
|
```
|
10
14
|
├── config.yaml
|
11
|
-
├──
|
15
|
+
├── moreconfigfiles
|
12
16
|
│ ├── 02
|
13
17
|
│ │ └── file02.yaml
|
14
18
|
│ ├── file01.yaml
|
@@ -16,15 +20,15 @@ Suppose we have the following file structure.
|
|
16
20
|
└── start.rb
|
17
21
|
```
|
18
22
|
|
19
|
-
`config.yaml` will be the main config file.
|
23
|
+
`config.yaml` will be the main config file. We have defined `tt_include` parameter with a folder wich contains more configuration files.
|
20
24
|
|
21
|
-
In this example the contents of
|
25
|
+
In this example the contents of all files in `moreconfigfiles` folder will be included when reading the config parameters:
|
22
26
|
|
23
27
|
```yaml
|
24
28
|
---
|
25
29
|
# Fiel: config.yaml
|
26
30
|
:global:
|
27
|
-
:tt_include:
|
31
|
+
:tt_include: moreconfigfiles
|
28
32
|
:cases:
|
29
33
|
```
|
30
34
|
|
@@ -41,19 +45,22 @@ CASE RESULTS
|
|
41
45
|
+------+---------+-------+-------+
|
42
46
|
```
|
43
47
|
|
44
|
-
Config files into `
|
48
|
+
Config files into `moreconfigfiles` folder:
|
45
49
|
|
46
50
|
```yaml
|
51
|
+
# moreconfigfiles/file01.yaml
|
47
52
|
:tt_members: file01
|
48
53
|
:username: root
|
49
54
|
```
|
50
55
|
|
51
56
|
```yaml
|
57
|
+
# moreconfigfiles/02/file02.yaml
|
52
58
|
:tt_members: file02
|
53
59
|
:username: quigon
|
54
60
|
```
|
55
61
|
|
56
62
|
```yaml
|
63
|
+
# moreconfigfiles/file03.yml
|
57
64
|
:tt_members: file03
|
58
65
|
:username: vader
|
59
66
|
```
|
data/docs/learn/14-alias.md
CHANGED
@@ -2,7 +2,11 @@
|
|
2
2
|
|
3
3
|
# Example: 14-alias
|
4
4
|
|
5
|
-
|
5
|
+
By using aliases we can adapt a configuration file, so that it can be used with many different tests.
|
6
|
+
|
7
|
+
## Exanation
|
8
|
+
|
9
|
+
Suppose we have a test like the following:
|
6
10
|
|
7
11
|
```ruby
|
8
12
|
group "Using alias" do
|
@@ -16,14 +20,14 @@ group "Using alias" do
|
|
16
20
|
end
|
17
21
|
```
|
18
22
|
|
19
|
-
|
23
|
+
> REMEMBER:
|
24
|
+
> * We only have 2 targets but we could have many more.
|
25
|
+
> * `_username` is equivalent to `get(:username)`
|
20
26
|
|
21
|
-
|
22
|
-
|
23
|
-
Sabemos que el fichero de configuración debe definir los valores para los parámetros `super` y `username`. Queremos aprovechar un fichero de configuración que ya teníamos de otro test, pero tiene el siguiente contenido:
|
27
|
+
Our test requires the `super` parameter but the configuration file has named it as `superuser`. Our configuration file define values for `supername` and `username` parameters. Let's see:
|
24
28
|
|
25
29
|
```yaml
|
26
|
-
#
|
30
|
+
# First version
|
27
31
|
# File: config.yaml
|
28
32
|
global:
|
29
33
|
cases:
|
@@ -32,10 +36,10 @@ cases:
|
|
32
36
|
username: obiwan
|
33
37
|
```
|
34
38
|
|
35
|
-
|
39
|
+
We would like to take advantage of a configuration file that we already had from another test, without big changes. So we add an `alias`:
|
36
40
|
|
37
41
|
```yaml
|
38
|
-
# Version
|
42
|
+
# Alias Version
|
39
43
|
# File: config.yaml
|
40
44
|
alias:
|
41
45
|
super: :superuser
|
@@ -45,3 +49,5 @@ cases:
|
|
45
49
|
superuser: root
|
46
50
|
username: obiwan
|
47
51
|
```
|
52
|
+
|
53
|
+
Now our test will work correctly. Calling `get(:super)` will return the same value as doing `get(:superuser).
|
@@ -0,0 +1,52 @@
|
|
1
|
+
[<< back](README.md)
|
2
|
+
|
3
|
+
# Example: 17-hide-feedback
|
4
|
+
|
5
|
+
When exporting with `feedback: false` option we hide some items from exported reports. Hiden items: command, alterations, expected and result.
|
6
|
+
|
7
|
+
> More information about [export](../dsl/execution/export.md) keyword.
|
8
|
+
|
9
|
+
## Explanation
|
10
|
+
|
11
|
+
Every time teuton is run, all cases are evaluated and when exporting the results, by default, all the information collected during the evaluation process is logged.
|
12
|
+
|
13
|
+
Each "target" contains the following fields:
|
14
|
+
|
15
|
+
* Identification: id, description
|
16
|
+
* Evaluation result: check(true/false)
|
17
|
+
* Punctuation: score, weight
|
18
|
+
* Check process: conn_type, command, duration, alterations, expected, result
|
19
|
+
|
20
|
+
Some of these fields should always be visible, such as: id, description, check, score, and weight. And others, more related to the process that perform teuton for verification can be hidden using the "feedback: false" parameter.
|
21
|
+
|
22
|
+
With "feedback: false" the fields are hidden: command, alterations, expected and result.
|
23
|
+
Más información sobre este texto de origen
|
24
|
+
Para obtener más información sobre la traducción, se necesita el texto de origen
|
25
|
+
Enviar comentarios
|
26
|
+
Paneles laterales
|
27
|
+
|
28
|
+
## Execution section
|
29
|
+
|
30
|
+
Take a look at our test execution section (Play):
|
31
|
+
```ruby
|
32
|
+
play do
|
33
|
+
show
|
34
|
+
export feedback: false
|
35
|
+
end
|
36
|
+
```
|
37
|
+
|
38
|
+
## Result
|
39
|
+
|
40
|
+
Executing `teuton run example/17-hide-feedback`:
|
41
|
+
|
42
|
+
```
|
43
|
+
GROUPS
|
44
|
+
- Hide feedback from reports
|
45
|
+
01 (1.0/1.0)
|
46
|
+
Description : Exits user root
|
47
|
+
Command : *******
|
48
|
+
Duration : 0.002 (local)
|
49
|
+
Alterations : ******************
|
50
|
+
Expected : ************** (String)
|
51
|
+
Result : * (Integer)
|
52
|
+
```
|
data/docs/learn/README.md
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
|
2
2
|
[<< back](../../README.md)
|
3
3
|
|
4
|
-
|
5
|
-
2. [Examples](#examples)
|
6
|
-
3. [Videos](#videos)
|
4
|
+
# Learn
|
7
5
|
|
8
|
-
|
6
|
+
Learn how write your own Teuton tests:
|
9
7
|
|
10
|
-
Learn how to use Teuton language to write your own tests:
|
11
8
|
- [01 - Target](01-target.md)
|
12
9
|
- [02 - Config file](02-config.md)
|
13
10
|
- [03 - Remote hosts](03-remote_hosts.md)
|
@@ -21,17 +18,12 @@ Learn how to use Teuton language to write your own tests:
|
|
21
18
|
- [11 - Moodle ID](11-moodle_id.md)
|
22
19
|
- [12 - Get vars](12-get_vars.md)
|
23
20
|
- [13 - Include](13-include.md)
|
24
|
-
-
|
25
|
-
-
|
26
|
-
- [
|
27
|
-
- [
|
21
|
+
- [14 - Alias](14-alias.md)
|
22
|
+
- 15 - Macros
|
23
|
+
- [16 - Exit codes](16-exit_codes.md)
|
24
|
+
- [17 - Hide feedback](17-hide-feedback.md)
|
28
25
|
|
29
|
-
|
30
|
-
|
31
|
-
More examples
|
32
|
-
* Let's see examples at [teuton-tests](https://github.com/dvarrui/teuton-tests) GitHub repository.
|
33
|
-
* Ask us by email at `teuton.software@protonmail.com` or Twitter at `@SoftwareTeuton`.
|
34
|
-
* [ES - CHAPI19: Teuton demo](https://github.com/dvarrui/proyectos-de-ejemplo/tree/master/charlas/teuton)
|
26
|
+
Mores examples at [teuton-tests](https://github.com/dvarrui/teuton-tests) GitHub repository.
|
35
27
|
|
36
28
|
# Videos
|
37
29
|
|
@@ -40,6 +32,7 @@ But if you want to see Spanish videos, here you are:
|
|
40
32
|
|
41
33
|
Teuton (v2.0):
|
42
34
|
* [ES - CHAPI19: Charla Teuton](https://youtu.be/KFWQDfNAFxI?t=12221)
|
35
|
+
* [ES - CHAPI19: Teuton demo](https://github.com/dvarrui/proyectos-de-ejemplo/tree/master/charlas/teuton)
|
43
36
|
|
44
37
|
Sysadmingame (Teuton v1.0)
|
45
38
|
* [Sysadmingame (1 de 3): Instalación del programa](https://youtu.be/dnyMq9_KDco)
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative "../../application"
|
4
4
|
require_relative "../../report/report"
|
5
|
+
require_relative "../../report/show"
|
5
6
|
require_relative "../utils"
|
6
7
|
require_relative "main"
|
7
8
|
require_relative "result/result"
|
@@ -17,7 +18,6 @@ require_relative "builtin/main"
|
|
17
18
|
# * grade
|
18
19
|
# * members
|
19
20
|
# * skip
|
20
|
-
# * show
|
21
21
|
# * read_filename ???
|
22
22
|
class Case
|
23
23
|
include DSL
|
@@ -42,6 +42,7 @@ class Case
|
|
42
42
|
|
43
43
|
# Define Case Report
|
44
44
|
@report = Report.new(@id)
|
45
|
+
# TODO: Move folder creation from case to parent classes?
|
45
46
|
@report.output_dir = File.join("var", @config.global[:tt_testname])
|
46
47
|
ensure_dir @report.output_dir
|
47
48
|
|
@@ -100,10 +101,6 @@ class Case
|
|
100
101
|
|
101
102
|
alias skip? skip
|
102
103
|
|
103
|
-
def show
|
104
|
-
@report.show
|
105
|
-
end
|
106
|
-
|
107
104
|
private
|
108
105
|
|
109
106
|
def read_filename(filename)
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "colorize"
|
4
|
-
|
5
3
|
module DSL
|
6
4
|
# expect <condition>, :weight => <value>
|
7
5
|
def expect(input, args = {})
|
@@ -10,7 +8,7 @@ module DSL
|
|
10
8
|
elsif input.instance_of?(String) || input.instance_of?(Regexp) || input.instance_of?(Array)
|
11
9
|
expect_any input
|
12
10
|
else
|
13
|
-
puts "[TypeError] expect #{input} (#{input.class})"
|
11
|
+
puts Rainbow("[TypeError] expect #{input} (#{input.class})").red
|
14
12
|
end
|
15
13
|
end
|
16
14
|
|
@@ -30,7 +28,7 @@ module DSL
|
|
30
28
|
app = Application.instance
|
31
29
|
c = app.letter[:bad]
|
32
30
|
c = app.letter[:good] if cond
|
33
|
-
verbose c.
|
31
|
+
verbose Rainbow(c).green
|
34
32
|
end
|
35
33
|
|
36
34
|
def expect_any(input, args = {})
|
@@ -37,9 +37,11 @@ module DSL
|
|
37
37
|
Net::SFTP.start(ip, username, password: password, port: port) do |sftp|
|
38
38
|
sftp.upload!(localfilepath, remotefilepath)
|
39
39
|
end
|
40
|
-
|
40
|
+
msg = Rainbow("==> File '#{remotefilepath}' of '#{get(:tt_members)}' has been copied").green
|
41
|
+
verboseln(msg)
|
41
42
|
rescue
|
42
|
-
|
43
|
+
msg = Rainbow("==> [FAIL] #{get(:tt_members)}: 'scp #{localfilepath}' to #{remotefilepath}").red
|
44
|
+
verboseln(msg)
|
43
45
|
end
|
44
46
|
end
|
45
47
|
|