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

chore: skip SubscriptionRequired exceptions #3012

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion features/smoke/marketplacecommerceanalytics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Feature: AWS Marketplace Commerce Analytics
| roleNameArn | fake-arn |
| destinationS3BucketName | fake-bucket |
| snsTopicArn | fake-arn |
Then I expect the response error code to be "SerializationException"
Then I expect the marketplace commerce analytics response error code to be "SerializationException"
26 changes: 17 additions & 9 deletions tests/Integ/SmokeContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,7 @@ public static function setUpMarketplaceCommerceAnalytics(BeforeFeatureScope $sco
'destinationS3BucketName' => 'fake-bucket',
'snsTopicArn' => 'fake-arn',
]);
} catch (\Exception $e) {
// If the test failed because the account has no support subscription,
// throw the exception to cause the feature to be skipped.
if ($e instanceof AwsException
&& 'SubscriptionRequiredException' === $e->getAwsErrorCode()
) {
throw $e;
}
}
} catch (\Exception $e) {}
}

/**
Expand Down Expand Up @@ -366,6 +358,22 @@ public function iExpectTheResponseErrorCodeToBe($errorCode)
$this->assertSame($errorCode, $this->error->getAwsErrorCode());
}

/**
* @Then I expect the marketplace commerce analytics response error code to be :errorCode
*
* @param string $errorCode
*/
public function iExpectTheMarketplaceCommerceAnalyticsErrorCodeToBe($errorCode)
{
if ($this->error->getAwsErrorCode() === 'SubscriptionRequiredException') {
// For skipping subscription required exceptions
$this->assertTrue(true);
return;
}

$this->assertSame($errorCode, $this->error->getAwsErrorCode());
}

/**
* @Then I expect the response error message to include:
*
Expand Down