-
Notifications
You must be signed in to change notification settings - Fork 1
/
funcAddFilterToSuccess.go
44 lines (42 loc) · 1.45 KB
/
funcAddFilterToSuccess.go
1
2
3
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
35
36
37
38
39
40
41
42
43
44
package iotmakerdockerbuilder
// AddFilterToFail
//
// English:
//
// Adds a filter to the container's standard output to look for a textual value indicating test
// success.
//
// Input:
// match: Simple text searched in the container's standard output to activate the filter
// filter: Regular expression used to filter what goes into the log using the `valueToGet`
// parameter.
// search: Regular expression used for search and replacement in the text found in the previous
// step [optional].
// replace: Regular expression replace element [optional].
//
// Português:
//
// Adiciona um filtro na saída padrão do container para procurar um valor textual indicador de sucesso
// do teste.
//
// Entrada:
// match: Texto simples procurado na saída padrão do container para ativar o filtro
// filter: Expressão regular usada para filtrar o que vai para o log usando o parâmetro
// `valueToGet`.
// search: Expressão regular usada para busca e substituição no texto encontrado na etapa anterior
// [opcional].
// replace: Elemento da troca da expressão regular [opcional].
func (e *ContainerBuilder) AddFilterToSuccess(match, filter, search, replace string) {
if e.chaos.filterSuccess == nil {
e.chaos.filterSuccess = make([]LogFilter, 0)
}
e.chaos.filterSuccess = append(
e.chaos.filterSuccess,
LogFilter{
Match: match,
Filter: filter,
Search: search,
Replace: replace,
},
)
}