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

Test with pytest from master/features #79

Merged
merged 2 commits into from
Sep 6, 2017

Conversation

nicoddemus
Copy link
Member

Fix #76

The environment for pytest-features is failing because pytest currently pins pluggy to >=4.0,<5, so tox cannot create the environment.

I propose we change pytest's setup.py to optionally take the pluggy specification from an environment variable _PYTEST_SETUP_PLUGGY_SPEC if defined instead of what's encoded in setup.py, roughly:

def main():
    install_requires = ['py>=1.4.33', 'six>=1.10.0','setuptools', 'pluggy>=0.4.0,<0.5']

Into:

def main():
    pluggy_spec = os.environ.get('_PYTEST_SETUP_PLUGGY_SPEC', 'pluggy>=0.4.0,<0.5')
    install_requires = ['py>=1.4.33', 'six>=1.10.0','setuptools', pluggy_spec]

We will probably need to do something like that anyway for pytest-dev/pytest#2737.

tox.ini Outdated
pytest28: pytest~=2.8.0
pytest29: pytest~=2.9.0
pytest30: pytest~=3.0.0
pytest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why completely remove those?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we agreed that it didn't make sense to run the tests using old pytest versions given that those versions vendor pluggy anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should leave one with pytest 3.2 to have one "working" pytest version

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the pytest version we use for the normal test environments for all python versions, so we're covered. For example: https://travis-ci.org/pytest-dev/pluggy/jobs/270596649

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the "normal" builds (Python 2.6 and TOEXENV=py26) executes with the latest pytest.

tox.ini Outdated
git+https://github.com/pytest-dev/pytest.git@master

[testenv:pytest-features]
commands=py.test {posargs:testing/}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those could just be factors as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are not factors on purpose because I don't think we need to test pytest master and develop on all python versions again, only on py27 and py36 seems good enough to me to save CI time. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont have to express those factors for all python versions

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, and that's what I am doing here... perhaps I'm misunderstanding something, could you clarify.

For reference, take a look at the build matrix that was executed by this change: https://travis-ci.org/pytest-dev/pluggy/builds/270596643

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you made own environments, not factors

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @RonnyPfannschmidt, still don't know what you want me to do. 😕

Let me try to illustrate.

Right now we have the following builds:

py26  (pytest: 3.2.1)
py27  (pytest: 3.2.1) 
py34  (pytest: 3.2.1) 
py34  (pytest: 3.2.1) 
py35  (pytest: 3.2.1)
py36  (pytest: 3.2.1)
pypy  (pytest: 3.2.1)
py37  (pytest: 3.2.1)
benchmark (python: 2.7)
benchmark (python: 3.6)
check (python: 2.7)
check (python: 3.6)
docs (python: 3.6)
pytest-master  (python: 2.7, pytest: master)
pytest-master  (python: 3.6, pytest: master)
pytest-features  (python: 2.7, pytest: features)
pytest-features  (python: 3.6, pytest: features)

you made own environments, not factors

From this I understand you want me to change [envlist] to:

[tox]
envlist=check,py{26,27,34,35,36,py}-pytest{release,master,features}

But this would explode the builds matrix to:

py26  (pytest: 3.2.1)
py27  (pytest: 3.2.1) 
py34  (pytest: 3.2.1) 
py34  (pytest: 3.2.1) 
py35  (pytest: 3.2.1)
py36  (pytest: 3.2.1)
pypy  (pytest: 3.2.1)
py37  (pytest: 3.2.1)
py26  (pytest: master)
py27  (pytest: master) 
py34  (pytest: master) 
py34  (pytest: master) 
py35  (pytest: master)
py36  (pytest: master)
pypy  (pytest: master)
py37  (pytest: master)
py26  (pytest: features)
py27  (pytest: features) 
py34  (pytest: features) 
py34  (pytest: features) 
py35  (pytest: features)
py36  (pytest: features)
pypy  (pytest: features)
py37  (pytest: features)
benchmark (python: 2.7)
benchmark (python: 3.6)
check (python: 2.7)
check (python: 3.6)
docs (python: 3.6)

Is that it? If so I don't think we need it.

If that's not it, could you clarify then? If you know exactly what syntax you want feel free to write it as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

envlist=check,py{26,27,34,35,36,py}-pytestrelease,py{27,36}-pytest{master,features}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I think I got it now, thanks.

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

pytest28: pytest~=2.8.0
pytest29: pytest~=2.9.0
pytest30: pytest~=3.0.0
pytestrelease: pytest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 perfect

- python: '3.6'
env: TOXENV=check
- python: '3.6'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to say I've always found this a bit funny/redundant that we're routing through tox when Travis is really enabling the same thing via it's own job generation system. This include matrix just ends up being a big combo-list defeating the entire purpose. I think tox makes sense if you don't have a generative system built into your CI server already.

That's another thing tox doesn't support parallel jobs does it?
That's something that'd be super handy when testing locally.
I'd also be interested in using travis' stages to do docs and benchmarking runs in parallel with the regular suite.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

his include matrix just ends up being a big combo-list defeating the entire purpose. I think tox makes sense if you don't have a generative system built into your CI server already.

One reason to also use tox in this context is to avoid duplicating logic from it like dependency installation and such.

I'd also be interested in using travis' stages to do docs and benchmarking runs in parallel with the regular suite.

Actually all jobs already run in parallel, give or take Travis current work availability when the build runs.

@goodboy
Copy link
Contributor

goodboy commented Sep 2, 2017

@nicoddemus for this:

The environment for pytest-features is failing because pytest currently pins pluggy to >=4.0,<5, so tox cannot create the environment.

I'm not entirely following why this happens? Don't we already have 0.5.1 up?
Wait nm, got it. We're trying to install al local version which sits outside that interval.

Copy link
Contributor

@goodboy goodboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though I'm cranky about the matrix stuff ;) looks good!

@RonnyPfannschmidt
Copy link
Member

so pytest needs a fix before merging this one

@goodboy goodboy mentioned this pull request Sep 5, 2017
@nicoddemus
Copy link
Member Author

We don't need an actual release, we can trigger this build again once we merge pytest-dev/pytest#2744.

@nicoddemus
Copy link
Member Author

Tested locally by changing pytestfeatures to use pluggy-master from my fork and it works. 👍

@RonnyPfannschmidt
Copy link
Member

merging on your word then, thanks !

@RonnyPfannschmidt RonnyPfannschmidt merged commit b1b9de2 into pytest-dev:master Sep 6, 2017
@nicoddemus
Copy link
Member Author

Err, pytest-dev/pytest#2744 should have been merged first.

@nicoddemus nicoddemus deleted the ci-pytest branch September 6, 2017 16:12
@nicoddemus
Copy link
Member Author

Sorry if that was not clear.

@RonnyPfannschmidt
Copy link
Member

oh, whops - to me it did read like its tested and ready

@nicoddemus
Copy link
Member Author

No worries, let's merge pytest-dev/pytest#2744 asap then. 👍

@nicoddemus
Copy link
Member Author

I didn't manage to restart Travis, but AppVeyor restarted and worked so I think we are OK.

@goodboy
Copy link
Contributor

goodboy commented Sep 6, 2017

@nicoddemus i just restarted it. Badge should show the result.

@nicoddemus
Copy link
Member Author

It is not building the latest master for some reason (there's no pytestrelease/pytestfeatures envs): https://travis-ci.org/pytest-dev/pluggy/builds/254165070

No idea why is that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants