Skip to content

Commit ce4e88d

Browse files
prepare to comment on pr
1 parent 92d3419 commit ce4e88d

File tree

1 file changed

+9
-39
lines changed

1 file changed

+9
-39
lines changed

action.yml

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@ inputs:
1111
description: 'Argumentos adicionais para passar ao pytest'
1212
required: false
1313
default: ''
14-
15-
outputs:
16-
test-output:
17-
description: 'Output completo dos testes'
18-
value: ${{ steps.run-tests.outputs.test-output }}
19-
test-result:
20-
description: 'Resultado dos testes (success/failure)'
21-
value: ${{ steps.run-tests.outputs.test-result }}
22-
test-summary:
23-
description: 'Resumo dos testes executados'
24-
value: ${{ steps.run-tests.outputs.test-summary }}
25-
2614
runs:
2715
using: 'composite'
2816
steps:
@@ -90,31 +78,13 @@ runs:
9078
MGC_PATH: ${{ env.MGC_PATH_RESOLVED }}
9179
run: |
9280
echo "Executando testes com MGC_PATH: $MGC_PATH"
81+
poetry run pytest ${{ inputs.pytest-args }} --tb=short --ignore=tests/test_auth.py > pytest_output.txt 2>&1
82+
echo "exit_code=$?" >> $GITHUB_OUTPUT
9383
94-
set +e # Não falha imediatamente em caso de erro
95-
output=$(poetry run pytest ${{ inputs.pytest-args }} --tb=short --ignore=tests/test_auth.py 2>&1 | tee /dev/tty)
96-
exit_code=$?
97-
set -e
98-
99-
# Salva o output completo
100-
echo "test-output<<EOF" >> $GITHUB_OUTPUT
101-
echo "$output" >> $GITHUB_OUTPUT
102-
echo "EOF" >> $GITHUB_OUTPUT
103-
104-
# Determina o resultado
105-
if [ $exit_code -eq 0 ]; then
106-
echo "test-result=success" >> $GITHUB_OUTPUT
107-
echo "✅ Testes executados com sucesso"
108-
else
109-
echo "test-result=failure" >> $GITHUB_OUTPUT
110-
echo "❌ Testes falharam"
111-
fi
112-
113-
# Extrai resumo (últimas linhas do pytest)
114-
summary=$(echo "$output" | tail -n 5)
115-
echo "test-summary<<EOF" >> $GITHUB_OUTPUT
116-
echo "$summary" >> $GITHUB_OUTPUT
117-
echo "EOF" >> $GITHUB_OUTPUT
118-
119-
# Mantém o exit code original
120-
exit $exit_code
84+
- name: Upload test results
85+
uses: actions/upload-artifact@4f13853508778d738daafeade4e66f3c3c90998e
86+
with:
87+
name: pytest-results
88+
path: ./tmp/mgccli-source/pytest_output.txt
89+
retention-days: 1
90+

0 commit comments

Comments
 (0)