CircleCI-Public / python-orb

Common CircleCI tasks for the Python programming language.
https://circleci.com/developer/orbs/orb/circleci/python
MIT License
14 stars 37 forks source link

Feat: add executor parameter to test job #107

Closed abriemme closed 2 weeks ago

abriemme commented 2 years ago

Describe Request:

We should add a executor parameter to the test job in order to use another executor, allowing multiple docker images (like adding postgres image to the python ones).

Examples:

Adding a executor parameter:

version: 2.1

orbs:
    python: circleci/python@2.1.1

executors:
    python_with_postgres:
        docker:
            - image: cimg/python:3.10
              environment:
                - DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres
            - image: cimg/postgres
              environment:
                - POSTGRES_DB=postgres
                - POSTGRES_USER=postgres
                - POSTGRES_PASSWORD=postgres
workflows:
  test:
    jobs:
      - python/test:
          executor: python_with_postgres

Supporting Documentation Links:

The maven-orb already have this parameter

Jaryt commented 2 years ago

We're moving towards standardizing the executor being parameterized in jobs to provide more flexibility in orbs. In this case it is a little unfortunate since we currently have the "version" parameter, and the two are mutually exclusive. Therefore to implement this it would be a breaking change and would need to be shelfed for the next major version.