From 8cb177cb2cbdc73850a73d8517bec5d3c5044cec Mon Sep 17 00:00:00 2001 From: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com> Date: Mon, 2 Oct 2023 19:51:34 +0200 Subject: [PATCH] Move Bot API Tests to Separate Workflow File (#3912) Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com> --- .github/workflows/test_official.yml | 47 +++++++++++++++++++ .../workflows/{test.yml => unit_tests.yml} | 35 -------------- 2 files changed, 47 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/test_official.yml rename .github/workflows/{test.yml => unit_tests.yml} (89%) diff --git a/.github/workflows/test_official.yml b/.github/workflows/test_official.yml new file mode 100644 index 000000000..cd3fe7e9c --- /dev/null +++ b/.github/workflows/test_official.yml @@ -0,0 +1,47 @@ +name: Bot API Tests +on: + pull_request: + branches: + - master + push: + branches: + - master + schedule: + # Run monday and friday morning at 03:07 - odd time to spread load on GitHub Actions + - cron: '7 3 * * 1,5' + +jobs: + check-conformity: + name: check-conformity + runs-on: ${{matrix.os}} + strategy: + matrix: + python-version: [3.11] + os: [ubuntu-latest] + fail-fast: False + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -W ignore -m pip install --upgrade pip + python -W ignore -m pip install -r requirements.txt + python -W ignore -m pip install -r requirements-opts.txt + python -W ignore -m pip install -r requirements-dev.txt + - name: Compare to official api + run: | + pytest -v tests/test_official.py --junit-xml=.test_report_official.xml + exit $? + env: + TEST_OFFICIAL: "true" + shell: bash --noprofile --norc {0} + + - name: Test Summary + id: test_summary + uses: test-summary/action@v2.1 + if: always() # always run, even if tests fail + with: + paths: .test_report_official.xml diff --git a/.github/workflows/test.yml b/.github/workflows/unit_tests.yml similarity index 89% rename from .github/workflows/test.yml rename to .github/workflows/unit_tests.yml index 9b893c850..3a3c251d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/unit_tests.yml @@ -92,38 +92,3 @@ jobs: env_vars: OS,PYTHON name: ${{ matrix.os }}-${{ matrix.python-version }} fail_ci_if_error: true - - test_official: - name: test-official - runs-on: ${{matrix.os}} - strategy: - matrix: - python-version: [3.11] - os: [ubuntu-latest] - fail-fast: False - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -W ignore -m pip install --upgrade pip - python -W ignore -m pip install -r requirements.txt - python -W ignore -m pip install -r requirements-opts.txt - python -W ignore -m pip install -r requirements-dev.txt - - name: Compare to official api - run: | - pytest -v tests/test_official.py --junit-xml=.test_report_official.xml - exit $? - env: - TEST_OFFICIAL: "true" - shell: bash --noprofile --norc {0} - - - name: Test Summary - id: test_summary - uses: test-summary/action@v2.1 - if: always() # always run, even if tests fail - with: - paths: .test_report_official.xml