From 251317898041904428e55f563f7ce26b0f7c93dd Mon Sep 17 00:00:00 2001 From: Andres Caicedo <73312784+AndresCdo@users.noreply.github.com> Date: Fri, 12 May 2023 02:19:52 +0200 Subject: [PATCH] Integrate pytest-xdist Plugin for Parallel and Concurrent Testing (#3870) * Adds pytest-parallel dependencies * Implement pytest-parallel for faster tests * Uses pytest-xdist * Auto number of workers processes * Update ci.yml --------- Co-authored-by: Nicholas Tindle --- .github/workflows/ci.yml | 2 +- .github/workflows/docker-ci.yml | 2 +- requirements.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a08ecb02114b..f21a263ef2a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: - name: Run unittest tests with coverage run: | - pytest --cov=autogpt --cov-report term-missing --cov-branch --cov-report xml --cov-report term + pytest -n auto --cov=autogpt --cov-report term-missing --cov-branch --cov-report xml --cov-report term env: CI: true diff --git a/.github/workflows/docker-ci.yml b/.github/workflows/docker-ci.yml index 28576d02a8ee..315c42e5ec13 100644 --- a/.github/workflows/docker-ci.yml +++ b/.github/workflows/docker-ci.yml @@ -101,7 +101,7 @@ jobs: set +e test_output=$( docker run --env CI --env OPENAI_API_KEY --entrypoint python ${{ env.IMAGE_NAME }} -m \ - pytest --cov=autogpt --cov-report term-missing --cov-branch --cov-report xml --cov-report term 2>&1 + pytest -n auto --cov=autogpt --cov-report term-missing --cov-branch --cov-report xml --cov-report term 2>&1 ) test_failure=$? diff --git a/requirements.txt b/requirements.txt index e1900ef5360f..be015f2b0a44 100644 --- a/requirements.txt +++ b/requirements.txt @@ -53,3 +53,4 @@ pytest-integration pytest-mock vcrpy pytest-recording +pytest-xdist \ No newline at end of file