teuton 2.10.6 → 2.10.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9a1b6762cc25c63b89aaa6e2d1fa0a245a3451a9aad17c142d1577db0686df8
4
- data.tar.gz: af350833b0f89946123adc26f35aedaab554e44953ea50a21bb2fdb2c8d4e4be
3
+ metadata.gz: 631f4c00542468fa42a36a38c017dc0a5e122fa4d0b1445dd0872ada4e5becdc
4
+ data.tar.gz: a01194deda208794fafcc3337f762584c36fd492fa9a5fd295240e5f5c9773c8
5
5
  SHA512:
6
- metadata.gz: 31109462bb8cb4cae1cdacfcde8d396393a64a08cc37c44fb7926475b2379ae1cde1acdcb17c671ebd7b332b9ce15737f5f31b5b707d68f02fd1837b00df6545
7
- data.tar.gz: 228d4bfbce686c1a2dafcd0edbcb40f375dd69e1cfd8b49db3523e36a4de5db92a5dbc6e949f62b593e3cd0223d1dbc1371f2d9d5d75f49264af02bf40e35de9
6
+ metadata.gz: f8ec0d2672650d1b2d422f667dde1eed7e81f65133406d58d2ccc607c9ee8db7451e426a61e792f897f138815ecf37c4e6e0baf416e44fd677baa58003940376
7
+ data.tar.gz: 76052c9435bad56f8de1822d48491854bf597c3823a0ce056a1f6c0eeafdbf7b16b37ec12737a600eaf9f051e684f0878cbcfd94b2c00cd8e0d67ab9d6e0c76c
@@ -39,7 +39,7 @@ Example:
39
39
  ```console
40
40
  $ teuton new foo
41
41
 
42
- [INFO] Creating foo project skeleton
42
+ Creating foo project
43
43
  * Create dir => foo
44
44
  * Create file => foo/config.yaml
45
45
  * Create file => foo/start.rb
@@ -74,7 +74,7 @@ Alias: `teuton c foo`, `teuton -c foo`, `teuton --check foo`
74
74
 
75
75
  # 5. Run test
76
76
 
77
- Read about [how to run tests](howto-run-tests.md)
77
+ Read about [how to run tests](run-tests.md)
78
78
 
79
79
  # 6. Show test info as README file
80
80
 
@@ -13,7 +13,7 @@ Usage: `teuton check PATH-TO-TEST-FOLDER`
13
13
 
14
14
  Example:
15
15
 
16
- ```bash
16
+ ```
17
17
  $ teuton check examples/02-target
18
18
 
19
19
  +----------------------------+
@@ -17,7 +17,7 @@ Alias: `teuton foo`
17
17
 
18
18
  Running Teuton test located into `example/01-target` folder.
19
19
 
20
- ```bash
20
+ ```
21
21
  $ teuton run example/01-target
22
22
 
23
23
  ------------------------------------
@@ -56,37 +56,39 @@ Options:
56
56
  | -- | -------------------- | ------------ |
57
57
  | 01 | teuton foo | Run foo/start.rb, with config file foo/config.yaml |
58
58
  | 02 | teuton run foo | Run foo/start.rb, with config file foo/config.yaml |
59
- | 03 | ruby teuton foo | Same as 01 on Windows OS |
60
- | 04 | ruby teuton run foo | Same as 02 on WIndows OS |
61
- | 05 | teuton . | Run ./start.rb with ./config.yaml file |
62
- | 06 | teuton run --export=json foo | Run foo/start.rb and force json format during exporting. Others output formats availables are: txt, colored_text, json, yaml |
63
- | 07 | teuton run --cname=rock foo | Run foo/start.rb with foo/rock.yaml config file |
64
- | 08 | teuton foo/demo42.rb | Run foo/demo42.rb with foo/demo42.yaml config file |
65
- | 08 | teuton run --cpath=starwars/jedi.yaml foo | Run foo/start.rb with starwars/jedi.yaml config file |
66
- | 09 | teuton run --case=6,16 foo | Run foo/start.rb with foo/config.yaml config file but only for case id '06' and '16' |
59
+ | 03 | teuton . | Run ./start.rb with ./config.yaml file |
60
+ | 04 | teuton run --export=json foo | Run foo/start.rb and force json format during exporting |
61
+ | 05 | teuton run --cname=rock foo | Run foo/start.rb with foo/rock.yaml config file |
62
+ | 06 | teuton foo/demo42.rb | Run foo/demo42.rb with foo/demo42.yaml config file |
63
+ | 07 | teuton run --cpath=starwars/jedi.yaml foo | Run foo/start.rb with starwars/jedi.yaml config file |
64
+ | 08 | teuton run --case=6,16 foo | Run foo/start.rb with foo/config.yaml config file but only for case id '06' and '16' |
67
65
 
68
66
  # 3. Choosing config file
69
67
 
70
- **Default names:**:
68
+ ## 3.1 Default file names
69
+
71
70
  By default, when you run `teuton run foo`, this will search for:
72
71
  * `foo/start.rb` test file and
73
72
  * `foo/config.yaml` config file.
74
73
 
75
- **Using cname param:**
74
+ ## 3.2 Using `cname` option
75
+
76
76
  It's posible execute `teuton run --cname=rock foo`, and choose diferent config file into projet folder:
77
77
  * `foo/start.rb` test file and
78
78
  * `foo/rock.yaml` config file.
79
79
 
80
80
  > `cname` param searchs YAML config file into the same project folder.
81
81
 
82
- **Using cpath param:**
83
- An also, it's posible execute `teuton run --cpath=/home/david/startwars.yaml foo`, and choose config file using its absolute path:
82
+ ## 3.3 Using `cpath` option
83
+
84
+ An also, it's posible execute `teuton run --cpath=/home/obiwan/startwars.yaml foo`, and choose config file using its absolute path:
84
85
  * `foo/start.rb` test file and
85
- * `/home/david/starwars.yaml` config file.
86
+ * `/home/obiwan/starwars.yaml` config file.
86
87
 
87
88
  > `cpath` param selects YAML config file, from the specified path.
88
89
 
89
- **Using diferent main rb name:**
90
+ ## 3.4 Using diferent main rb name
91
+
90
92
  When you execute `teuton run foo/mazingerz.rb`, this will search for:
91
93
  * `foo/mazingerz.rb` test file and
92
94
  * `foo/mazingerz.yaml` config file.
data/docs/dsl/export.md CHANGED
@@ -2,20 +2,16 @@
2
2
 
3
3
  # export
4
4
 
5
- Create reports and save then into `var/TEST-NAME` folder.
6
-
7
- ## Example
8
-
9
- Run export and build reports using txt output format by default:
5
+ Create output reports into `var/TESTNAME` folder.
10
6
 
7
+ **Example 1**: Run export and build reports using default format (`txt`).
11
8
  ```ruby
