Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat ✨: use tox in test job #70

Open
JCZuurmond opened this issue Feb 28, 2021 · 2 comments
Open

Feat ✨: use tox in test job #70

JCZuurmond opened this issue Feb 28, 2021 · 2 comments
Labels
backlog Identified as a backlog item, often combined with low-priority and help-wanted labels type: enhancement New feature or request

Comments

@JCZuurmond
Copy link

Describe Request:

Use tox to run your test suite with the test job - next to unittest and pytest.

Examples:

I would expect the following to work:

- python/test:
   pkg-manager: pip
   test-tool: tox

It would be nice to add another parameter tox-posargs to interactively pass positional arguments to tox.

Supporting Documentation Links:

tox

@dsayling
Copy link
Contributor

dsayling commented Mar 1, 2021

@JCZuurmond - I would love to add tox support in a more useful way - I'm afraid of adding tox support to the existing job and having some users expect it to scale effectively (i.e. easily use/create a separate env for each python version). Ultimately, I think a proper tox job should be created soon that can take advantage of some of the features planned for monorepo support. Features for monorepo support might allow us to parse the envlist from the tox.ini to properly run the workflows with the right parameters to easily parallelize the env tests.

For now, you should be able to get a tox job going like this. It should theoretically also cache the python versions (and tox) for you, but if the envlist changes, you might need to release/rebuild the cache

  version: 2.1
  orbs:
    python: circleci/[email protected]
  workflows:
    main:
      jobs:
        - build
  jobs:
    build:
      docker:
        - image: cimg/python:3.8.7
      steps:
        - checkout
        # This will cache the other python versions we installed
        - python/install-packages:
            pkg-manager: pip
            args: tox
            pypi-cache: true
            venv-cache: false
            pre-install-steps:
              - run: pyenv install 3.7.8
              - run: pyenv install 2.7.18
              - run: pyenv local 3.8.7 3.7.8 2.7.18
        - run:
            name: "Run tox"
            command: tox

@gmemstr
Copy link
Contributor

gmemstr commented Nov 5, 2021

I'm on the fence about the solution @dsayling described being incorporated into the orb, creating a make-tox command to generate a group of tox workflows. On the flipside, I'm unsure how easy this would be using our standard bash methods, especially if we have to combine with other orbs/commands/what have you (since we'd have to parse yaml to properly generate/merge changes).

@Jaryt Jaryt added type: enhancement New feature or request and removed enhancement labels Feb 9, 2022
@Jaryt Jaryt added the backlog Identified as a backlog item, often combined with low-priority and help-wanted labels label Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Identified as a backlog item, often combined with low-priority and help-wanted labels type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants