Skip to content

Commit

Permalink
issue #177 - fix skipping of integration tests for PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
jantman committed Apr 27, 2016
1 parent b2127a6 commit 50ed08b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changelog
Pre-release (develop branch)
----------------------------

* `#177 <https://github.com/jantman/awslimitchecker/issues/177>`_ Integration tests weren't being properly skipped for PRs.

0.4.1 (2016-03-15)
------------------

Expand Down
15 changes: 12 additions & 3 deletions awslimitchecker/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@
REGION = 'us-west-2'
MFA_CODE = None


@pytest.mark.integration
@pytest.mark.skipif(
skip_if_pr = pytest.mark.skipif(
os.environ.get('TRAVIS_PULL_REQUEST', None) != 'false',
reason='Not running integration tests for pull request'
)

@pytest.mark.integration
@skip_if_pr
class TestIntegration(object):
"""
!!!!!!IMPORTANT NOTE!!!!!!!
Expand All @@ -87,6 +88,7 @@ def setup(self):
# capture the AWS-related env vars

@pytest.mark.integration
@skip_if_pr
def verify_limits(self, checker_args, creds, service_name, use_ta,
expect_api_source):
"""
Expand Down Expand Up @@ -165,6 +167,7 @@ def verify_limits(self, checker_args, creds, service_name, use_ta,
"Advisor once, but polled %s times" % polls

@pytest.mark.integration
@skip_if_pr
def verify_usage(self, checker_args, creds, service_name, expect_usage):
"""
This essentially replicates what's done when awslimitchecker is called
Expand Down Expand Up @@ -234,6 +237,7 @@ def verify_usage(self, checker_args, creds, service_name, expect_usage):
"messages at WARN or higher: \n%s" % "\n".join(records)

@pytest.mark.integration
@skip_if_pr
def test_default_creds_all_services(self):
"""Test running alc with all services enabled"""
creds = self.normal_creds()
Expand All @@ -243,6 +247,7 @@ def test_default_creds_all_services(self):
yield "usage", self.verify_usage, checker_args, creds, None, True

@pytest.mark.integration
@skip_if_pr
def test_default_creds_each_service(self):
"""test running one service at a time for all services"""
creds = self.normal_creds()
Expand All @@ -267,6 +272,7 @@ def test_default_creds_each_service(self):
###########################################################################

@pytest.mark.integration
@skip_if_pr
def test_sts(self):
"""test normal STS role"""
creds = self.sts_creds()
Expand All @@ -280,6 +286,7 @@ def test_sts(self):
yield "VPC usage", self.verify_usage, checker_args, creds, 'VPC', True

@pytest.mark.integration
@skip_if_pr
def test_sts_external_id(self):
"""test STS role with external ID"""
creds = self.sts_creds()
Expand All @@ -294,6 +301,7 @@ def test_sts_external_id(self):
yield "VPC usage", self.verify_usage, checker_args, creds, 'VPC', True

@pytest.mark.integration
@skip_if_pr
def test_sts_mfa(self):
"""test STS role with MFA"""
creds = self.sts_mfa_creds()
Expand All @@ -309,6 +317,7 @@ def test_sts_mfa(self):
yield "VPC usage", self.verify_usage, checker_args, creds, 'VPC', True

@pytest.mark.integration
@skip_if_pr
def test_sts_mfa_external_id(self):
"""test STS role with MFA"""
creds = self.sts_mfa_creds()
Expand Down

0 comments on commit 50ed08b

Please sign in to comment.