Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
ed15aad
integ
roger-zhangg Oct 22, 2025
c2bb33b
remove cred
roger-zhangg Oct 22, 2025
ecf95b8
fix multiple failures
roger-zhangg Oct 22, 2025
0bcbfa6
nit
roger-zhangg Oct 22, 2025
3c67cf9
nit2
roger-zhangg Oct 22, 2025
664cc03
nit3
roger-zhangg Oct 22, 2025
f654a14
nit4
roger-zhangg Oct 23, 2025
4ed12fd
nit o
roger-zhangg Oct 23, 2025
1fc5a5d
use test account
roger-zhangg Oct 23, 2025
8be6a5e
direct
roger-zhangg Oct 23, 2025
bd574e7
retry
roger-zhangg Oct 23, 2025
c962837
nit
roger-zhangg Oct 23, 2025
1612fd8
nit
roger-zhangg Oct 23, 2025
15547cc
fix multiple stuff
roger-zhangg Oct 24, 2025
c218a3d
move get cred after init
roger-zhangg Oct 24, 2025
76de15b
test
roger-zhangg Oct 24, 2025
d0782de
use maven version
roger-zhangg Oct 28, 2025
5f682a6
use original function
roger-zhangg Oct 29, 2025
8a13551
nit
roger-zhangg Oct 29, 2025
de07739
check ruby issue
roger-zhangg Oct 29, 2025
444c6cb
ruby
roger-zhangg Oct 29, 2025
caffa18
ruby 3.4
roger-zhangg Oct 29, 2025
e0ad3be
maven
roger-zhangg Oct 29, 2025
26a8d57
nit
roger-zhangg Oct 29, 2025
ce6c916
enable java 21
roger-zhangg Oct 29, 2025
71cceaf
finalize sync test
roger-zhangg Oct 29, 2025
c6150f9
test build integ test
roger-zhangg Oct 29, 2025
92629ea
split container/no container tests
roger-zhangg Oct 29, 2025
8bfcc4e
fix
roger-zhangg Oct 29, 2025
15cf1ac
fix container
roger-zhangg Oct 29, 2025
f8b823f
use -k correctly
roger-zhangg Oct 29, 2025
7749640
k
roger-zhangg Oct 29, 2025
f80595d
k2
roger-zhangg Oct 29, 2025
8b36964
kk
roger-zhangg Oct 29, 2025
b2076f9
split container/non-container integ test
roger-zhangg Oct 30, 2025
3a28473
revert test
roger-zhangg Oct 30, 2025
dd460dc
make sure in buildcmd, all container test has container in its name
roger-zhangg Oct 30, 2025
f3bd8de
fix test issues
roger-zhangg Oct 30, 2025
ab8a735
disk space
roger-zhangg Oct 30, 2025
3860bf4
tweak disk usage
roger-zhangg Oct 30, 2025
77d1134
rest
roger-zhangg Oct 30, 2025
3535bb7
nit
roger-zhangg Oct 31, 2025
12a5c9a
Merge branch 'develop' of github.com:aws/aws-sam-cli into integ
roger-zhangg Oct 31, 2025
56448da
n
roger-zhangg Oct 31, 2025
67832b5
n
roger-zhangg Oct 31, 2025
414b238
use secret
roger-zhangg Oct 31, 2025
bc79b1d
secr
roger-zhangg Oct 31, 2025
b522f54
n
roger-zhangg Oct 31, 2025
7e0fdfc
run all test
roger-zhangg Oct 31, 2025
d4a6f2c
m
roger-zhangg Oct 31, 2025
161f106
schedule
roger-zhangg Oct 31, 2025
8ffae55
Merge pull request #2 from roger-zhangg/integ
roger-zhangg Oct 31, 2025
ed9744e
test
roger-zhangg Oct 31, 2025
c533526
Merge pull request #3 from roger-zhangg/integ
roger-zhangg Oct 31, 2025
ca85b00
fix remote test event failure
roger-zhangg Nov 4, 2025
7024507
Merge pull request #4 from roger-zhangg/integ
roger-zhangg Nov 4, 2025
ab2313f
Merge branch 'develop' of github.com:aws/aws-sam-cli into integ
roger-zhangg Nov 4, 2025
f50ea5e
address feedback
roger-zhangg Nov 4, 2025
de2d965
Merge pull request #5 from roger-zhangg/integ
roger-zhangg Nov 4, 2025
72cc4d7
Update test_remote_test_event.py
roger-zhangg Nov 4, 2025
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
423 changes: 423 additions & 0 deletions .github/workflows/integration-tests.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion samcli/commands/remote/invoke/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def do_cli(
event = lambda_test_event["json"]
LOG.debug("Remote event contents: %s", event)
metadata = lambda_test_event["metadata"]
if "invocationType" in metadata:
if "invocationType" in metadata and metadata["invocationType"] is not None:
parameter.setdefault("InvocationType", metadata["invocationType"])
elif test_event_name:
LOG.info("Note: remote event is only supported for AWS Lambda Function resource.")
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/utils/name_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
MIN_ARN_PARTS = 5 # Minimum parts for a valid ARN structure

LAMBDA_FUNCTION_NAME_PATTERN = (
r"^(arn:[^:]+:lambda:[^:]*:\d{12}:function:|\d{12}:function:)?[a-zA-Z0-9-_\.]+(:[\w$-]+)?$"
r"^(arn:[^:]+:lambda:[^:]*:\d{12}:function:|\d{12}:function:)?[a-zA-Z0-9-_\.\[\]]+(:[\w$-]+)?$"
)


Expand Down
15 changes: 12 additions & 3 deletions tests/get_testing_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import json
import os
import sys

import boto3
from boto3.session import Session
Expand All @@ -16,7 +17,8 @@


def main():
env_vars = get_testing_credentials()
skip_role_deletion = len(sys.argv) > 1 and sys.argv[1] == "skip_role_deletion"
env_vars = get_testing_credentials(skip_role_deletion)
# Assume testing account credential in order to access managed test resource stack
test_session = Session(
aws_access_key_id=env_vars["accessKeyID"],
Expand All @@ -37,7 +39,7 @@ def get_managed_test_resource_outputs(session: Session):
return outputs_dict


def get_testing_credentials():
def get_testing_credentials(skip_role_deletion=False):
lambda_arn = os.environ["CREDENTIAL_DISTRIBUTION_LAMBDA_ARN"]
# Max attempts to 0 so that boto3 will not invoke multiple times
lambda_client = boto3.client(
Expand All @@ -49,7 +51,14 @@ def get_testing_credentials():
),
region_name="us-west-2",
)
response = lambda_client.invoke(FunctionName=lambda_arn)

# Prepare payload if skip_role_deletion is True
if skip_role_deletion:
payload_data = json.dumps({"skip_role_deletion": True})
response = lambda_client.invoke(FunctionName=lambda_arn, Payload=payload_data)
else:
response = lambda_client.invoke(FunctionName=lambda_arn)

payload = json.loads(response["Payload"].read())
if response.get("FunctionError"):
raise ValueError(f"Failed to get credential. {payload['errorType']}")
Expand Down
30 changes: 29 additions & 1 deletion tests/integration/buildcmd/build_integ_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import time
import logging
import json
from datetime import datetime, timezone
from typing import Optional
from unittest import TestCase

Expand Down Expand Up @@ -36,6 +37,27 @@
LOG = logging.getLogger(__name__)


def show_container_in_test_name(testcase_func, param_num, param):
"""
Generates a custom name for parameterized test cases.
Adds '_in_container' suffix when any parameter contains 'container' in its string representation.
"""
# Get the base test name
base_name = f"{testcase_func.__name__}_{param_num}"

# Check if any parameter contains "container" in its string representation
for arg in param.args:
if isinstance(arg, str) and "container" in arg.lower():
base_name += "_in_container"
break
elif arg is True: # Also check for boolean True which might indicate use_container
# Check if this might be a use_container parameter by position
# This is a fallback for cases where True is used instead of "use_container"
continue

return base_name


class BuildIntegBase(TestCase):
template: Optional[str] = "template.yaml"

Expand Down Expand Up @@ -543,6 +565,12 @@ def _test_with_go(self, runtime, code_uri, mode, relative_path, architecture=Non
newenv["GOPROXY"] = "direct"
newenv["GOPATH"] = str(self.working_dir)

# Build with musl target to avoid glibc compatibility issues
# This ensures the binary works in the Lambda execution environment
newenv["GOOS"] = "linux"
newenv["GOARCH"] = "arm64" if architecture == ARM64 else "amd64"
newenv["CGO_ENABLED"] = "0"

run_command(cmdlist, cwd=self.working_dir, env=newenv)

self._verify_built_artifact(
Expand Down Expand Up @@ -638,7 +666,7 @@ def _test_with_building_java(
osutils.convert_to_unix_line_ending(os.path.join(self.test_data_path, self.USING_GRADLEW_PATH, "gradlew"))
# Use shorter timeout in GitHub Actions to fail faster;
# Putting 1800 because Windows Canary Instances takes longer
timeout = 90 if os.environ.get("GITHUB_ACTIONS") else 1800
timeout = 1800 if os.environ.get("BY_CANARY") else 180
run_command(cmdlist, cwd=self.working_dir, timeout=timeout)

self._verify_built_artifact(
Expand Down
Loading
Loading