protoncloud-sdk 5.3.2__tar.gz → 5.3.3__tar.gz
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.
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/PKG-INFO +1 -1
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/pyproject.toml +1 -1
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/src/proton/component_runner.py +6 -1
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/tests/test_component_runner.py +19 -5
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/.gitignore +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/LICENSE +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/README.md +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/src/proton/__init__.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/src/proton/proton_automation.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/src/proton/proton_client_parama.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/src/proton/proton_env.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/src/proton/proton_environment.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/src/proton/proton_files_and_resources.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/src/proton/proton_git.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/src/proton/proton_logs.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/src/proton/proton_parameter.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/src/proton/run_status.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/tests/test_dados_da_execucao.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/tests/test_download_do_app.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/tests/test_proton_env.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/tests/test_proton_environment.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/tests/test_proton_parameter.py +0 -0
- {protoncloud_sdk-5.3.2 → protoncloud_sdk-5.3.3}/tests/test_run_status.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "protoncloud-sdk"
|
|
7
|
-
version = "5.3.
|
|
7
|
+
version = "5.3.3"
|
|
8
8
|
description = "Proton Cloud SDK para Python: execução de automações, ambientes, logs, parâmetros e recursos."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -195,6 +195,7 @@ def _executar_passo(nome, passo, erro_ao_localizar, evidence_dir):
|
|
|
195
195
|
raise ProtonRunError(f'O Proton não iniciou o passo "{nome}".')
|
|
196
196
|
|
|
197
197
|
antes = _arquivos(evidence_dir)
|
|
198
|
+
passou = False
|
|
198
199
|
|
|
199
200
|
try:
|
|
200
201
|
logger.info("Passo %s: %s", progresso.get("order", "?"), nome)
|
|
@@ -209,6 +210,7 @@ def _executar_passo(nome, passo, erro_ao_localizar, evidence_dir):
|
|
|
209
210
|
|
|
210
211
|
saidas = passo(_parametros_do_passo(progresso, nome))
|
|
211
212
|
_gravar_saidas(nome, saidas)
|
|
213
|
+
passou = True
|
|
212
214
|
|
|
213
215
|
finally:
|
|
214
216
|
try:
|
|
@@ -216,7 +218,10 @@ def _executar_passo(nome, passo, erro_ao_localizar, evidence_dir):
|
|
|
216
218
|
except Exception:
|
|
217
219
|
logger.exception("Falha ao enviar as evidências do passo %s", nome)
|
|
218
220
|
|
|
219
|
-
|
|
221
|
+
# O passo que falhou fica aberto: o Failed da execução (`_registrar_falha`) o fecha
|
|
222
|
+
# como Failed. O Proton marca como Passed o passo que recebe o fim.
|
|
223
|
+
if passou:
|
|
224
|
+
proton_automation.end_component()
|
|
220
225
|
|
|
221
226
|
|
|
222
227
|
def _parametros_do_passo(progresso, nome):
|
|
@@ -30,6 +30,7 @@ class ProtonFalso:
|
|
|
30
30
|
self.arquivos = []
|
|
31
31
|
self.saidas_fora_do_passo = set()
|
|
32
32
|
self.inicio_falha = False
|
|
33
|
+
self.status_dos_passos = []
|
|
33
34
|
|
|
34
35
|
def _pendente(self):
|
|
35
36
|
return self.passos[self.atual] if self.atual < len(self.passos) else None
|
|
@@ -55,7 +56,9 @@ class ProtonFalso:
|
|
|
55
56
|
return {"id": 100 + self.atual, "order": passo["ordem"], "component": passo["nome"]}
|
|
56
57
|
|
|
57
58
|
def finalizar(self):
|
|
59
|
+
# Como no Proton: o passo que recebe o fim fica Passed.
|
|
58
60
|
self.chamadas.append("end")
|
|
61
|
+
self.status_dos_passos.append((self.aberto["nome"], "Passed"))
|
|
59
62
|
self.aberto = None
|
|
60
63
|
return 2
|
|
61
64
|
|
|
@@ -77,6 +80,11 @@ class ProtonFalso:
|
|
|
77
80
|
self.status = status.value
|
|
78
81
|
self.eventos.append(f"status {status.value}")
|
|
79
82
|
|
|
83
|
+
# Como no Proton: a execução que falha (ou para) fecha o passo aberto com o mesmo status.
|
|
84
|
+
if status.value in ("Failed", "Stopped") and self.aberto:
|
|
85
|
+
self.status_dos_passos.append((self.aberto["nome"], status.value))
|
|
86
|
+
self.aberto = None
|
|
87
|
+
|
|
80
88
|
|
|
81
89
|
@pytest.fixture
|
|
82
90
|
def proton(monkeypatch):
|
|
@@ -125,6 +133,7 @@ def test_roda_os_passos_na_ordem_com_os_parametros_de_cada_um(proton):
|
|
|
125
133
|
("AdicionarAoCarrinho", {"in_produto": "Mochila", "out_preco": ""}),
|
|
126
134
|
]
|
|
127
135
|
assert falso.chamadas == ["start", "end", "start", "end"]
|
|
136
|
+
assert falso.status_dos_passos == [("FazerLogin", "Passed"), ("AdicionarAoCarrinho", "Passed")]
|
|
128
137
|
assert falso.saidas == [("AdicionarAoCarrinho", "out_preco", "29.99")]
|
|
129
138
|
assert falso.status == RunStatus.PASSED.value
|
|
130
139
|
|
|
@@ -149,7 +158,7 @@ def test_o_mesmo_componente_duas_vezes_recebe_os_parametros_da_sua_posicao(proto
|
|
|
149
158
|
assert produtos == ["Mochila", "Lanterna"]
|
|
150
159
|
|
|
151
160
|
|
|
152
|
-
def
|
|
161
|
+
def test_passo_que_falha_fica_failed_grava_o_erro_real_e_para(proton):
|
|
153
162
|
falso = proton([
|
|
154
163
|
{"nome": "FazerLogin", "ordem": 1},
|
|
155
164
|
{"nome": "FinalizarCompra", "ordem": 2},
|
|
@@ -161,7 +170,9 @@ def test_passo_que_falha_fecha_o_passo_grava_o_erro_real_e_para(proton):
|
|
|
161
170
|
with pytest.raises(AssertionError, match="login recusado"):
|
|
162
171
|
run_components({"FazerLogin": login_recusado, "FinalizarCompra": lambda p: None})
|
|
163
172
|
|
|
164
|
-
|
|
173
|
+
# Sem o fim do passo, que o Proton gravaria como Passed: o Failed da execução o fecha.
|
|
174
|
+
assert falso.chamadas == ["start"]
|
|
175
|
+
assert falso.status_dos_passos == [("FazerLogin", "Failed")]
|
|
165
176
|
assert falso.status == RunStatus.FAILED.value
|
|
166
177
|
assert len(falso.erros) == 1
|
|
167
178
|
# O stack trace é o do passo, e não o da maquinaria de chamada.
|
|
@@ -175,7 +186,8 @@ def test_componente_que_nao_existe_no_projeto(proton):
|
|
|
175
186
|
with pytest.raises(ProtonRunError, match='"Inexistente" não existe'):
|
|
176
187
|
run_components({})
|
|
177
188
|
|
|
178
|
-
assert falso.chamadas == ["start"
|
|
189
|
+
assert falso.chamadas == ["start"]
|
|
190
|
+
assert falso.status_dos_passos == [("Inexistente", "Failed")]
|
|
179
191
|
assert falso.status == RunStatus.FAILED.value
|
|
180
192
|
|
|
181
193
|
|
|
@@ -232,7 +244,8 @@ def test_componente_que_falta_no_mesmo_sistema_falha_em_vez_de_devolver_ao_runne
|
|
|
232
244
|
with pytest.raises(ProtonRunError, match='"Esquecido" não existe'):
|
|
233
245
|
run_components({"FazerLogin": lambda p: None})
|
|
234
246
|
|
|
235
|
-
assert falso.chamadas == ["start", "end", "start"
|
|
247
|
+
assert falso.chamadas == ["start", "end", "start"]
|
|
248
|
+
assert falso.status_dos_passos == [("FazerLogin", "Passed"), ("Esquecido", "Failed")]
|
|
236
249
|
assert falso.status == RunStatus.FAILED.value
|
|
237
250
|
|
|
238
251
|
|
|
@@ -245,7 +258,8 @@ def test_erro_ao_procurar_o_componente_marca_o_passo_e_falha(proton):
|
|
|
245
258
|
with pytest.raises(ImportError, match="biblioteca do SAP"):
|
|
246
259
|
run_components(localizar)
|
|
247
260
|
|
|
248
|
-
assert falso.chamadas == ["start"
|
|
261
|
+
assert falso.chamadas == ["start"]
|
|
262
|
+
assert falso.status_dos_passos == [("FazerLogin", "Failed")]
|
|
249
263
|
assert falso.status == RunStatus.FAILED.value
|
|
250
264
|
|
|
251
265
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|