12
9
  play do
13
10
  export
14
11
  end
15
12
  ```
16
13
 
17
- Run test and build reports using `html` output format:
18
-
14
+ **Example 2**: Run test and build reports using `html` format.
19
15
  ```ruby
20
16
  play do
21
17
  export format: 'html'
@@ -26,9 +22,9 @@ end
26
22
 
27
23
  | Option | Values | Description |
28
24
  | ------ | ------ | ----------- |
29
- | format | **txt** (default), html, yaml, json, colored_text (txt with colors) |Output file format |
30
- | preserve | **false** (default), true | Keep report old copies |
31
- | feedback | **true** (default), false | Hide some fields from reports |
25
+ | format | **txt** (default), html, yaml, json, markdown, colored_text (txt with colors) |Output file format |
26
+ | preserve | **false** (default), true | Keep old report copies |
27
+ | feedback | **true** (default), false | Hide feedback information from reports |
32
28
 
33
29
  ## Usage
34
30
 
data/docs/dsl/get.md CHANGED
@@ -2,15 +2,11 @@
2
2
 
3
3
  # get
4
4
 
5
- `get` reads param value from configuration file.
5
+ `get(PARAM)` keyword reads param value from configuration file.
6
6
 
7
- ```ruby
8
- get(PARAM)
9
- ```
10
-
11
- ## Example
7
+ ## Example 1: reading params
12
8
 
13
- **Reading Example**. Suppose we have this `config.yaml` content:
9
+ Suppose we have this `config.yaml` content:
14
10
 
15
11
  ```yaml
16
12
  ---
@@ -28,19 +24,23 @@ Supossing we are **case 01**, then:
28
24
  * `get(:username)` returns `obiwan`.
29
25
  * `get(:host1_username)`, returns `root`.
30
26
 
31
- **Writting example**: We also can create new temporal params:
27
+ ## Example 2: writting and reading params
28
+
29
+ We also can create new temporal params:
32
30
 
33
31
  ```ruby
34
32
  set(:name, "Obiwan")
35
- var = get(:name)
33
+ jediname = get(:name)
36
34
  ```
37
35
 
38
- So `var` value is "Obiwan".
36
+ So `jediname` value is "Obiwan".
37
+
38
+ ## Example 3: reading alias
39
39
 
40
- **Simpler reading example**: Other ways or reading param values:
40
+ Other ways or reading param values:
41
41
 
42
42
  ```ruby
43
- var = _name
43
+ jediname = _name
44
44
  ```
45
45
 
46
- So `var` value is "Obiwan" too. `_name` is an alias of `get(:name)`.
46
+ So `jediname` value is "Obiwan" too. `_name` is an alias of `get(:name)`.
data/docs/dsl/group.md CHANGED
@@ -4,12 +4,14 @@
4
4
 
5
5
  Groups targets.
6
6
 
7
+ ## Example
8
+
7
9
  ```ruby
8
10
  group "Group name" do
9
11
  ...
10
12
  end
11
13
  ```
12
14
 
13
- * Define a group of targets or goal. These are groups of objectives to be evaluated.
15
+ * Define a group of targets. These are groups of objectives to be evaluated.
14
16
  * At least you must define one `group`, where you can define all your targets.
15
17
  * We can use `group`, as many times as we need. Usefull to group related objectives.
data/docs/dsl/send.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  `send` is used to copy Teuton reports into remote machines.
6
6
 
7
+ Usage:
7
8
  ```ruby
8
9
  start do
9
10
  export
@@ -11,9 +12,9 @@ start do
11
12
  end
12
13
  ```
13
14
 
14
- * `send` instruction must be execute after `export`. Reports must be generated before send them, of course.
15
+ * `send` instruction must be execute after `export`, because report files must be generated before send them.
15
16
  * `host1`, label that identify remote host. This information must be configured into config file.
16
- * `send copy_to: :host1`, copy every case resport file into temp directory on remote host `host1`.
17
+ * `send copy_to: :host1`, by default, the home folder of the user `host1_username` is used to copy report on the remote host (`host1_ip`).
17
18
 
18
19
  ## Options
19
20
 
@@ -50,9 +51,9 @@ start do
50
51
  end
51
52
  ```
52
53
 
53
- ## Example: Using "dir" options
54
+ ## Example: Change remote dir using "dir" options
54
55
 
55
- Example 1: send `case-01-txt` file to default folder of remote remote host.
56
+ This example sends `case-01-txt` file to default folder of remote host.
56
57
 
57
58
  ```ruby
58
59
  play do
@@ -62,11 +63,9 @@ play do
62
63
  end
63
64
  ```
64
65
 
65
- Result:
66
-
67
66
  ![](images/send-remote-dir-dot2.jpg)
68
67
 
69
- Example 2: send report file to "./Desktop" folder of remote host.
68
+ Using `dir: "./Desktop"`, report files will be sent to remote host "./Desktop" folder.
70
69
 
71
70
  ```ruby
72
71
  play do
@@ -1,20 +1,22 @@
1
1
 
2
2
  [<< back](README.md)
3
3
 
4
- # new test
4
+ # New test
5
5
 
6
- Create skeleton for a new project: `teuton create foo`
6
+ `teuton create foo` is a command function that creates skeleton for a new project.
7
+
8
+ ## Example
7
9
 
8
10
  ```
9
- > teuton new foo
11
+ $ teuton new foo
10
12
 
11
- [INFO] Creating foo project skeleton
13
+ Creating foo project
12
14
  * Create dir => foo
13
15
  * Create file => foo/config.yaml
