From 0b273c96aa8f32fa0f38935736b6c0336580f3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 2 Feb 2023 10:56:27 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=E2=99=82=EF=B8=8F=20e2e:?= =?UTF-8?q?=20Add=20log=20check=20to=20e2e=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the e2e test caused any exceptions or the like in the server we want to know and fail. --- .github/workflows/build.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 697d18ee2..5a202f434 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -162,20 +162,36 @@ jobs: run: | npx playwright install-deps - - name: 🚀 Run Playwright + - name: 🎭 Run Playwright working-directory: ./tests/playwright run: | npx playwright test env: OCTOPRINT_SERVER_BASE: ${{ github.workspace }}/e2econfig - - name: ⬆ Upload report + - name: 🔎 Check octoprint.log for errors + run: | + log=${{ github.workspace }}/e2econfig/logs/octoprint.log + if grep "\- ERROR \-" $log; then + echo "::error::Errors were logged to octoprint.log" + grep -Pazo '(?m)^\N+\- ERROR \-\N*\n(^\N*?\n)*?(?=\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} \- )' $log + exit 1 + fi + + - name: ⬆ Upload Playwright report uses: actions/upload-artifact@v3 if: always() with: name: playwright-report path: tests/playwright/playwright-report + - name: ⬆ Upload OctoPrint logs + uses: actions/upload-artifact@v3 + if: fail() + with: + name: octoprint-logs + path: ${{ github.workspace }}/e2econfig/logs + publish-on-testpypi: name: 📦 Publish on TestPyPI if: github.event_name == 'release' && github.repository == 'OctoPrint/OctoPrint'