From 57d33ee6da6222594a889d47f0f5904075e14ab1 Mon Sep 17 00:00:00 2001 From: bogdankostic Date: Wed, 20 Sep 2023 11:54:41 +0200 Subject: [PATCH] ci: Run preview integration tests in CI (#5843) * Run preview integration tests in CI * Only install inference extra --- .github/workflows/tests.yml | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e1675fa6b5..21c7d2a5bd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -824,6 +824,60 @@ jobs: - "branch:${{ github.ref_name }}" - "url:https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + integration-tests-preview: + name: Integration / Preview / ${{ matrix.os }} + needs: + - unit-tests + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Install Haystack + run: pip install .[dev,inference] + + - name: Run tests + run: | + pytest --maxfail=5 -m "integration" test/preview + + - name: Calculate alert data + id: calculator + shell: bash + if: (success() || failure()) && github.ref_name == 'main' + run: | + if [ "${{ job.status }}" = "success" ]; then + echo "alert_type=success" >> "$GITHUB_OUTPUT"; + else + echo "alert_type=error" >> "$GITHUB_OUTPUT"; + fi + + - name: Send event to Datadog + if: (success() || failure()) && github.ref_name == 'main' + uses: masci/datadog@v1 + with: + api-key: ${{ secrets.CORE_DATADOG_API_KEY }} + api-url: https://api.datadoghq.eu + events: | + - title: "${{ github.workflow }} workflow" + text: "Job ${{ github.job }} in branch ${{ github.ref_name }}" + alert_type: "${{ steps.calculator.outputs.alert_type }}" + source_type_name: "Github" + host: ${{ github.repository_owner }} + tags: + - "project:${{ github.repository }}" + - "job:${{ github.job }}" + - "run_id:${{ github.run_id }}" + - "workflow:${{ github.workflow }}" + - "branch:${{ github.ref_name }}" + - "url:https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + catch-all: name: Catch-all check runs-on: ubuntu-latest @@ -843,6 +897,7 @@ jobs: - integration-tests-memory - integration-tests-promptnode - integration-tests-agents + - integration-tests-preview steps: - name: Finisher