14
16
  * Create file => foo/start.rb
15
17
  ```
16
18
 
17
- > NOTA: It is posible to create these files by hand.
19
+ Read about [teuton create](../commands/README.md)
18
20
 
19
21
  This command will create:
20
22
 
@@ -24,5 +26,4 @@ This command will create:
24
26
  | foo/start.rb | Main Script |
25
27
  | foo/config.yaml | YAML configuration file |
26
28
 
27
-
28
- Now it is time to customize your targets.
29
+ The next step is to personalize your targets.
@@ -1,6 +1,6 @@
1
1
  [<< back](README.md)
2
2
 
3
- # target
3
+ # Target
4
4
 
5
5
  A [target](../dsl/target.md) is a feature you want to check. Targets are defined into `group` sections.
6
6
 
@@ -8,7 +8,7 @@ A [target](../dsl/target.md) is a feature you want to check. Targets are defined
8
8
 
9
9
  Every evaluation has 3 parts:
10
10
  * [target](dsl/target.md): Description of the element to be tested.
11
- * [run](../dsl/run.md): Execute a command `id obiwan` on localhost.
11
+ * [run](../dsl/run.md): Execute a command on local or remote host.
12
12
  * [expect](../dsl/expect.md): Verify that the result contains expected value.
13
13
 
14
14
  ```ruby
@@ -24,24 +24,23 @@ group "Learn about targets" do
24
24
  end
25
25
  ```
26
26
 
27
- > In this example, our localhost's OS is GNU/Linux (or any other compatible OS) because the command executed is `id obiwan`.
27
+ > In this example, our localhost's OS is GNU/Linux (or any other compatible OS), so the command executed is `id obiwan`.
28
28
 
29
29
  When the user exists, we expect this words: `uid=, (obiwan), gid=`.
30
30
 
31
31
  ```
32
- > id obiwan
32
+ $ id obiwan
33
33
  uid=1000(obiwan) gid=1000(obiwan) grupos=1000(obiwan)
34
34
  ```
35
35
 
36
36
  But when user does not exist, we expect command fail.
37
37
 
38
38
  ```
39
- > id vader
39
+ $ id vader
40
40
  id: «vader»: no such user
41
41
 
42
- > echo $?
42
+ >$ echo $?
43
43
  1
44
-
45
44
  ```
46
45
 
47
46
  ## Execution section
@@ -62,8 +61,8 @@ end
62
61
 
63
62
  Execute this command to run the test:
64
63
 
65
- ```console
66
- > teuton run examples/02-target
64
+ ```
65
+ $ teuton run examples/02-target
67
66
 
68
67
  CASE RESULTS
69
68
  +------+-----------+-------+-------+
@@ -74,7 +73,7 @@ CASE RESULTS
74
73
 
75
74
  Report files are created into `var/02-target/` folder:
76
75
 
77
- ```console
76
+ ```
78
77
  var
79
78
  └── 02-target
80
79
  ├── case-01.txt
@@ -85,7 +84,7 @@ var
85
84
  Let's see one report:
86
85
 
87
86
  ```
88
- cat var/02-target/case-01.txt
87
+ $ cat var/02-target/case-01.txt
89
88
  CONFIGURATION
90
89
  +-------------+-----------+
91
90
  | tt_members | anonymous |
@@ -94,7 +93,6 @@ CONFIGURATION
94
93
  | tt_testname | 02-target |
95
94
  +-------------+-----------+
96
95
 
97
-
98
96
  GROUPS
99
97
  - Learn about targets
100
98
  01 (0.0/1.0)
@@ -4,6 +4,8 @@
4
4
 
5
5
  To run test on remote host we have to define them into config file.
6
6
 
7
+ ## Example
8
+
7
9
  Let's see an example with:
8
10
  * 1 global param.
9
11
  * 3 cases with 3 params.
@@ -52,7 +54,7 @@ end
52
54
  Execution:
53
55
 
54
56
  ```
55
- > teuton run examples/03-remote_hosts
57
+ $ teuton run examples/03-remote_hosts
56
58
 
57
59
  CASE RESULTS
58
60
  +------+-----------+-------+-------+
@@ -70,12 +72,12 @@ CONN ERRORS
70
72
  +------+-----------+-------+------------------+
71
73
  ```
72
74
 
73
- Notice that case-03 is 100% and conection works. It is running on localhost because has localhost IP (127.0.0.1)
75
+ Notice that case-03 is 100% and conection works. It is running on localhost because has localhost IP (127.0.0.1).
74
76
 
75
77
  Results:
76
78
 
77
79
  ```
78
- tree var/03-remote_hosts
80
+ $ tree var/03-remote_hosts
79
81
 
80
82
  var/03-remote_hosts
81
83
  ├── case-01.txt
@@ -87,7 +89,7 @@ var/03-remote_hosts
87
89
 
88
90
  ## tt_skip param
89
91
 
90
- To disable a case, add skip param `tt_skip: true`.
91
- * `tt_skip` it is true by default.
92
+ To disable a case, add skip param to config file. Example: `tt_skip: true`.
93
+ * `tt_skip` it is false by default.
92
94
  * `tt_skip: false` ignore this case.
93
95
  * `tt_skip: true`, evaluate this case.
@@ -2,20 +2,20 @@
2
2
 
3
3
  # config
4
4
 
5
- _It's good idea save dinamic data into config file._
5
+ Our tests use config file to write dinamic data into separated file.
6
6
 
7
7
  By default, `config.yaml` is our config file. Example:
8
8
 
9
9
  ```yaml
10
10
  global:
11
11
  cases:
12
- - tt_members: name_student_1
12
+ - tt_members: student_1
13
13
  username: david
14
- - tt_members: name_student_2
14
+ - tt_members: student_2
15
15
  username: fran
16
16
  ```
17
17
 
18
- > **How to choose another config file?** Read this [document](../commands/example_run.md#3-choosing-config-file).
18
+ > **How to choose another config file?** Read this [document](../commands/run-test.md#3-choosing-config-file).
19
19
 
20
20
  By default, `start.rb` it's our main execution file. Example:
21
21
 
@@ -29,19 +29,19 @@ group "Reading params from config file" do
29
29
  end
30
30
  ```
31
31
 
