Skip to content
CodeKruPro

Read the workflow: how many test jobs run?

QuizEasy-Medium

Read the workflow.

.github/workflows/ui-tests.yml

name: ui-tests

on:
  push:
    branches: [main]
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.11", "3.12"]
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-python@v7
        with:
          python-version: ${{ matrix.python-version }}
      - run: pip install -r requirements.txt
      - run: pytest -n 4 --junitxml=report.xml
        env:
          TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
      - uses: actions/upload-artifact@v7
        if: always()
        with:
          name: report-${{ matrix.python-version }}
          path: report.xml

How many test jobs run for one push to main?

  • Two: one per Python version in the matrix
  • One
  • Eight, because of -n 4
  • None: the workflow only runs on pull requests

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in