teuton 2.4.0 → 2.4.2
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 +9 -6
- data/docs/changelog/todo.md +10 -1
- data/docs/changelog/v2.4.md +5 -1
- data/docs/commands/README.md +8 -17
- data/docs/commands/example_check.md +4 -4
- data/docs/commands/example_run.md +10 -32
- data/docs/dsl/README.md +27 -39
- data/docs/dsl/{definition/expect.md → expect.md} +2 -18
- data/docs/dsl/{execution/export.md → export.md} +4 -8
- data/docs/dsl/{setting/get.md → get.md} +4 -10
- data/docs/dsl/{definition/group.md → group.md} +2 -7
- data/docs/dsl/{execution/play.md → play.md} +1 -6
- data/docs/dsl/{definition/result.md → result.md} +1 -6
- data/docs/dsl/{definition/run_remote.md → run.md} +57 -23
- data/docs/dsl/{execution/send.md → send.md} +1 -8
- data/docs/dsl/{setting/set.md → set.md} +1 -7
- data/docs/dsl/{execution/show.md → show.md} +7 -16
- data/docs/dsl/target.md +33 -0
- data/docs/ideas/todo.md +35 -115
- 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-cmd_new.md +28 -0
- data/docs/learn/{01-target.md → 02-target.md} +21 -28
- data/docs/learn/03-remote_hosts.md +59 -87
- data/docs/learn/04-config.md +147 -0
- data/docs/learn/05-use.md +25 -45
- data/docs/learn/06-cmd_check.md +50 -0
- data/docs/learn/07-target_weight.md +44 -0
- data/docs/learn/08-unique_values.md +70 -0
- data/docs/learn/09-send.md +20 -0
- data/docs/learn/10-debug.md +45 -0
- data/docs/learn/11-export.md +35 -0
- data/docs/learn/{09-preserve.md → 12-preserve.md} +1 -1
- data/docs/learn/13-feedback.md +49 -0
- data/docs/learn/14-moodle_id.md +24 -0
- data/docs/learn/{08-readme.md → 15-readme.md} +5 -9
- data/docs/learn/{13-include.md → 16-include.md} +1 -3
- data/docs/learn/{14-alias.md → 17-alias.md} +0 -0
- data/docs/learn/{07-log.md → 18-log.md} +19 -23
- data/docs/learn/{12-get_vars.md → 19-read_vars.md} +3 -3
- data/docs/learn/20-macros.md +49 -0
- data/docs/learn/{16-exit_codes.md → 21-exit_codes.md} +0 -0
- data/docs/learn/{10-result.md → 22-result.md} +3 -3
- data/docs/learn/23-test-code.md +54 -0
- data/docs/learn/24-test-sql.md +69 -0
- data/docs/learn/README.md +31 -32
- data/lib/teuton/application.rb +2 -5
- data/lib/teuton/case_manager/case/case.rb +2 -1
- data/lib/teuton/case_manager/case/dsl/expect.rb +3 -1
- data/lib/teuton/case_manager/case/dsl/goto.rb +1 -1
- data/lib/teuton/case_manager/case/dsl/log.rb +5 -3
- data/lib/teuton/case_manager/case/dsl/send.rb +2 -2
- data/lib/teuton/case_manager/case/dsl/target.rb +1 -1
- data/lib/teuton/case_manager/case/result/ext_compare.rb +20 -21
- data/lib/teuton/case_manager/case/result/ext_filter.rb +15 -8
- data/lib/teuton/case_manager/case_manager.rb +10 -8
- data/lib/teuton/check/show.rb +1 -1
- data/lib/teuton/files/config.yaml +1 -2
- data/lib/teuton/files/start.rb +4 -4
- data/lib/teuton/readme/dsl.rb +9 -1
- data/lib/teuton/readme/readme.rb +8 -1
- data/lib/teuton/report/formatter/base_formatter.rb +2 -0
- data/lib/teuton/report/formatter/formatter.rb +1 -0
- data/lib/teuton/report/show.rb +8 -0
- data/lib/teuton/version.rb +1 -1
- data/lib/teuton.rb +2 -1
- metadata +72 -54
- data/docs/dsl/definition/run_local.md +0 -33
- data/docs/dsl/definition/target.md +0 -40
- data/docs/install/scripts.md +0 -96
- data/docs/learn/02-config.md +0 -121
- data/docs/learn/04-new_test.md +0 -87
- data/docs/learn/06-debug.md +0 -110
- data/docs/learn/11-moodle_id.md +0 -19
@@ -0,0 +1,35 @@
|
|
1
|
+
[<< back](README.md)
|
2
|
+
|
3
|
+
# Export
|
4
|
+
|
5
|
+
* [export](../dsl/export.md) keyword generate reports into diferents formats:
|
6
|
+
|
7
|
+
Example
|
8
|
+
```ruby
|
9
|
+
play do
|
10
|
+
show
|
11
|
+
export format: :txt
|
12
|
+
export format: :html
|
13
|
+
export format: :json
|
14
|
+
end
|
15
|
+
```
|
16
|
+
|
17
|
+
* `show`, show process on screen.
|
18
|
+
* `export format: :txt`, create reports with `txt` format.
|
19
|
+
* `export format: :html`, create reports with `html` format.
|
20
|
+
* `export format: :json`, create reports with `json` format.
|
21
|
+
|
22
|
+
Firs run `teuton examples/11-export`, then we have:
|
23
|
+
|
24
|
+
```
|
25
|
+
❯ tree var/11-export
|
26
|
+
|
27
|
+
var/11-export
|
28
|
+
├── case-01.html
|
29
|
+
├── case-01.json
|
30
|
+
├── case-01.txt
|
31
|
+
├── moodle.csv
|
32
|
+
├── resume.html
|
33
|
+
├── resume.json
|
34
|
+
└── resume.txt
|
35
|
+
```
|
@@ -0,0 +1,49 @@
|
|
1
|
+
[<< back](README.md)
|
2
|
+
|
3
|
+
# Feedback
|
4
|
+
|
5
|
+
Exporting with false feedback option `export feedback: false`, hide some items from output reports. Hiden items: command, alterations, expected and result.
|
6
|
+
|
7
|
+
> More information about [export](../dsl/execution/export.md) keyword.
|
8
|
+
|
9
|
+
Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
play do
|
13
|
+
show
|
14
|
+
export feedback: false
|
15
|
+
export format: "html", feedback: false
|
16
|
+
end
|
17
|
+
```
|
18
|
+
|
19
|
+
## Description
|
20
|
+
|
21
|
+
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.
|
22
|
+
|
23
|
+
Each "target" contains the following fields:
|
24
|
+
|
25
|
+
* Identification: id, description
|
26
|
+
* Evaluation result: check(true/false)
|
27
|
+
* Punctuation: score, weight
|
28
|
+
* Check process: conn_type, command, duration, alterations, expected, result
|
29
|
+
|
30
|
+
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.
|
31
|
+
|
32
|
+
With "feedback: false" the fields are hidden: command, alterations, expected and result.
|
33
|
+
|
34
|
+
|
35
|
+
## Results
|
36
|
+
|
37
|
+
Executing `teuton run examples/13-feedback`, we get this output:
|
38
|
+
|
39
|
+
```
|
40
|
+
GROUPS
|
41
|
+
- Preserve output reports
|
42
|
+
01 (1.0/1.0)
|
43
|
+
Description : Exits user david
|
44
|
+
Command : ********
|
45
|
+
Duration : 0.002 (local)
|
46
|
+
Alterations : *******************
|
47
|
+
Expected : ************** (String)
|
48
|
+
Result : ******** (String)
|
49
|
+
```
|
@@ -0,0 +1,24 @@
|
|
1
|
+
[<< back](README.md)
|
2
|
+
|
3
|
+
# Moodle
|
4
|
+
|
5
|
+
As a teacher, probably you are using Moodle platform. So, you want to upload the results of the evaluation carried out by Teuton into Moodle.
|
6
|
+
|
7
|
+
Teuton generates a file called `moodle.csv` with the grades of each student into CSV format. This file is suitable to import into Moodle platform.
|
8
|
+
|
9
|
+
## tt_moodle_id
|
10
|
+
|
11
|
+
Add a new field called `tt_moodle_id` to each case in "config.yaml". Fill it with the student's identification (For example, the email registered on the Moodle, or ID number, etc.).
|
12
|
+
|
13
|
+
Example:
|
14
|
+
|
15
|
+
```
|
16
|
+
global:
|
17
|
+
cases:
|
18
|
+
- tt_members: Darth Vader
|
19
|
+
tt_moodle_id: vader@starwars.com
|
20
|
+
- tt_members: Obiwan Kenobi
|
21
|
+
tt_moodle_id: obiwan@starwars.com
|
22
|
+
```
|
23
|
+
|
24
|
+
Now, when running test "moodle.csv" will be generated with all student grades.
|
@@ -4,10 +4,6 @@
|
|
4
4
|
|
5
5
|
Create README files (with test instructions) from our test definition.
|
6
6
|
|
7
|
-
1. [Definition section](#definition-section)
|
8
|
-
2. [Execute command](#execute-command)
|
9
|
-
3. [Result](#result)
|
10
|
-
|
11
7
|
## Definition section
|
12
8
|
|
13
9
|
Take a look at our test definition section (Group):
|
@@ -35,23 +31,23 @@ There exists some `readme` instructions after `group` and `target` lines.
|
|
35
31
|
To generate automatically a README file from previous test, execute this:
|
36
32
|
|
37
33
|
```
|
38
|
-
teuton readme example/
|
34
|
+
teuton readme example/15-readme > example/15-readme/README.md
|
39
35
|
```
|
40
36
|
|
41
37
|
## Result
|
42
38
|
|
43
|
-
**Let's see the output**: Content of `example/
|
39
|
+
**Let's see the output**: Content of `example/15-readme/README.md` file.
|
44
40
|
|
45
41
|
---
|
46
|
-
|
42
|
+
|
43
|
+
# 15-readme
|
47
44
|
|
48
45
|
## Customize readme output
|
49
46
|
|
50
|
-
This is our
|
47
|
+
This is our readme example.
|
51
48
|
And here we'll see how to use readme keyword
|
52
49
|
|
53
50
|
Go to [LOCALHOST](#required-hosts) host, and do next:
|
54
51
|
* Create user david.
|
55
52
|
* Help: you can use 'useradd' command to create users.
|
56
53
|
* Remember: Only root is permitted to create new users.
|
57
|
-
---
|
@@ -1,11 +1,9 @@
|
|
1
1
|
[<< back](README.md)
|
2
2
|
|
3
|
-
#
|
3
|
+
# include
|
4
4
|
|
5
5
|
Use `tt-include` to include several config files into your main config file.
|
6
6
|
|
7
|
-
## Explanation
|
8
|
-
|
9
7
|
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.
|
10
8
|
|
11
9
|
Suppose we have the following file structure.
|
File without changes
|
@@ -1,33 +1,27 @@
|
|
1
1
|
[<< back](README.md)
|
2
2
|
|
3
|
-
#
|
3
|
+
# 18-log
|
4
4
|
|
5
|
-
|
5
|
+
* `log TEXT`, save TEXT into output report.
|
6
6
|
|
7
|
-
|
8
|
-
2. [Run test](#execution-section)
|
9
|
-
3. [Result](#result)
|
7
|
+
Example
|
10
8
|
|
11
|
-
## Definition section
|
12
|
-
|
13
|
-
Test definition section (Group):
|
14
9
|
```ruby
|
15
10
|
group "Learning about log messages" do
|
16
|
-
log
|
11
|
+
log "Using log messages."
|
17
12
|
|
18
13
|
target "Create user david"
|
19
|
-
run
|
14
|
+
run "id david"
|
15
|
+
log result.value
|
20
16
|
expect "david"
|
21
17
|
|
22
|
-
log
|
18
|
+
log "Problem detected!", :error
|
19
|
+
log "This is a warning", :warn
|
20
|
+
log "Hi, there!", :info
|
23
21
|
end
|
24
22
|
```
|
25
23
|
|
26
|
-
|
27
|
-
|
28
|
-
## Result
|
29
|
-
|
30
|
-
**Let's see example**: Content of `var/07-log/case-01.txt` file.
|
24
|
+
Content of `var/18-log/case-01.txt` file.
|
31
25
|
|
32
26
|
```
|
33
27
|
CONFIGURATION
|
@@ -35,12 +29,15 @@ CONFIGURATION
|
|
35
29
|
| tt_members | anonymous |
|
36
30
|
| tt_sequence | false |
|
37
31
|
| tt_skip | false |
|
38
|
-
| tt_testname |
|
32
|
+
| tt_testname | 18-log |
|
39
33
|
+-------------+-----------+
|
40
34
|
|
41
35
|
LOGS
|
42
|
-
[
|
43
|
-
[
|
36
|
+
[09:14:22] INFO: Using log messages.
|
37
|
+
[09:14:22] INFO: uid=1000(david) gid=1000(david) grupos=495(cdrom),493(disk),487(video),474(wheel),464(wireshark),459(docker),456(vboxusers),1000(david)
|
38
|
+
[09:14:22] ERROR: Problem detected!
|
39
|
+
[09:14:22] WARN!: This is a warning
|
40
|
+
[09:14:22] INFO: Hi, there!
|
44
41
|
|
45
42
|
GROUPS
|
46
43
|
- Learning about log messages
|
@@ -55,9 +52,9 @@ GROUPS
|
|
55
52
|
RESULTS
|
56
53
|
+--------------+---------------------------+
|
57
54
|
| case_id | 01 |
|
58
|
-
| start_time |
|
59
|
-
| finish_time |
|
60
|
-
| duration | 0.
|
55
|
+
| start_time | 2023-01-26 09:14:22 +0000 |
|
56
|
+
| finish_time | 2023-01-26 09:14:22 +0000 |
|
57
|
+
| duration | 0.002012326 |
|
61
58
|
| unique_fault | 0 |
|
62
59
|
| max_weight | 1.0 |
|
63
60
|
| good_weight | 1.0 |
|
@@ -65,4 +62,3 @@ RESULTS
|
|
65
62
|
| fail_counter | 0 |
|
66
63
|
| grade | 100 |
|
67
64
|
+--------------+---------------------------+
|
68
|
-
```
|
@@ -1,10 +1,10 @@
|
|
1
1
|
[<< back](README.md)
|
2
2
|
|
3
|
-
#
|
3
|
+
# Read vars
|
4
4
|
|
5
|
-
To
|
5
|
+
To get paramm values from the configuration file we already have the `get` statement. Example, to read `dirname` we do `get(:dirname)`.
|
6
6
|
|
7
|
-
**Example 1:** Using `get` to
|
7
|
+
**Example 1:** Using `get` to get values.
|
8
8
|
|
9
9
|
```ruby
|
10
10
|
# "get(:dirname)" reads dirname var from config file
|
@@ -0,0 +1,49 @@
|
|
1
|
+
[<< back](README.md)
|
2
|
+
|
3
|
+
# Macros
|
4
|
+
|
5
|
+
Macros is a technique to make it easier to write and reuse code.
|
6
|
+
|
7
|
+
**Example**
|
8
|
+
|
9
|
+
* We start from a set of repeated targets.
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
target "Exist user fran"
|
13
|
+
run "id fran"
|
14
|
+
expect_one "root"
|
15
|
+
|
16
|
+
target "Exist user root"
|
17
|
+
run "id root"
|
18
|
+
expect_one "root"
|
19
|
+
|
20
|
+
target "Exist user david"
|
21
|
+
run "id david"
|
22
|
+
expect_one "david"
|
23
|
+
```
|
24
|
+
|
25
|
+
* Define a macro with the repeated block:
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
define_macro "user_exists", :name do
|
29
|
+
target "Exist user #{get(:name)}"
|
30
|
+
run "id #{get(:name)}"
|
31
|
+
expect_one get(:name)
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
* Replace the previous targets with macro calls. There are 3 ways to invoke the macro:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
user_exists(name: "fran")
|
39
|
+
user_exists(name: "root")
|
40
|
+
user_exists(name: "david")
|
41
|
+
```
|
42
|
+
|
43
|
+
**Notice**: There are 3 ways to invoke the macro:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
user_exists(name: "fran")
|
47
|
+
macro "user_exists", name: "fran"
|
48
|
+
macro_user_exists(name: "fran")
|
49
|
+
```
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[<< back](README.md)
|
2
2
|
|
3
|
-
#
|
3
|
+
# result
|
4
4
|
|
5
5
|
Sometimes it can be useful to look at the information returned by the "run" command. For this we use the **"result" object**.
|
6
6
|
|
@@ -20,11 +20,11 @@ end
|
|
20
20
|
|
21
21
|
**Example 2:** When we are debugging our test and we want to see the content of the "result" object on the screen, we will use `result.debug`.
|
22
22
|
|
23
|
-
```
|
23
|
+
```ruby
|
24
24
|
group "Checking users" do
|
25
25
|
users = ["root", "vader"]
|
26
26
|
|
27
|
-
users
|
27
|
+
for name in users do
|
28
28
|
target "Exists username #{name}"
|
29
29
|
run "id #{name}"
|
30
30
|
result.debug
|
@@ -0,0 +1,54 @@
|
|
1
|
+
[<<back](README.md)
|
2
|
+
|
3
|
+
# Test code
|
4
|
+
|
5
|
+
Let's test code using teuton.
|
6
|
+
|
7
|
+
**Example:**
|
8
|
+
|
9
|
+
* Ask students to make a program that performs addition and multiplication.
|
10
|
+
* Define targets `sum` and `mul`:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
# File: start.rb
|
14
|
+
group "Test code example" do
|
15
|
+
# Reading filepath from config file
|
16
|
+
filepath = "./#{get(:folder)}/#{get(:filename)}"
|
17
|
+
|
18
|
+
target "Sum"
|
19
|
+
run "#{filepath} 3 4"
|
20
|
+
expect [ "Sum", "7" ] # Using Array/List of required items
|
21
|
+
|
22
|
+
target "Mul"
|
23
|
+
run "#{filepath} 3 4"
|
24
|
+
expect /Mul\s+=\s+12/ # Using a regular expresion
|
25
|
+
end
|
26
|
+
```
|
27
|
+
|
28
|
+
* Define config params:
|
29
|
+
|
30
|
+
```yaml
|
31
|
+
# File: config.yaml
|
32
|
+
---
|
33
|
+
global:
|
34
|
+
folder: examples/23-test-code/code
|
35
|
+
cases:
|
36
|
+
- tt_members: student_1
|
37
|
+
filename: math_1.py
|
38
|
+
- tt_members: student_2
|
39
|
+
filename: math_2b.py
|
40
|
+
```
|
41
|
+
|
42
|
+
* Put students files into `code` folder.
|
43
|
+
* Now run Teuton test:
|
44
|
+
|
45
|
+
```
|
46
|
+
❯ teuton examples/23-test-code
|
47
|
+
|
48
|
+
CASE RESULTS
|
49
|
+
+------+-----------+-------+-------+
|
50
|
+
| CASE | MEMBERS | GRADE | STATE |
|
51
|
+
| 01 | student_1 | 100.0 | ✔ |
|
52
|
+
| 02 | student_2 | 100.0 | ✔ |
|
53
|
+
+------+-----------+-------+-------+
|
54
|
+
```
|
@@ -0,0 +1,69 @@
|
|
1
|
+
[<<back](README.md)
|
2
|
+
|
3
|
+
# Test SQL and database
|
4
|
+
|
5
|
+
**Exercise**
|
6
|
+
|
7
|
+
* Ask students to make a Sqlite Database. Create a table called `characters` with `name` varchar, and `rol` varchar.
|
8
|
+
* Database example:
|
9
|
+
|
10
|
+
```
|
11
|
+
❯ sqlite3 examples/24-test-sql/database_01.db
|
12
|
+
|
13
|
+
sqlite> .schema characters
|
14
|
+
CREATE TABLE characters ( name varchar(255), rol varchar(255));
|
15
|
+
|
16
|
+
sqlite> select * from characters;
|
17
|
+
Obiwan|Jedi
|
18
|
+
```
|
19
|
+
|
20
|
+
* Query example:
|
21
|
+
|
22
|
+
```
|
23
|
+
❯ cat examples/24-test-sql/query_01.sql
|
24
|
+
|
25
|
+
select * from characters where rol='Jedi';
|
26
|
+
```
|
27
|
+
|
28
|
+
**Teuton test**
|
29
|
+
|
30
|
+
* Define targets:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
group "Test SQL and database" do
|
34
|
+
database = "#{get(:folder)}/#{get(:database)}"
|
35
|
+
query = "#{get(:folder)}/#{get(:query)}"
|
36
|
+
|
37
|
+
target "Database schema"
|
38
|
+
run "sqlite3 #{database} '.schema characters'"
|
39
|
+
expect "name varchar", "rol varchar"
|
40
|
+
|
41
|
+
target "Query Jedi"
|
42
|
+
run "sqlite3 #{database} '.read #{query}'"
|
43
|
+
expect "Obiwan", "Jedi"
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
* Configure params:
|
48
|
+
|
49
|
+
```yaml
|
50
|
+
---
|
51
|
+
global:
|
52
|
+
folder: examples/24-test-sql
|
53
|
+
cases:
|
54
|
+
- tt_members: student_1_name
|
55
|
+
database: database_01.db
|
56
|
+
query: query_01.sql
|
57
|
+
```
|
58
|
+
|
59
|
+
**Test output**
|
60
|
+
|
61
|
+
```
|
62
|
+
❯ teuton examples/24-test-sql
|
63
|
+
|
64
|
+
CASE RESULTS
|
65
|
+
+------+----------------+-------+-------+
|
66
|
+
| CASE | MEMBERS | GRADE | STATE |
|
67
|
+
| 01 | student_1_name | 100.0 | ✔ |
|
68
|
+
+------+----------------+-------+-------+
|
69
|
+
```
|
data/docs/learn/README.md
CHANGED
@@ -1,37 +1,35 @@
|
|
1
|
-
|
2
1
|
[<< back](../../README.md)
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
* [ES - CHAPI19: Teuton demo](https://github.com/dvarrui/proyectos-de-ejemplo/tree/master/charlas/teuton)
|
3
|
+
# Learn
|
4
|
+
|
5
|
+
Learn how write your own Teuton tests:
|
6
|
+
|
7
|
+
1. [Creating NEW test](01-cmd_new.md)
|
8
|
+
1. [Evaluating TARGET](02-target.md)
|
9
|
+
1. [Checking REMOTE HOSTS](03-remote_hosts.md)
|
10
|
+
1. [Reading CONFIG file](04-config.md)
|
11
|
+
1. [Using several files](05-use.md)
|
12
|
+
1. [CHECK test syntax](06-cmd_check.md)
|
13
|
+
1. [Target WEIGHT](07-target_weight.md)
|
14
|
+
1. [UNIQUE values](08-unique_values.md)
|
15
|
+
1. [SEND report copies to remote hosts](09-send.md)
|
16
|
+
1. [DEBUG results](10-debug.md)
|
17
|
+
1. [Export other FORMATS](11-export.md)
|
18
|
+
1. [PRESERVE old reports](12-preserve.md)
|
19
|
+
1. [Hide FEEDBACK from reports](13-feedback.md)
|
20
|
+
1. [MOODLE ID](14-moodle_id.md)
|
21
|
+
1. [Build README from test](15-readme.md)
|
22
|
+
1. [INCLUDE more configuration files](16-include.md)
|
23
|
+
1. [ALIAS](17-alias.md)
|
24
|
+
1. [LOG messages](18-log.md)
|
25
|
+
1. [Don't get params, just read vars](19-read_vars.md)
|
26
|
+
1. [MACROS](20-macros.md)
|
27
|
+
1. [Checking exit codes](21-exit_codes.md)
|
28
|
+
1. [RESULT object](22-result.md)
|
29
|
+
1. [Test code](23-test-code.md)
|
30
|
+
1. [Test SQL and database](24-test-sql.md)
|
31
|
+
|
32
|
+
Mores examples at [teuton-tests](https://github.com/dvarrui/teuton-tests) GitHub repository.
|
35
33
|
|
36
34
|
# Videos
|
37
35
|
|
@@ -40,6 +38,7 @@ But if you want to see Spanish videos, here you are:
|
|
40
38
|
|
41
39
|
Teuton (v2.0):
|
42
40
|
* [ES - CHAPI19: Charla Teuton](https://youtu.be/KFWQDfNAFxI?t=12221)
|
41
|
+
* [ES - CHAPI19: Teuton demo](https://github.com/dvarrui/proyectos-de-ejemplo/tree/master/charlas/teuton)
|
43
42
|
|
44
43
|
Sysadmingame (Teuton v1.0)
|
45
44
|
* [Sysadmingame (1 de 3): Instalación del programa](https://youtu.be/dnyMq9_KDco)
|
data/lib/teuton/application.rb
CHANGED
@@ -1,13 +1,10 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
require "singleton"
|
4
|
-
require_relative "version"
|
2
|
+
# require_relative "version"
|
5
3
|
require_relative "utils/name_file_finder"
|
6
4
|
|
7
|
-
# This Singleton contains application params
|
8
5
|
class Application
|
9
6
|
include Singleton
|
10
|
-
include Teuton
|
7
|
+
# include Teuton
|
11
8
|
|
12
9
|
attr_reader :letter
|
13
10
|
attr_reader :running_basedir, :output_basedir
|
@@ -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
|
|
@@ -98,7 +99,7 @@ class Case
|
|
98
99
|
@report.head[:tt_members] || "noname"
|
99
100
|
end
|
100
101
|
|
101
|
-
|
102
|
+
alias_method :skip?, :skip
|
102
103
|
|
103
104
|
private
|
104
105
|
|
@@ -7,12 +7,14 @@ module DSL
|
|
7
7
|
# @param text (String)
|
8
8
|
# @param type (Symbol) Values :info, :warn or :error
|
9
9
|
def log(text = "", type = :info)
|
10
|
-
s = ""
|
10
|
+
s = " INFO"
|
11
11
|
s = Rainbow("WARN!").color(:yellow) if type == :warn
|
12
12
|
s = Rainbow("ERROR").bg(:red) if type == :error
|
13
13
|
t = Time.now
|
14
14
|
f = format("%<hour>02d:%<min>02d:%<sec>02d", {hour: t.hour, min: t.min, sec: t.sec})
|
15
|
-
|
15
|
+
msg = "[#{f}] #{s}: #{text}"
|
16
|
+
msg = "[#{f}] #{text}" if s == ""
|
17
|
+
@report.lines << msg
|
16
18
|
end
|
17
|
-
|
19
|
+
alias_method :msg, :log
|
18
20
|
end
|
@@ -37,10 +37,10 @@ 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
|
-
msg = Rainbow("
|
40
|
+
msg = Rainbow("==> File '#{remotefilepath}' of '#{get(:tt_members)}' has been copied").green
|
41
41
|
verboseln(msg)
|
42
42
|
rescue
|
43
|
-
msg = Rainbow("[
|
43
|
+
msg = Rainbow("==> [FAIL] #{get(:tt_members)}: 'scp #{localfilepath}' to #{remotefilepath}").red
|
44
44
|
verboseln(msg)
|
45
45
|
end
|
46
46
|
end
|