32
- * [get](../dsl/get.md) keyword read params from configuration file. It's posible personalize tests with diferent values for every case.
32
+ * [get](../dsl/get.md) keyword read params values from configuration file. It's posible personalize tests with diferent values for every case.
33
33
 
34
34
  ## Example
35
35
 
36
- ```console
37
- > teuton run examples/04-config
36
+ ```
37
+ $ teuton run examples/04-config
38
38
 
39
39
  CASE RESULTS
40
- +------+----------------+-------+-------+
41
- | CASE | MEMBERS | GRADE | STATE |
42
- | 01 | name_student_1 | 100.0 | ✔ |
43
- | 02 | name_student_2 | 0.0 | ? |
44
- +------+----------------+-------+-------+
40
+ +------+-----------+-------+-------+
41
+ | CASE | MEMBERS | GRADE | STATE |
42
+ | 01 | student_1 | 100.0 | ✔ |
43
+ | 02 | student_2 | 0.0 | ? |
44
+ +------+-----------+-------+-------+
45
45
  ```
46
46
 
47
47
  Reports:
@@ -57,16 +57,16 @@ var/04-config
57
57
  Let's see case 01 report.
58
58
 
59
59
  ```
60
- > more var/04-config/case-01.txt
60
+ $ more var/04-config/case-01.txt
61
61
 
62
62
  CONFIGURATION
63
- +-------------+----------------+
64
- | tt_members | name_student_1 |
65
- | tt_sequence | false |
66
- | tt_skip | false |
67
- | tt_testname | 04-config |
68
- | username | david |
69
- +-------------+----------------+
63
+ +-------------+------------+
64
+ | tt_members | student_1 |
65
+ | tt_sequence | false |
66
+ | tt_skip | false |
67
+ | tt_testname | 04-config |
68
+ | username | david |
69
+ +-------------+------------+
70
70
 
71
71
  GROUPS
72
72
  - Reading params from config file
@@ -95,10 +95,10 @@ RESULTS
95
95
 
96
96
  ## Using differents configuration files
97
97
 
98
- Example with 3 config files (yaml files):
98
+ Example with 3 differents config files (yaml files):
99
99
 
100
100
  ```
101
- tree examples/04-config
101
+ $ tree examples/04-config
102
102
 
103
103
  examples/04-config
104
104
  ├── config.yaml
@@ -107,23 +107,21 @@ examples/04-config
107
107
  └── starwars.yaml
108
108
  ```
109
109
 
110
- Usign default config file (`config.yaml`):
111
-
110
+ **Example 1**: Run test usign default config file (`config.yaml`).
112
111
  ```
113
- teuton run examples/04-config
112
+ $ teuton run examples/04-config
114
113
 
115
114
  CASE RESULTS
116
- +------+----------------+-------+-------+
117
- | CASE | MEMBERS | GRADE | STATE |
118
- | 01 | name_student_1 | 100.0 | ✔ |
119
- | 02 | name_student_2 | 0.0 | ? |
120
- +------+----------------+-------+-------+
115
+ +------+-----------+-------+-------+
116
+ | CASE | MEMBERS | GRADE | STATE |
117
+ | 01 | student_1 | 100.0 | ✔ |
118
+ | 02 | student_2 | 0.0 | ? |
119
+ +------+-----------+-------+-------+
121
120
  ```
122
121
 
123
- Using `example/04-config/starwars.yaml`:
124
-
122
+ **Example 2**: Run test using `example/04-config/starwars.yaml` config file.
125
123
  ```
126
- teuton run --cname=starwars examples/04-config
124
+ $ teuton run --cname=starwars examples/04-config
127
125
 
128
126
  CASE RESULTS
129
127
  +------+------------+-------+-------+
@@ -133,10 +131,9 @@ CASE RESULTS
133
131
  +------+------------+-------+-------+
134
132
  ```
135
133
 
136
- Using `example/04-config/rock.yaml`:
137
-
134
+ **Example 3**: Run test using `example/04-config/rock.yaml` config file.
138
135
  ```
139
- teuton run --cpath=examples/04-config/rock.yaml examples/04-config
136
+ $ teuton run --cpath=examples/04-config/rock.yaml examples/04-config
140
137
 
141
138
  CASE RESULTS
142
139
  +------+------------+-------+-------+
data/docs/learn/05-use.md CHANGED
@@ -2,14 +2,15 @@
2
2
 
3
3
  # use
4
4
 
5
- `use` keyword allow us organize huge amount of groups/targets into several files.
5
+ `use` keyword allow us organize huge amount of groups/targets into differents files.
6
6
 
7
7
  ## Example
8
8
 
9
9
  > This example requires Windows OS on remote machine.
10
10
 
11
- ```bash
12
- tree examples/05-use
11
+ ```
12
+ $ tree examples/05-use
13
+
13
14
  examples/05-use
14
15
  ├── lib
15
16
  │   ├── network.rb
@@ -18,7 +19,7 @@ examples/05-use
18
19
  └── start.rb
19
20
  ```
20
21
 
21
- * `start.rb` file is now splited into: `start.rb`, `users.rb` and `network.rb`.
22
+ * The content is now splited into: `start.rb`, `users.rb` and `network.rb`.
22
23
 
23
24
  ```ruby
24
25
  # File: start.rb
@@ -3,10 +3,12 @@
3
3
 
4
4
  # check test
5
5
 
6
- Check Teuton check syntax and show statistics.
6
+ `teuton check DIRPATH` is a command function that checks syntax and show statistics.
7
+
8
+ ## Example
7
9
 
8
10
  ```
9
- teuton check examples/05-use
11
+ $ teuton check examples/05-use
10
12
 
11
13
  +--------------------------+
12
14
  | GROUP: Using file: users |
@@ -2,7 +2,13 @@
2
2
 
3
3
  # Target weight
4
4
 
5
- * Changing default target weight:
5
+ `weight` is param used by `target` keyword to define weight target value.
6
+
7
+ ## Example
8
+
9
+ Changing default target weight:
10
+ * The first target has the default weight (1.0).
11
+ * The second target has a weight of 2.0.
6
12
 
7
13
  ```ruby
8
14
  # File: network.rb
@@ -18,15 +24,8 @@ group "Using file: network" do
18
24
  end
19
25
  ```
