Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sam-cli-bot committed Nov 16, 2022
2 parents c901b8d + 1c55309 commit 4aad0e0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
2 changes: 1 addition & 1 deletion aws_lambda_builders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

# Changing version will trigger a new release!
# Please make the version change as the last step of your development.
__version__ = "1.22.0"
__version__ = "1.23.0"
RPC_PROTOCOL_VERSION = "0.3"
1 change: 1 addition & 0 deletions aws_lambda_builders/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"nodejs12.x": [ARM64, X86_64],
"nodejs14.x": [ARM64, X86_64],
"nodejs16.x": [ARM64, X86_64],
"nodejs18.x": [ARM64, X86_64],
"python3.6": [X86_64],
"python3.7": [X86_64],
"python3.8": [ARM64, X86_64],
Expand Down
23 changes: 13 additions & 10 deletions tests/integration/workflows/nodejs_npm/test_nodejs_npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def tearDown(self):
shutil.rmtree(self.scratch_dir)
shutil.rmtree(self.dependencies_dir)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_project_without_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps")

Expand All @@ -51,7 +51,7 @@ def test_builds_project_without_dependencies(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_project_without_manifest(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-manifest")

Expand All @@ -69,7 +69,7 @@ def test_builds_project_without_manifest(self, runtime):
mock_warning.assert_called_once_with("package.json file not found. Continuing the build without dependencies.")
self.assertEqual(expected_files, output_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_project_and_excludes_hidden_aws_sam(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "excluded-files")

Expand All @@ -85,7 +85,7 @@ def test_builds_project_and_excludes_hidden_aws_sam(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_project_with_remote_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps")

Expand All @@ -105,7 +105,7 @@ def test_builds_project_with_remote_dependencies(self, runtime):
output_modules = set(os.listdir(os.path.join(self.artifacts_dir, "node_modules")))
self.assertEqual(expected_modules, output_modules)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_project_with_npmrc(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npmrc")

Expand All @@ -131,12 +131,15 @@ def test_builds_project_with_npmrc(self, runtime):
("nodejs12.x", "package-lock"),
("nodejs14.x", "package-lock"),
("nodejs16.x", "package-lock"),
("nodejs18.x", "package-lock"),
("nodejs12.x", "shrinkwrap"),
("nodejs14.x", "shrinkwrap"),
("nodejs16.x", "shrinkwrap"),
("nodejs18.x", "shrinkwrap"),
("nodejs12.x", "package-lock-and-shrinkwrap"),
("nodejs14.x", "package-lock-and-shrinkwrap"),
("nodejs16.x", "package-lock-and-shrinkwrap"),
("nodejs18.x", "package-lock-and-shrinkwrap"),
]
)
def test_builds_project_with_lockfile(self, runtime, dir_name):
Expand All @@ -163,7 +166,7 @@ def test_builds_project_with_lockfile(self, runtime, dir_name):

self.assertEqual(expected_files, output_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_fails_if_npm_cannot_resolve_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "broken-deps")

Expand All @@ -178,7 +181,7 @@ def test_fails_if_npm_cannot_resolve_dependencies(self, runtime):

self.assertIn("No matching version found for [email protected]", str(ctx.exception))

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_project_with_remote_dependencies_without_download_dependencies_with_dependencies_dir(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps")

Expand All @@ -196,7 +199,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_project_with_remote_dependencies_with_download_dependencies_and_dependencies_dir(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps")

Expand Down Expand Up @@ -226,7 +229,7 @@ def test_builds_project_with_remote_dependencies_with_download_dependencies_and_
output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir)))
self.assertNotIn(expected_dependencies_files, output_dependencies_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_project_with_remote_dependencies_without_download_dependencies_without_dependencies_dir(
self, runtime
):
Expand All @@ -252,7 +255,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w
"artifacts directory. "
)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_project_without_combine_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def tearDown(self):
shutil.rmtree(self.artifacts_dir)
shutil.rmtree(self.scratch_dir)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_javascript_project_with_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild")

Expand All @@ -59,7 +59,7 @@ def test_builds_javascript_project_with_dependencies(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_javascript_project_with_multiple_entrypoints(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild-multiple-entrypoints")

Expand All @@ -80,7 +80,7 @@ def test_builds_javascript_project_with_multiple_entrypoints(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_typescript_projects(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild-typescript")

Expand All @@ -101,7 +101,7 @@ def test_builds_typescript_projects(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_with_external_esbuild(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps-esbuild")
options = {"entry_points": ["included.js"]}
Expand All @@ -121,7 +121,7 @@ def test_builds_with_external_esbuild(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_no_options_passed_to_esbuild(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild")

Expand All @@ -138,7 +138,7 @@ def test_no_options_passed_to_esbuild(self, runtime):

self.assertEqual(str(context.exception), "NodejsNpmEsbuildBuilder:EsbuildBundle - entry_points not set ({})")

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_bundle_with_implicit_file_types(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "implicit-file-types")

Expand All @@ -159,7 +159,7 @@ def test_bundle_with_implicit_file_types(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_bundles_project_without_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-package-esbuild")
options = {"entry_points": ["included"]}
Expand All @@ -185,7 +185,7 @@ def test_bundles_project_without_dependencies(self, runtime):
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_project_with_remote_dependencies_without_download_dependencies_with_dependencies_dir(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-no-node_modules")
options = {"entry_points": ["included.js"]}
Expand Down Expand Up @@ -213,7 +213,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w
output_files = set(os.listdir(self.artifacts_dir))
self.assertEqual(expected_files, output_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_project_with_remote_dependencies_with_download_dependencies_and_dependencies_dir(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-no-node_modules")
options = {"entry_points": ["included.js"]}
Expand Down Expand Up @@ -243,7 +243,7 @@ def test_builds_project_with_remote_dependencies_with_download_dependencies_and_
output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir)))
self.assertNotIn(expected_dependencies_files, output_dependencies_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_project_with_remote_dependencies_without_download_dependencies_without_dependencies_dir(
self, runtime
):
Expand All @@ -268,7 +268,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w
" workflow can't include a dependencies directory without installing dependencies.",
)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_project_without_combine_dependencies(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-no-node_modules")
options = {"entry_points": ["included.js"]}
Expand Down Expand Up @@ -299,7 +299,7 @@ def test_builds_project_without_combine_dependencies(self, runtime):
output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir)))
self.assertNotIn(expected_dependencies_files, output_dependencies_files)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_javascript_project_with_external(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild-externals")

Expand All @@ -324,7 +324,7 @@ def test_builds_javascript_project_with_external(self, runtime):
# Check that the module has been require() instead of bundled
self.assertIn('require("minimal-request-promise")', js_file)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_builds_javascript_project_with_loader(self, runtime):
osutils = OSUtils()
source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps-esbuild-loader")
Expand Down Expand Up @@ -366,7 +366,7 @@ def test_builds_javascript_project_with_loader(self, runtime):
),
)

@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)])
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)])
def test_includes_sourcemap_if_requested(self, runtime):
source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild")

Expand Down

0 comments on commit 4aad0e0

Please sign in to comment.