twisted / txaws

Twisted-based Asynchronous Libraries for Amazon Web Services and clouds that support the AWS APIs
MIT License
32 stars 18 forks source link

travis-ci no longer runs the integration tests #66

Closed exarkun closed 7 years ago

exarkun commented 7 years ago

It complains that the environment variables giving the aws credentials are missing.

exarkun commented 7 years ago

Some logging of os.environ in the setUp / tearDown for EC2ClientTestCase suggests that test_init_no_creds is clearing the environment:

    test_init_no_creds ... setUp
{'PYTHON_CFLAGS': '-g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security', '_system_name': 'Ubuntu', 'TRAVIS_SUDO': 'false', 'TRAVIS_LANGUAGE': 'python', 'CONTINUOUS_INTEGRATION': 'true', 'TRAVIS_PULL_REQUEST_BRANCH': 'what-is-wrong-with-travis-ci-integration-testing', 'rvm_version': '1.26.8 (1.26.8)', 'GOROOT': '/home/travis/.gimme/versions/go1.4.1.linux.amd64', 'rvm_path': '/home/travis/.rvm', 'MERB_ENV': 'test', 'TRAVIS': 'true', 'USER': 'travis', 'NVM_DIR': '/home/travis/.nvm', 'HOME': '/home/travis', 'TRAVIS_REPO_SLUG': 'twisted/txaws', 'PATH': '/home/travis/.rvm/gems/ruby-1.9.3-p551/bin:/home/travis/.rvm/gems/ruby-1.9.3-p551@global/bin:/home/travis/.rvm/rubies/ruby-1.9.3-p551/bin:/home/travis/.rvm/bin:/home/travis/virtualenv/python2.7.9/bin:/home/travis/bin:/home/travis/.local/bin:/opt/python/2.7.9/bin:/opt/python/2.6.9/bin:/opt/python/3.4.2/bin:/opt/python/3.3.5/bin:/opt/python/3.2.5/bin:/opt/python/pypy-2.5.0/bin:/opt/python/pypy3-2.4.0/bin:/usr/local/phantomjs/bin:/home/travis/.nvm/v0.10.36/bin:./node_modules/.bin:/usr/local/maven-3.2.5/bin:/usr/local/clang-3.4/bin:/home/travis/.gimme/versions/go1.4.1.linux.amd64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'TRAVIS_PULL_REQUEST': '65', 'NVM_IOJS_ORG_MIRROR': 'https://iojs.org/dist', 'rvm_autoupdate_flag': '0', 'rvm_silence_path_mismatch_check_flag': '1', 'TRAVIS_ALLOW_FAILURE': 'false', 'LANG': 'en_US.UTF-8', 'JRUBY_OPTS': '--client -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -Xcext.enabled=false -J-Xss2m -Xcompile.invokedynamic=false', 'TERM': 'xterm', 'SHELL': '/bin/bash', 'TRAVIS_COMMIT': '1a60e65f0d7c3a7fcddabba44bee968e63fe3f55', 'RAILS_ENV': 'test', 'TRAVIS_BRANCH': 'master', 'SHLVL': '1', 'TRAVIS_PULL_REQUEST_SHA': 'a1b3133b85fd3c4fd5271ce94de99d6e793b72af', 'TRAVIS_PULL_REQUEST_SLUG': 'exarkun/txaws', 'TXAWS_INTEGRATION_AWS_SECRET_ACCESS_KEY': 'bar', 'NVM_IOJS_ORG_VERSION_LISTING': 'https://iojs.org/dist/index.tab', '_system_arch': 'x86_64', 'NVM_BIN': '/home/travis/.nvm/v0.10.36/bin', 'NVM_PATH': '/home/travis/.nvm/v0.10.36/lib/node', 'GIT_ASKPASS': 'echo', 'VIRTUAL_ENV_DISABLE_PROMPT': 'true', 'TRAVIS_BUILD_ID': '228376018', 'PS4': '+', 'MANPATH': '/home/travis/.nvm/v0.10.36/share/man:/usr/local/clang-3.4/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man', 'DEBIAN_FRONTEND': 'noninteractive', 'JAVA_HOME': '/usr/lib/jvm/java-7-oracle', 'GEM_PATH': '/home/travis/.rvm/gems/ruby-1.9.3-p551:/home/travis/.rvm/gems/ruby-1.9.3-p551@global', 'COMPOSER_NO_INTERACTION': '1', 'rvm_bin_path': '/home/travis/.rvm/bin', 'CI': 'true', 'rvm_prefix': '/home/travis', 'TRAVIS_JOB_NUMBER': '184.1', 'TRAVIS_COMMIT_MESSAGE': 'Merge a1b3133b85fd3c4fd5271ce94de99d6e793b72af into 7a248e92d789a16bef22cf996486eab85190b3de', 'IRBRC': '/home/travis/.rvm/rubies/ruby-1.9.3-p551/.irbrc', '_system_type': 'Linux', 'TRAVIS_SECURE_ENV_VARS': 'false', 'MY_RUBY_HOME': '/home/travis/.rvm/rubies/ruby-1.9.3-p551', 'TXAWS_INTEGRATION_AWS_ACCESS_KEY_ID': 'foo', 'RUBY_VERSION': 'ruby-1.9.3-p551', 'TRAVIS_EVENT_TYPE': 'pull_request', 'CASHER_DIR': '/home/travis/.casher', 'container': 'docker', '_': '/home/travis/virtualenv/python2.7.9/bin/coverage', 'TRAVIS_TAG': '', 'TRAVIS_JOB_ID': '228376021', 'VIRTUAL_ENV': '/home/travis/virtualenv/python2.7.9', 'RACK_ENV': 'test', 'PYTHON_CONFIGURE_OPTS': '--enable-unicode=ucs4 --with-wide-unicode --enable-shared --enable-ipv6 --enable-loadable-sqlite-extensions --with-computed-gotos', 'PIP_DISABLE_PIP_VERSION_CHECK': '1', 'OLDPWD': '/home/travis/build', 'HOSTNAME': 'testing-docker-358129b1-f937-442d-97f8-9ba5f7694d54', 'TRAVIS_BUILD_NUMBER': '184', 'TRAVIS_BUILD_DIR': '/home/travis/build/twisted/txaws', 'TRAVIS_PYTHON_VERSION': '2.7', 'PWD': '/home/travis/build/twisted/txaws', 'TRAVIS_OS_NAME': 'linux', '_system_version': '12.04', 'TRAVIS_COMMIT_RANGE': '7a248e92d789a16bef22cf996486eab85190b3de...a1b3133b85fd3c4fd5271ce94de99d6e793b72af', 'HAS_ANTARES_THREE_LITTLE_FRONZIES_BADGE': 'true', 'PAGER': 'cat', 'GEM_HOME': '/home/travis/.rvm/gems/ruby-1.9.3-p551', 'HAS_JOSH_K_SEAL_OF_APPROVAL': 'true', 'NVM_NODEJS_ORG_MIRROR': 'https://nodejs.org/dist'}
tearDown
{}
exarkun commented 7 years ago

test_init_no_creds does:

        self.addCleanup(os.environ.clear)
        self.addCleanup(os.environ.update, os.environ.copy())

https://docs.python.org/2/library/unittest.html#unittest.TestCase.addCleanup says cleanups are processed in reverse order that they were added. So the order should be reversed, presumably.

However, this problem doesn't occur when I run the tests locally. That doesn't exactly fit with this explanation of the problem.

exarkun commented 7 years ago

Ah, the failure to reproduce locally was due to running the wrong version of the code. :(