20
26
 
27
+ Output:
21
28
  ```
22
- +--------------------------+
23
- | GROUP: Using file: users |
24
- +--------------------------+
25
- (001) target Create user get(username)
26
- weight 1.0
27
- run 'id get(username)' on host1
28
- expect ["uid=", "(get(username))", "gid="] (Array)
29
-
30
29
  +----------------------------+
31
30
  | GROUP: Using file: network |
32
31
  +----------------------------+
@@ -2,7 +2,9 @@
2
2
 
3
3
  # Unique value
4
4
 
5
- * `unique NAME, VALUE` keyword defines unique values.
5
+ `unique` keyword defines a value that must be unique in all cases.
6
+
7
+ * Usage: `unique NAME, VALUE`. NAME is the param name, and VALUE is the value that must be unique.
6
8
  * All cases that do not comply with this requirement will obtain a score of 0 and it will be reflected in the reports.
7
9
 
8
10
  Example:
@@ -20,7 +22,7 @@ end
20
22
  Cheking test:
21
23
 
22
24
  ```
23
- teuton check examples/08-unique_values
25
+ $ teuton check examples/08-unique_values
24
26
 
25
27
  +--------------------------+
26
28
  | GROUP: Using file: users |
@@ -2,8 +2,7 @@
2
2
 
3
3
  # Send
4
4
 
5
- * [export](../dsl/export.md) keyword generate reports into diferents formats:
6
- * [send](../dsl/send.md) keyword send report copies to every remote host.
5
+ `send` is a keyword used to copy the output report into remote host.
7
6
 
8
7
  ## Example
9
8
 
@@ -16,5 +15,6 @@ end
16
15
  ```
17
16
 
18
17
  * `show`, show process log on screen.
19
- * `export`, create reports with `txt` format.
20
- * `send copy_to: :host1`, copy output report into remote machine (host1).
18
+ * [export](../dsl/export.md), create reports with `txt` format.
19
+ * [send copy_to: :host1](../dsl/send.md), copy output report into remote machine (host1).
20
+ * `host1`, is a set params defined into config file (host1_ip, host1_username, host1_password, etc.)
@@ -2,10 +2,14 @@
2
2
 
3
3
  # debug
4
4
 
5
- * Debug your tests.
5
+ `result.debug` is an instrucction used to debug your tests.
6
+
7
+ ## Introduction
8
+
9
+ Tests grows and becames huge, with a lot of targets (That isn't a problem). Then, we organize them spliting into several files and invoke `use` keywork from our main rb file to load other files (That's good idea).
6
10
 
7
11
  ```
8
- > tree examples/10-debug
12
+ $ tree examples/10-debug
9
13
 
10
14
  examples/10-debug
11
15
  ├── config.yaml
@@ -14,11 +18,9 @@ examples/10-debug
14
18
  └── start.rb
15
19
  ```
16
20
 
17
- Tests grows and becames huge, with a lot of targets (That isn't a problem). Then, we organize them spliting into several files and invoke `use` keywork from our main rb file to load other files (That's good idea).
18
-
19
- Sometimes we need to verify or check rb file consistency and syntax, and we will do it with `teuton check PATH/TO/PROJECT/FOLDER`.
21
+ Sometimes we need to verify or check rb file consistency and syntax, and we will do it with `teuton check DIRPATH`.
20
22
 
21
- ## Debug
23
+ ## Explication
22
24
 
23
25
  Every time we invoke `run` keywork, an OS command is executed. The output is showed on screen and saved into **result** internal object.
24
26
 
@@ -2,9 +2,12 @@
2
2
 
3
3
  # Export
4
4
 
5
- * [export](../dsl/export.md) keyword generate reports into diferents formats:
5
+ [export](../dsl/export.md) keyword generates output reports into diferents formats.
6
+
7
+ Available formats: colored_text, html, json, markdown, txt, xml, yaml.
8
+
9
+ ## Example
6
10
 
7
- Example
8
11
  ```ruby
9
12
  play do
10
13
  show
@@ -19,10 +22,10 @@ end
19
22
  * `export format: :html`, create reports with `html` format.
20
23
  * `export format: :json`, create reports with `json` format.
21
24
 
22
- Firs run `teuton examples/11-export`, then we have:
25
+ Firs run `teuton examples/11-export`, then we have this files:
23
26
 
24
27
  ```
25
- tree var/11-export
28
+ $ tree var/11-export
26
29
 
27
30
  var/11-export
28
31
  ├── case-01.html
@@ -1,15 +1,18 @@
1
1
  [<< back](README.md)
2
2
 
3
- # Example: 09-preserve
3
+ # preserve
4
+
5
+ `preserve` is an option of `export` keyword used to keep older report copies.
4
6
 
5
7
  Every time we run teuton test, older output report files are overwritten with new reports. if you want to preserve old versions then use `preserve`.
6
8
 
7
- With `preserve` option we keep older copies.
9
+ Usage: `export preserve: true`
10
+
11
+ ## Example
8
12
 
9
- 1. [Execution section](#execution-section)
10
- 2. [Result](#result)
13
+ Example files in the `examples/12-preserve` folder.
11
14
 
12
- ## Execution section
15
+ **Execution section**
13
16
 
14
17
  Take a look at our test execution section (Play):
15
18
  ```ruby
@@ -19,15 +22,15 @@ play do
19
22
  end
20
23
  ```
21
24
 
22
- > More information about [export](../dsl/execution/export.md) keyword.
25
+ > More information about [export](../dsl/export.md) keyword.
23
26
 
24
- ## Result
27
+ **Result**
25
28
 
26
- Example, executing `teuton run example/09-preserve` twice:
29
+ Example, executing `teuton run example/12-preserve` twice:
27
30
 
28
31
  ```
29
32
  var
30
- └── learn-09-preserve
33
+ └── 12-preserve
31
34
  ├── 20200519-113035
32
35
  │   ├── case-01.txt
33
36
  │   ├── moodle.csv
@@ -41,4 +44,4 @@ var
41
44
  └── resume.txt
