diff --git a/.github/workflows/quality-gate.yml b/.github/workflows/quality-gate.yml index 9acdc14..028daff 100644 --- a/.github/workflows/quality-gate.yml +++ b/.github/workflows/quality-gate.yml @@ -75,7 +75,20 @@ jobs: - name: 🧪 Run Tests with Pytest run: | + set +e pytest tests --junitxml=pytest.xml --cov=scouter --cov-report=xml --cov-report=term + PYTEST_EXIT_CODE=$? + set -e + + if [ $PYTEST_EXIT_CODE -eq 0 ]; then + echo "Pytest executado com sucesso." + elif [ $PYTEST_EXIT_CODE -eq 5 ]; then + echo "Pytest finalizado com código 5 (Nenhum teste encontrado). Tratando como sucesso para este workflow." + exit 0 + else + echo "Pytest falhou com código de saída $PYTEST_EXIT_CODE." + exit $PYTEST_EXIT_CODE + fi - name: 📊 Run SonarQube Analysis env: