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

failing tests for scheduled workflow #10546

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

change region to ap-northeast-1

76cc87f
Select commit
Failed to load commit list.
Sign in for the full log view
Draft

failing tests for scheduled workflow #10546

change region to ap-northeast-1
76cc87f
Select commit
Failed to load commit list.
GitHub Actions / LocalStack Community integration with Pro failed May 17, 2024 in 0s

3 fail, 301 skipped, 2 651 pass in 1h 35m 14s

    2 files  ±0      2 suites  ±0   1h 35m 14s ⏱️ -54s
2 955 tests +5  2 651 ✅ +9  301 💤  - 3  3 ❌  - 1 
2 957 runs  +5  2 651 ✅ +9  303 💤  - 3  3 ❌  - 1 

Results for commit 76cc87f. ± Comparison against earlier commit e225949.

Annotations

Check warning on line 0 in tests.aws.services.events.test_events.TestEvents

See this annotation in the file changed.

@github-actions github-actions / LocalStack Community integration with Pro

test_api_destinations[auth0] (tests.aws.services.events.test_events.TestEvents) failed

pytest-junit-community-1.xml [took 9s]
Raw output
IndexError: list index out of range
self = <tests.aws.services.events.test_events.TestEvents object at 0x7f5a7a0fc750>
httpserver = <HTTPServer host=localhost port=46441>
auth = {'key': 'BasicAuthParameters', 'parameters': {'Password': 'pass', 'Username': 'user'}, 'type': 'BASIC'}
aws_client = <localstack.aws.connect.ServiceLevelClientFactory object at 0x7f5a7433f850>
clean_up = <function clean_up.<locals>._clean_up at 0x7f5a56e5a340>

    @markers.aws.unknown
    @pytest.mark.parametrize("auth", API_DESTINATION_AUTHS)
    @pytest.mark.skipif(is_v2_provider(), reason="V2 provider does not support this feature yet")
    def test_api_destinations(self, httpserver: HTTPServer, auth, aws_client, clean_up):
        token = short_uid()
        bearer = f"Bearer {token}"
    
        def _handler(_request: Request):
            return Response(
                json.dumps(
                    {
                        "access_token": token,
                        "token_type": "Bearer",
                        "expires_in": 86400,
                    }
                ),
                mimetype="application/json",
            )
    
        httpserver.expect_request("").respond_with_handler(_handler)
        http_endpoint = httpserver.url_for("/")
    
        if auth.get("type") == "OAUTH_CLIENT_CREDENTIALS":
            auth["parameters"]["AuthorizationEndpoint"] = http_endpoint
    
        connection_name = f"c-{short_uid()}"
        connection_arn = aws_client.events.create_connection(
            Name=connection_name,
            AuthorizationType=auth.get("type"),
            AuthParameters={
                auth.get("key"): auth.get("parameters"),
                "InvocationHttpParameters": {
                    "BodyParameters": [
                        {
                            "Key": "connection_body_param",
                            "Value": "value",
                            "IsValueSecret": False,
                        },
                    ],
                    "HeaderParameters": [
                        {
                            "Key": "connection-header-param",
                            "Value": "value",
                            "IsValueSecret": False,
                        },
                        {
                            "Key": "overwritten-header",
                            "Value": "original",
                            "IsValueSecret": False,
                        },
                    ],
                    "QueryStringParameters": [
                        {
                            "Key": "connection_query_param",
                            "Value": "value",
                            "IsValueSecret": False,
                        },
                        {
                            "Key": "overwritten_query",
                            "Value": "original",
                            "IsValueSecret": False,
                        },
                    ],
                },
            },
        )["ConnectionArn"]
    
        # create api destination
        dest_name = f"d-{short_uid()}"
        result = aws_client.events.create_api_destination(
            Name=dest_name,
            ConnectionArn=connection_arn,
            InvocationEndpoint=http_endpoint,
            HttpMethod="POST",
        )
    
        # create rule and target
        rule_name = f"r-{short_uid()}"
        target_id = f"target-{short_uid()}"
        pattern = json.dumps({"source": ["source-123"], "detail-type": ["type-123"]})
        aws_client.events.put_rule(Name=rule_name, EventPattern=pattern)
        aws_client.events.put_targets(
            Rule=rule_name,
            Targets=[
                {
                    "Id": target_id,
                    "Arn": result["ApiDestinationArn"],
                    "Input": '{"target_value":"value"}',
                    "HttpParameters": {
                        "PathParameterValues": ["target_path"],
                        "HeaderParameters": {
                            "target-header": "target_header_value",
                            "overwritten_header": "changed",
                        },
                        "QueryStringParameters": {
                            "target_query": "t_query",
                            "overwritten_query": "changed",
                        },
                    },
                }
            ],
        )
    
        entries = [
            {
                "Source": "source-123",
                "DetailType": "type-123",
                "Detail": '{"i": 0}',
            }
        ]
        aws_client.events.put_events(Entries=entries)
    
        # clean up
        aws_client.events.delete_connection(Name=connection_name)
        aws_client.events.delete_api_destination(Name=dest_name)
        clean_up(rule_name=rule_name, target_ids=target_id)
    
        to_recv = 2 if auth["type"] == "OAUTH_CLIENT_CREDENTIALS" else 1
        poll_condition(lambda: len(httpserver.log) >= to_recv, timeout=5)
    
>       event_request, _ = httpserver.log[-1]
E       IndexError: list index out of range

../localstack/tests/aws/services/events/test_events.py:480: IndexError

Check warning on line 0 in tests.aws.services.events.test_events.TestEvents

See this annotation in the file changed.

@github-actions github-actions / LocalStack Community integration with Pro

test_api_destinations[auth1] (tests.aws.services.events.test_events.TestEvents) failed

pytest-junit-community-1.xml [took 13s]
Raw output
IndexError: list index out of range
self = <tests.aws.services.events.test_events.TestEvents object at 0x7f5a7a0fca10>
httpserver = <HTTPServer host=localhost port=46441>
auth = {'key': 'ApiKeyAuthParameters', 'parameters': {'ApiKeyName': 'Api', 'ApiKeyValue': 'apikey_secret'}, 'type': 'API_KEY'}
aws_client = <localstack.aws.connect.ServiceLevelClientFactory object at 0x7f5a7433f850>
clean_up = <function clean_up.<locals>._clean_up at 0x7f59c2158180>

    @markers.aws.unknown
    @pytest.mark.parametrize("auth", API_DESTINATION_AUTHS)
    @pytest.mark.skipif(is_v2_provider(), reason="V2 provider does not support this feature yet")
    def test_api_destinations(self, httpserver: HTTPServer, auth, aws_client, clean_up):
        token = short_uid()
        bearer = f"Bearer {token}"
    
        def _handler(_request: Request):
            return Response(
                json.dumps(
                    {
                        "access_token": token,
                        "token_type": "Bearer",
                        "expires_in": 86400,
                    }
                ),
                mimetype="application/json",
            )
    
        httpserver.expect_request("").respond_with_handler(_handler)
        http_endpoint = httpserver.url_for("/")
    
        if auth.get("type") == "OAUTH_CLIENT_CREDENTIALS":
            auth["parameters"]["AuthorizationEndpoint"] = http_endpoint
    
        connection_name = f"c-{short_uid()}"
        connection_arn = aws_client.events.create_connection(
            Name=connection_name,
            AuthorizationType=auth.get("type"),
            AuthParameters={
                auth.get("key"): auth.get("parameters"),
                "InvocationHttpParameters": {
                    "BodyParameters": [
                        {
                            "Key": "connection_body_param",
                            "Value": "value",
                            "IsValueSecret": False,
                        },
                    ],
                    "HeaderParameters": [
                        {
                            "Key": "connection-header-param",
                            "Value": "value",
                            "IsValueSecret": False,
                        },
                        {
                            "Key": "overwritten-header",
                            "Value": "original",
                            "IsValueSecret": False,
                        },
                    ],
                    "QueryStringParameters": [
                        {
                            "Key": "connection_query_param",
                            "Value": "value",
                            "IsValueSecret": False,
                        },
                        {
                            "Key": "overwritten_query",
                            "Value": "original",
                            "IsValueSecret": False,
                        },
                    ],
                },
            },
        )["ConnectionArn"]
    
        # create api destination
        dest_name = f"d-{short_uid()}"
        result = aws_client.events.create_api_destination(
            Name=dest_name,
            ConnectionArn=connection_arn,
            InvocationEndpoint=http_endpoint,
            HttpMethod="POST",
        )
    
        # create rule and target
        rule_name = f"r-{short_uid()}"
        target_id = f"target-{short_uid()}"
        pattern = json.dumps({"source": ["source-123"], "detail-type": ["type-123"]})
        aws_client.events.put_rule(Name=rule_name, EventPattern=pattern)
        aws_client.events.put_targets(
            Rule=rule_name,
            Targets=[
                {
                    "Id": target_id,
                    "Arn": result["ApiDestinationArn"],
                    "Input": '{"target_value":"value"}',
                    "HttpParameters": {
                        "PathParameterValues": ["target_path"],
                        "HeaderParameters": {
                            "target-header": "target_header_value",
                            "overwritten_header": "changed",
                        },
                        "QueryStringParameters": {
                            "target_query": "t_query",
                            "overwritten_query": "changed",
                        },
                    },
                }
            ],
        )
    
        entries = [
            {
                "Source": "source-123",
                "DetailType": "type-123",
                "Detail": '{"i": 0}',
            }
        ]
        aws_client.events.put_events(Entries=entries)
    
        # clean up
        aws_client.events.delete_connection(Name=connection_name)
        aws_client.events.delete_api_destination(Name=dest_name)
        clean_up(rule_name=rule_name, target_ids=target_id)
    
        to_recv = 2 if auth["type"] == "OAUTH_CLIENT_CREDENTIALS" else 1
        poll_condition(lambda: len(httpserver.log) >= to_recv, timeout=5)
    
>       event_request, _ = httpserver.log[-1]
E       IndexError: list index out of range