42
45
  ```
43
46
 
44
- * The first time test was launched at 11:30, and second at 12:30 the same day.
47
+ The first time test was launched at 11:30, and second at 12:30 the same day.
@@ -37,8 +37,8 @@ class ExpectSequence
37
37
 
38
38
  def find_best_state
39
39
  @states.each do |state|
40
- state[:score] = state[:steps].count { _1 }
41
- state[:fails] = state[:steps].count { !_1 }
40
+ state[:score] = state[:steps].count { |value| value }
41
+ state[:fails] = state[:steps].count { |value| !value }
42
42
  state[:ok] = state[:fails].zero?
43
43
  end
44
44
  best = @states[0]
@@ -3,20 +3,20 @@ require_relative "../report/report"
3
3
  require_relative "../utils/project"
4
4
  require_relative "../utils/verbose"
5
5
  require_relative "../utils/configfile_reader"
6
+ require_relative "check_cases"
6
7
  require_relative "export_manager"
7
8
  require_relative "send_manager"
8
9
  require_relative "show_report"
9
- require_relative "check_cases"
10
10
  require_relative "report"
11
11
  require_relative "utils"
12
12
 
13
13
  # * initialize
14
14
  # * play
15
15
  # Split into several files:
16
- # * case_manager/check_cases
17
- # * case_manager/export
18
- # * case_manager/hall_of_fame
19
- # * case_manager/report
16
+ # * check_cases
17
+ # * export_manager
18
+ # * send_manager
19
+ # * show_report
20
20
  class CaseManager
21
21
  include Utils
22
22
  include Verbose
@@ -37,9 +37,9 @@ def use(filename)
37
37
  begin
38
38
  require_relative findfiles.first
39
39
  Project.value[:uses] << File.basename(findfiles.first)
40
- rescue StandardError
41
- puts "[ERROR] Unknown file : #{filename}"
42
- puts " Check line : use '#{filename}'"
40
+ rescue => e
41
+ puts "[ERROR] #{e}:"
42
+ puts " File not found! Fix line <use '#{filename}'>"
43
43
  exit 1
44
44
  end
45
45
  end
@@ -30,7 +30,7 @@ class ExportManager
30
30
  unless Formatter.available_formats.include? options[:format]
31
31
  puts Rainbow("[WARN] ExportManager:").yellow.bright
32
32
  puts Rainbow(" Unkown format <#{options[:format]}>. Fix line <export format: FORMAT>.").yellow.bright
33
- puts Rainbow(" Available formats: #{Formatter.available_formats.join(",")}.").yellow.bright
33
+ puts Rainbow(" Available formats: #{Formatter.available_formats.join(", ")}.").yellow.bright
34
34
  puts Rainbow("[INFO] Using default format <txt>.").yellow.bright
35
35
  options[:format] = :txt
36
36
  end
@@ -9,8 +9,6 @@ class CaseManager
9
9
  # Open main report (resume report)
10
10
  # @param config_filepath (String)
11
11
  def open_main_report(config_filepath)
12
- # app = Application.instance
13
-
14
12
  @report.head[:tt_title] = "Teuton (#{Teuton::VERSION})"
15
13
  @report.head[:tt_scriptname] = trim(Project.value[:script_path])
16
14
  @report.head[:tt_configfile] = trim(config_filepath)
@@ -31,7 +29,6 @@ class CaseManager
31
29
  verboseln Rainbow("-" * 36).green
32
30
  verboseln " "
33
31
 
34
- # app = Application.instance
35
32
  @cases.each do |c|
36
33
  line = {}
37
34
  if c.skip?
@@ -61,7 +61,7 @@ class ShowCheck
61
61
  end
62
62
  if Project.value[:macros].size.positive?
63
63
  st.add_row ["Macros", Project.value[:macros].size]
64
- Project.value[:macros].each_key { st.add_row ["", it] }
64
+ Project.value[:macros].each_key { |value| st.add_row ["", value] }
65
65
  end
66
66
  st.add_row ["Groups", @stats[:groups]]
67
67
  st.add_row ["Targets", @stats[:targets]]
@@ -87,11 +87,12 @@ class ShowCheck
87
87
 
88
88
  if @stats[:sets].size.positive?
89
89
  st.add_row ["Sets", @stats[:sets].size]
90
- @stats[:sets].each { st.add_row ["", it] }
90
+ @stats[:sets].each { |value| st.add_row ["", value] }
91
91
  end
92
92
  if @stats[:uploads].size.positive?
93
93
  st.add_row ["Uploads", @stats[:uploads].size]
94
- @stats[:uploads].each { st.add_row ["", it] }
94
+ uploads = @stats[:uploads].select { _1 }
95
+ uploads.each { |value| st.add_row ["", value] }
95
96
  end
96
97
  end
97
98
  Logger.info my_screen_table.to_s + "\n"
@@ -114,7 +115,7 @@ class ShowCheck
114
115
  script_vars << k.to_s + "_password"
115
116
  end
116
117
  end
117
- @stats[:gets].keys.each { script_vars << it }
118
+ @stats[:gets].keys.each { |value| script_vars << value }
118
119
  script_vars
119
120
  end
120
121
  end
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  global:
3
3
  cases:
4
- - tt_members: NAMES_TO-CHANGE
4
+ - tt_members: TOCHANGE
@@ -1,7 +1,7 @@
1
- group "NAME-TO-CHANGE" do
2
- target "DESC_TO-CHANGE"
3
- run "COMMAND_TO-CHANGE"
4
- expect "TEXT_TO-CHANGE"
1
+ group "TOCHANGE" do
2
+ target "TOCHANGE"
3
+ run "TOCHANGE"
4
+ expect "TOCHANGE"
5
5
  end
6
6
 
7
7
  play do
@@ -0,0 +1,90 @@
1
+ require_relative "array"
2
+
3
+ class MarkdownFormatter < ArrayFormatter
4
+ def initialize(report)
5
+ super
6
+ @ext = "md"
7
+ @data = {}
8
+ end
9
+
10
+ def process(options = {})
11
+ build_data(options)
12
+ process_config
13
+ process_logs
14
+ process_groups
15
+ process_results
16
+ process_hof
17
+ deinit
18
+ end
19
+
20
+ private
21
+
22
+ def process_config
23
+ w "# CONFIGURATION\n\n"
24
+ w "| Param | Value |\n"
25
+ w "| ----- | ----- |\n"
26
+ @data[:config].sort.each { |key, value| w "| #{key} | #{value} |\n" }
27
+ w "\n"
28
+ end
29
+
30
+ def process_logs
31
+ return if @data[:logs].empty?
32
+
33
+ w "# LOGS\n\n"
34
+ @data[:logs].each { |line| w "* #{line}\n" }
35
+ w "\n"
36
+ end
37
+
38
+ def process_groups
39
+ return if @data[:groups].empty?
40
+
41
+ w "# GROUPS\n\n"
42
+ @data[:groups].each { |g| process_group g }
43
+ w "\n"
44
+ end
45
+
46
+ def process_results
47
+ w "# RESULTS\n\n"
48
+ w "| Param | Value |\n"
49
+ w "| ----- | ----- |\n"
50
+ @data[:results].sort.each { |key, value| w "| #{key} | #{value} |\n" }
51
+ w "\n"
52
+ end
53
+
54
+ def process_hof
55
+ return if @data[:hall_of_fame].size < 3
56
+
57
+ w "# HALL OF FAME\n\n"
58
+ w "| Grade | Amount |\n"
59
+ w "| ----- | ------ |\n"
60
+ @data[:hall_of_fame].each do |grade, amount|
61
+ if grade == @data[:results][:grade]
62
+ w "| **#{grade}** | **#{amount}** |\n"
63
+ else
64
+ w "| #{grade} | #{amount} |\n"
65
+ end
66
+ end
67
+ w "\n"
68
+ end
69
+
70
+ private
71
+
72
+ def process_group(group)
73
+ tab = " "
74
+ w "* **#{group[:title]}**\n"
75
+ group[:targets].each do |i|
76
+ style = "**"
77
+ style = "" if i[:check]
78
+ w "#{tab * 1}* #{format("%02d", i[:target_id].to_i)}"
79
+ text = "#{i[:score]}/#{i[:weight]}"
80
+ w " #{style}(#{text})#{style}\n"
81
+ w "#{tab * 2} * Description : #{i[:description]}\n"
82
+ w "#{tab * 2} * Command : #{i[:command]}\n"
83
+ w "#{tab * 2} * Output : #{i[:output]}\n"
84
+ w "#{tab * 2} * Duration : #{i[:duration]} (#{i[:conn_type]})\n"
85
+ w "#{tab * 2} * Alterations : #{i[:alterations]}\n"
86
+ w "#{tab * 2} * Expected : #{i[:expected]}\n"
87
+ w "#{tab * 2} * Result : #{i[:result]}\n"
88
+ end
89
+ end
90
+ end
@@ -2,12 +2,14 @@ require "rainbow"
2
2
  require_relative "default/colored_text"
3
3
  require_relative "default/html"
4
4
  require_relative "default/json"
5
+ require_relative "default/markdown"
5
6
  require_relative "default/txt"
6
7
  require_relative "default/xml"
7
8
  require_relative "default/yaml"
8
9
  require_relative "resume/colored_text"
9
10
  require_relative "resume/html"
10
11
  require_relative "resume/json"
12
+ require_relative "resume/markdown"
11
13
  require_relative "resume/txt"
12
14
  require_relative "resume/yaml"
13
15
  require_relative "moodle_csv_formatter"
@@ -17,6 +19,7 @@ module Formatter
17
19
  colored_text: ColoredTextFormatter,
18
20
  html: HTMLFormatter,
19
21
  json: JSONFormatter,
22
+ markdown: MarkdownFormatter,
20
23
  txt: TXTFormatter,
21
24
  xml: XMLFormatter,
22
25
  yaml: YAMLFormatter,
@@ -24,13 +27,14 @@ module Formatter
24
27
  resume_colored_text: ResumeColoredTextFormatter,
25
28
  resume_html: ResumeHTMLFormatter,
26
29
  resume_json: ResumeJSONFormatter,
30
+ resume_markdown: ResumeMarkdownFormatter,
27
31
  resume_txt: ResumeTXTFormatter,
28
32
  resume_xml: ResumeTXTFormatter, # TODO
29
33
  resume_yaml: ResumeYAMLFormatter
30
34
  }
31
35
 
32
36
  def self.available_formats
33
- LIST.keys.take(6)
37
+ LIST.keys.take(7)
34
38
  end
35
39
 
36
40
  def self.call(report, options, filename)
@@ -0,0 +1,84 @@
1
+ require_relative "array"
2
+
3
+ class ResumeMarkdownFormatter < ResumeArrayFormatter
4
+ MIN_HALL_OF_FAME = 3
5
+
6
+ def initialize(report)
7
+ super
8
+ @ext = "md"
9
+ @data = {}
10
+ end
11
+
12
+ def process(options = {})
13
+ build_data(options)
14
+ process_config
15
+ process_cases
16
+ process_conn_errors
17
+ process_results
18
+ process_hof
19
+ deinit
20
+ end
21
+
22
+ private
23
+
24
+ def process_config
25
+ w "# CONFIGURATION\n\n"
26
+ w "| Param | Value |\n"
27
+ w "| ----- | ----- |\n"
28
+ @data[:config].each { |key, value| w("| #{key} | #{trim(value)} |\n") }
29
+ w "\n"
30
+ end
31
+
32
+ def process_cases
33
+ w "# CASES\n\n"
34
+ w "| CASE | MEMBERS | GRADE | STATE |\n"
35
+ w "| ---- | ------- | ----- | ----- |\n"
36
+ @data[:cases].each do |line|
37
+ grade = format(" %<grade>3d", {grade: line[:grade]})
38
+ w "| #{line[:id]} | #{line[:members]} | #{grade} | #{line[:letter]} |\n"
39
+ end
40
+ w "\n"
41
+ end
42
+
43
+ def process_conn_errors
44
+ lines = []
45
+ lines << "# CONN ERRORS"
46
+ lines << ""
47
+ lines << "| CASE | MEMBERS | HOST | ERROR |"
48
+ lines << "| ---- | ------- | ---- | ----- |"
49
+ @data[:cases].each do |line|
50
+ line[:conn_status].each_pair do |h, e|
51
+ lines << "| #{line[:id]} | #{line[:members]} | #{h} | **#{e}** |\n"
52
+ end
53
+ end
54
+
55
+ if lines.size > 4
56
+ w lines.join("\n")
57
+ w "\n\n"
58
+ end
59
+ end
60
+
61
+ def process_results
62
+ w "# RESULTS\n\n"
63
+ w "| Param | Value |\n"
64
+ w "| ----- | ----- |\n"
65
+ @data[:results].each { |key, value| w("| #{key} | #{value} |\n") }
66
+ w "\n"
67
+ end
68
+
69
+ def process_hof
70
+ return if @data[:hall_of_fame].size < MIN_HALL_OF_FAME
71
+
72
+ w "# HALL OF FAME\n\n"
73
+ w "| Grade | Amount |\n"
74
+ w "| ----- | ------ |\n"
75
+ @data[:hall_of_fame].each do |grade, amount|
76
+ if line[0] == @data[:results][:grade]
77
+ w " | **#{grade}** | **#{amount}** |\n"
78
+ else
79
+ w " | #{grade} | #{amount} |\n"
80
+ end
81
+ end
82
+ w "\n"
83
+ end
84
+ end
@@ -9,14 +9,12 @@ class Report
9
9
  def initialize(id = "00")
10
10
  @id = id
11
11
  @filename = "case-#{@id}"
12
- # @output_dir = Application.instance.output_basedir
13
12
  @output_dir = Project.value[:output_basedir]
14
13
  @head = {}
15
14
  @lines = []
16
- @tail = {}
17
- # @history save 1 letter for every target.
15
+ @tail = {unique_fault: 0}
16
+ # [String] with 1 char for every target in @lines
18
17
  # For example: "..F." means: good, good, fail and good
19
- # I will use this in the future stats manager.
20
18
  @history = ""
21
19
  end
22
20
 
@@ -55,10 +53,7 @@ class Report
55
53
  # * fail_weight
56
54
  # * fail_counter
57
55
  def close
58
- max = 0.0
59
- good = 0.0
60
- fail = 0.0
61
- fail_counter = 0
56
+ max = good = fails = fail_counter = 0
62
57
  @lines.each do |i|
63
58
  next unless i.instance_of? Hash
64
59
 
@@ -67,14 +62,14 @@ class Report
67
62
  good += i[:weight]
68
63
  @history += Settings.letter[:good]
69
64
  else
70
- fail += i[:weight]
65
+ fails += i[:weight]
71
66
  fail_counter += 1
72
67
  @history += Settings.letter[:bad]
73
68
  end
74
69
  end
75
70
  @tail[:max_weight] = max
76
71
  @tail[:good_weight] = good
77
- @tail[:fail_weight] = fail
72
+ @tail[:fail_weight] = fails
78
73
  @tail[:fail_counter] = fail_counter
79
74
 
80
75
  i = good.to_f / max
@@ -1,5 +1,5 @@
1
1
  module Teuton
2
- VERSION = "2.10.6"
2
+ VERSION = "2.10.7"
3
3
  APPNAME = "teuton"
4
4
  GEMNAME = "teuton"
5
5
  DOCKERNAME = "dvarrui/#{GEMNAME}"
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teuton
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.6
4
+ version: 2.10.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Vargas Ruiz
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2025-11-12 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: json_pure
@@ -121,11 +122,11 @@ executables:
121
122
  - teuton
122
123
  extensions: []
123
124
  extra_rdoc_files:
124
- - LICENSE
125
125
  - README.md
126
+ - LICENSE
126
127
  - docs/commands/README.md
127
128
  - docs/commands/check-example.md
128
- - docs/commands/howto-run-tests.md
129
+ - docs/commands/run-tests.md
129
130
  - docs/devel/diagram.md
130
131
  - docs/dsl/README.md
131
132
  - docs/dsl/expect.md
@@ -189,7 +190,7 @@ files:
189
190
  - bin/teuton
190
191
  - docs/commands/README.md
191
192
  - docs/commands/check-example.md
192
- - docs/commands/howto-run-tests.md
193
+ - docs/commands/run-tests.md
193
194
  - docs/devel/diagram.md
194
195
  - docs/dsl/README.md
195
196
  - docs/dsl/expect.md
@@ -320,6 +321,7 @@ files:
320
321
  - lib/teuton/report/formatter/default/colored_text.rb
321
322
  - lib/teuton/report/formatter/default/html.rb
322
323
  - lib/teuton/report/formatter/default/json.rb
324
+ - lib/teuton/report/formatter/default/markdown.rb
323
325
  - lib/teuton/report/formatter/default/txt.rb
324
326
  - lib/teuton/report/formatter/default/xml.rb
325
327
  - lib/teuton/report/formatter/default/yaml.rb
@@ -329,6 +331,7 @@ files:
329
331
  - lib/teuton/report/formatter/resume/colored_text.rb
330
332
  - lib/teuton/report/formatter/resume/html.rb
331
333
  - lib/teuton/report/formatter/resume/json.rb
334
+ - lib/teuton/report/formatter/resume/markdown.rb
332
335
  - lib/teuton/report/formatter/resume/txt.rb
333
336
  - lib/teuton/report/formatter/resume/yaml.rb
334
337
  - lib/teuton/report/report.rb
@@ -344,6 +347,7 @@ homepage: https://github.com/teuton-software/teuton
344
347
  licenses:
345
348
  - GPL-3.0
346
349
  metadata: {}
350
+ post_install_message:
347
351
  rdoc_options: []
348
352
  require_paths:
349
353
  - lib
@@ -351,14 +355,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
351
355
  requirements:
352
356
  - - ">="
353
357
  - !ruby/object:Gem::Version
354
- version: 2.5.9
358
+ version: 3.2.8
355
359
  required_rubygems_version: !ruby/object:Gem::Requirement
356
360
  requirements:
357
361
  - - ">="
358
362
  - !ruby/object:Gem::Version
359
363
  version: '0'
360
364
  requirements: []
361
- rubygems_version: 3.7.2
365
+ rubygems_version: 3.4.19
366
+ signing_key:
362
367
  specification_version: 4
363
368
  summary: Teuton (Infrastructure test)
364
369
  test_files: []