Skip to content

Commit 8d98aea

Browse files
committed
Set AWS_REQUEST_CHECKSUM_CALCULATION when using moto
A recent change to boto3 includes integrety checks inline in responses, which doesn't work with moto: boto/boto3#4392 A workaround is suggested in this ticket, which we use here: boto/boto3#4435
1 parent 571ecb8 commit 8d98aea

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

.github/workflows/actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on: [push, pull_request]
33

44
jobs:
55
test-client:
6-
runs-on: ubuntu-20.04
6+
runs-on: ubuntu-22.04
77
strategy:
88
matrix:
99
python: [3.8, 3.9, "3.10", 3.12]

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ test-client: docker
1515
docker run --rm --entrypoint tox $(IMAGE) -c /opt/client/tox.ini
1616

1717
test-ingester: docker
18-
docker run --rm --entrypoint py.test $(IMAGE) ingester
18+
docker run --rm --entrypoint py.test $(IMAGE) -vv ingester
1919

2020
test-api: docker
21-
docker run --rm --entrypoint py.test $(IMAGE) api
21+
docker run --rm --entrypoint py.test $(IMAGE) -vv api
2222

2323
.PHONY: test # Run the tests
2424
test:

api/tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import pytest
1616
import boto3
17+
import os
1718
from botocore.exceptions import (
1819
ClientError as BotoClientError,
1920
NoCredentialsError
@@ -24,7 +25,8 @@
2425
from datalake.tests import * # noqa
2526
from datalake.common import DatalakeRecord
2627
from datalake.tests import generate_random_metadata
27-
28+
os.environ["AWS_REQUEST_CHECKSUM_CALCULATION"] = "when_required"
29+
os.environ["AWS_RESPONSE_CHECKSUM_VALIDATION"] = "when_required"
2830

2931
YEAR_2010 = 1262304000000
3032

ingester/tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
from datalake_ingester import SQSQueue
2020

21+
os.environ["AWS_REQUEST_CHECKSUM_CALCULATION"] = "when_required"
22+
os.environ["AWS_RESPONSE_CHECKSUM_VALIDATION"] = "when_required"
2123

2224
@pytest.fixture
2325
def dynamodb_connection(aws_connector):

0 commit comments

Comments
 (0)