Update unit tests to allow skip if AWS API flood
on Github a lot of API tests will fail with "T001" flooding, so we just skip them
This commit is contained in:
34
.github/workflows/ci.yml
vendored
34
.github/workflows/ci.yml
vendored
@@ -30,20 +30,20 @@ jobs:
|
|||||||
key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"
|
key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"
|
||||||
# We need to use phpunit from the self install to get the class paths
|
# We need to use phpunit from the self install to get the class paths
|
||||||
# Skip auto tests here, there are too many problems with flooding of the AWS API from github
|
# Skip auto tests here, there are too many problems with flooding of the AWS API from github
|
||||||
# - name: PHPunit Tests Prepare
|
- name: PHPunit Tests Prepare
|
||||||
# env:
|
env:
|
||||||
# AWS_GIFT_CARD_ENDPOINT: "${{ secrets.AWS_GIFT_CARD_ENDPOINT }}"
|
AWS_GIFT_CARD_ENDPOINT: "${{ secrets.AWS_GIFT_CARD_ENDPOINT }}"
|
||||||
# AWS_GIFT_CARD_KEY: "${{ secrets.AWS_GIFT_CARD_KEY }}"
|
AWS_GIFT_CARD_KEY: "${{ secrets.AWS_GIFT_CARD_KEY }}"
|
||||||
# AWS_GIFT_CARD_SECRET: "${{ secrets.AWS_GIFT_CARD_SECRET }}"
|
AWS_GIFT_CARD_SECRET: "${{ secrets.AWS_GIFT_CARD_SECRET }}"
|
||||||
# AWS_GIFT_CARD_PARTNER_ID: "${{ secrets.AWS_GIFT_CARD_PARTNER_ID }}"
|
AWS_GIFT_CARD_PARTNER_ID: "${{ secrets.AWS_GIFT_CARD_PARTNER_ID }}"
|
||||||
# AWS_GIFT_CARD_CURRENCY: "${{ secrets.AWS_GIFT_CARD_CURRENCY }}"
|
AWS_GIFT_CARD_CURRENCY: "${{ secrets.AWS_GIFT_CARD_CURRENCY }}"
|
||||||
# run: |
|
run: |
|
||||||
# echo "AWS_GIFT_CARD_ENDPOINT=${AWS_GIFT_CARD_ENDPOINT}" > test/.env;
|
echo "AWS_GIFT_CARD_ENDPOINT=${AWS_GIFT_CARD_ENDPOINT}" > test/.env;
|
||||||
# echo "AWS_GIFT_CARD_KEY=${AWS_GIFT_CARD_KEY}" >> test/.env;
|
echo "AWS_GIFT_CARD_KEY=${AWS_GIFT_CARD_KEY}" >> test/.env;
|
||||||
# echo "AWS_GIFT_CARD_SECRET=${AWS_GIFT_CARD_SECRET}" >> test/.env;
|
echo "AWS_GIFT_CARD_SECRET=${AWS_GIFT_CARD_SECRET}" >> test/.env;
|
||||||
# echo "AWS_GIFT_CARD_PARTNER_ID=${AWS_GIFT_CARD_PARTNER_ID}" >> test/.env;
|
echo "AWS_GIFT_CARD_PARTNER_ID=${AWS_GIFT_CARD_PARTNER_ID}" >> test/.env;
|
||||||
# echo "AWS_GIFT_CARD_CURRENCY=${AWS_GIFT_CARD_CURRENCY}" >> test/.env;
|
echo "AWS_GIFT_CARD_CURRENCY=${AWS_GIFT_CARD_CURRENCY}" >> test/.env;
|
||||||
# echo "AWS_DEBUG=1" >> test/.env;
|
echo "AWS_DEBUG=1" >> test/.env;
|
||||||
# - name: PHPunit Tests
|
- name: PHPunit Tests
|
||||||
# run: |
|
run: |
|
||||||
# vendor/bin/phpunit
|
vendor/bin/phpunit
|
||||||
|
|||||||
@@ -954,6 +954,11 @@ final class AmazonIncentivesTest extends TestCase
|
|||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$error = AmazonIncentives\Exceptions\AmazonErrors::decodeExceptionMessage($e->getMessage());
|
$error = AmazonIncentives\Exceptions\AmazonErrors::decodeExceptionMessage($e->getMessage());
|
||||||
|
if ($error['code'] == "T001") {
|
||||||
|
$this->markTestSkipped(
|
||||||
|
"Skipped because of flooding"
|
||||||
|
);
|
||||||
|
}
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
[
|
[
|
||||||
'code' => $expected_code,
|
'code' => $expected_code,
|
||||||
|
|||||||
Reference in New Issue
Block a user