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

Error Running Integration Tests #1624

Closed
beck3905 opened this issue Dec 2, 2019 · 9 comments
Closed

Error Running Integration Tests #1624

beck3905 opened this issue Dec 2, 2019 · 9 comments

Comments

@beck3905
Copy link

beck3905 commented Dec 2, 2019

Description

I am getting an AttributeError when attempting to run integration tests on this repository after following all instructions from the development guide.

Briefly describe the bug you are facing.

Steps to reproduce

I just forked, cloned, and set up a dev environment for this repository. I followed the instructions in the Development Guide to

  1. install python versions with pyenv
  2. installed Black and pre-commit
  3. created and activated samcli37 virtualenv
  4. run make init
  5. run make pr
  6. run make integ-test

Observed result

____________________________________________________________________ ERROR collecting tests/integration/buildcmd/test_build_cmd.py _____________________________________________________________________ ../../.pyenv/versions/3.7.2/lib/python3.7/unittest/loader.py:235: in getTestCaseNames testFnNames = list(filter(shouldIncludeMethod, dir(testCaseClass))) ../../.pyenv/versions/3.7.2/lib/python3.7/unittest/loader.py:232: in shouldIncludeMethod fullName = '%s.%s' % (testCaseClass.__module__, testFunc.__qualname__) E AttributeError: 'MarkDecorator' object has no attribute '__qualname__'

Expected result

Integration tests to run and pass on fresh environment

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Mac OS 10.15.1
  2. sam --version: latest from repository
@jfuss
Copy link
Contributor

jfuss commented Dec 6, 2019

@beck3905 Thanks for the issue. My understanding is that this happens when there is an outdated unittest and or pytest on the system. A couple things you can try:

  • Update python3.7 to the latest version (I have 3.7.5 installed personally).
  • Ensure pytest is updated (should be 5.2.1)

Let me know if any of that works. There are some additional details here as well: #1464 (comment)

@sanathkr
Copy link
Contributor

sanathkr commented Dec 9, 2019

Closing as this is not a code bug. Feel free to reopen if you need help

@sanathkr sanathkr closed this as completed Dec 9, 2019
@beck3905
Copy link
Author

beck3905 commented Dec 9, 2019

@sanathkr I disagree. This may not be a bug with the application code, but I am still unable to successfully run integration tests on a brand new dev environment created from a newly forked version of this repository and following the Development Guide. That suggests that this is a bug in the Development Guide and the repository may not work as described in the Development Guide.

@beck3905
Copy link
Author

@jfuss I tried with different Python versions including 3.6.8 and 3.7.5 and I get different errors and still fail to run integration tests. One of the errors I saw was an import error for tomlkit despite seeing tomlkit installed in my virtualenv. All of my unit tests are passing and I have been able to successfully run samdev on a template on my local machine in my virtualenv.

@jfuss
Copy link
Contributor

jfuss commented Dec 10, 2019

@beck3905 Something is not right on your system then. You are probably getting resolved to a different python interpreter than the one you are expecting.

@johnc44
Copy link

johnc44 commented Feb 1, 2020

Same problem here. OSX, Installed pyenv and and other instructions in developer guide.
Python 3.7.2
Pytest 5.2.1

@francilioaraujo
Copy link
Contributor

I had the same issue. Solved creating a new environment for samcli37 with python 3.7.5.

@johnc44
Copy link

johnc44 commented Mar 7, 2020

Thanks @francilioaraujo - I installed python 3.7.5 and setup a new venv and the integration tests now run. (Previous venv was 3.7.2)

@YonYonita
Copy link

I've seen this happen on python 3.7 and pytest 6.2.5 when I placed the skip marker decorator above a parametrized decorator (so, the root cause was not the python-pytest versions, but rather the decorator's order, which probably made a mess out of the test function name). I hope this is helpful.

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

No branches or pull requests

6 participants