../localstack/tests/aws/services/events/test_events.py:480: IndexError

Check warning on line 0 in tests.aws.services.events.test_events.TestEvents

See this annotation in the file changed.

@github-actions github-actions / LocalStack Community integration with Pro

test_api_destinations[auth2] (tests.aws.services.events.test_events.TestEvents) failed

pytest-junit-community-1.xml [took 13s]
Raw output
KeyError: 'connection_body_param'
self = <tests.aws.services.events.test_events.TestEvents object at 0x7f5a7a0fd550>
httpserver = <HTTPServer host=localhost port=46441>
auth = {'key': 'OAuthParameters', 'parameters': {'AuthorizationEndpoint': 'http://localhost:46441/', 'ClientParameters': {'Cl... 'value2'}], 'QueryStringParameters': [{'Key': 'oauthquery', 'Value': 'value3'}]}}, 'type': 'OAUTH_CLIENT_CREDENTIALS'}
aws_client = <localstack.aws.connect.ServiceLevelClientFactory object at 0x7f5a7433f850>
clean_up = <function clean_up.<locals>._clean_up at 0x7f5a563e5620>

    @markers.aws.unknown
    @pytest.mark.parametrize("auth", API_DESTINATION_AUTHS)
    @pytest.mark.skipif(is_v2_provider(), reason="V2 provider does not support this feature yet")
    def test_api_destinations(self, httpserver: HTTPServer, auth, aws_client, clean_up):
        token = short_uid()
        bearer = f"Bearer {token}"
    
        def _handler(_request: Request):
            return Response(
                json.dumps(
                    {
                        "access_token": token,
                        "token_type": "Bearer",
                        "expires_in": 86400,
                    }
                ),
                mimetype="application/json",
            )
    
        httpserver.expect_request("").respond_with_handler(_handler)
        http_endpoint = httpserver.url_for("/")
    
        if auth.get("type") == "OAUTH_CLIENT_CREDENTIALS":
            auth["parameters"]["AuthorizationEndpoint"] = http_endpoint
    
        connection_name = f"c-{short_uid()}"
        connection_arn = aws_client.events.create_connection(
            Name=connection_name,
            AuthorizationType=auth.get("type"),
            AuthParameters={
                auth.get("key"): auth.get("parameters"),
                "InvocationHttpParameters": {
                    "BodyParameters": [
                        {
                            "Key": "connection_body_param",
                            "Value": "value",
                            "IsValueSecret": False,
                        },
                    ],
                    "HeaderParameters": [
                        {
                            "Key": "connection-header-param",
                            "Value": "value",
                            "IsValueSecret": False,
                        },
                        {
                            "Key": "overwritten-header",
                            "Value": "original",
                            "IsValueSecret": False,
                        },
                    ],
                    "QueryStringParameters": [
                        {
                            "Key": "connection_query_param",
                            "Value": "value",
                            "IsValueSecret": False,
                        },
                        {
                            "Key": "overwritten_query",
                            "Value": "original",
                            "IsValueSecret": False,
                        },
                    ],
                },
            },
        )["ConnectionArn"]
    
        # create api destination
        dest_name = f"d-{short_uid()}"
        result = aws_client.events.create_api_destination(
            Name=dest_name,
            ConnectionArn=connection_arn,
            InvocationEndpoint=http_endpoint,
            HttpMethod="POST",
        )
    
        # create rule and target
        rule_name = f"r-{short_uid()}"
        target_id = f"target-{short_uid()}"
        pattern = json.dumps({"source": ["source-123"], "detail-type": ["type-123"]})
        aws_client.events.put_rule(Name=rule_name, EventPattern=pattern)
        aws_client.events.put_targets(
            Rule=rule_name,
            Targets=[
                {
                    "Id": target_id,
                    "Arn": result["ApiDestinationArn"],
                    "Input": '{"target_value":"value"}',
                    "HttpParameters": {
                        "PathParameterValues": ["target_path"],
                        "HeaderParameters": {
                            "target-header": "target_header_value",
                            "overwritten_header": "changed",
                        },
                        "QueryStringParameters": {
                            "target_query": "t_query",
                            "overwritten_query": "changed",
                        },
                    },
                }
            ],
        )
    
        entries = [
            {
                "Source": "source-123",
                "DetailType": "type-123",
                "Detail": '{"i": 0}',
            }
        ]
        aws_client.events.put_events(Entries=entries)
    
        # clean up
        aws_client.events.delete_connection(Name=connection_name)
        aws_client.events.delete_api_destination(Name=dest_name)
        clean_up(rule_name=rule_name, target_ids=target_id)
    
        to_recv = 2 if auth["type"] == "OAUTH_CLIENT_CREDENTIALS" else 1
        poll_condition(lambda: len(httpserver.log) >= to_recv, timeout=5)
    
        event_request, _ = httpserver.log[-1]
        event = event_request.get_json(force=True)
        headers = event_request.headers
        query_args = event_request.args
    
        # Connection data validation
>       assert event["connection_body_param"] == "value"
E       KeyError: 'connection_body_param'

../localstack/tests/aws/services/events/test_events.py:486: KeyError