chore(tests): Avoid network, sleep and more during tests #7306
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: 'E2E Backend Tests' | |
| on: | |
| pull_request: | |
| # The e2e suite drives backends over gRPC directly and reads none of these | |
| # paths, so a diff confined to them cannot move it. | |
| # See .agents/ci-caching.md. | |
| paths-ignore: | |
| - 'gallery/**' | |
| - 'docs/**' | |
| - 'examples/**' | |
| - '**/*.md' | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - '*' | |
| concurrency: | |
| group: ci-tests-e2e-backend-${{ github.event.pull_request.number || github.sha }}-${{ github.repository }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| tests-e2e-backend: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| go-version: ['1.25.x'] | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: true | |
| - name: Configure apt mirror on runner | |
| uses: ./.github/actions/configure-apt-mirror | |
| - name: Setup Go ${{ matrix.go-version }} | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| cache: false | |
| - name: Display Go version | |
| run: go version | |
| - name: Proto Dependencies | |
| run: | | |
| # Install protoc | |
| curl -L -s https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-linux-x86_64.zip -o protoc.zip && \ | |
| unzip -j -d /usr/local/bin protoc.zip bin/protoc && \ | |
| rm protoc.zip | |
| go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2 | |
| go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@1958fcbe2ca8bd93af633f11e97d44e567e945af | |
| PATH="$PATH:$HOME/go/bin" make protogen-go | |
| - name: Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential libopus-dev | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '22' | |
| - name: Build React UI | |
| run: make react-ui | |
| - name: Record declared distributed test resources | |
| run: LOCALAI_TEST_RESOURCES_ONLINE=1 make update-offline-test-cache TEST_RESOURCE_SET=distributed-e2e | |
| - name: Test Backend E2E | |
| run: | | |
| PATH="$PATH:$HOME/go/bin" make build-mock-backend test-e2e | |
| PATH="$PATH:$HOME/go/bin" make test-e2e-distributed | |
| - name: Setup tmate session if tests fail | |
| if: ${{ failure() }} | |
| uses: mxschmitt/action-tmate@v3.23 | |
| with: | |
| detached: true | |
| connect-timeout-seconds: 180 | |
| limit-access-to-actor: true |